diff options
| author | anicet | 2015-06-15 15:50:43 +0200 |
|---|---|---|
| committer | anicet | 2015-06-16 10:45:54 +0200 |
| commit | 1f21fe9db19049d7d1052efb4928b67dc640c9eb (patch) | |
| tree | d0c3dab46a58eefb5fcd0ddbc8042614fcc057dd /app/views/shared | |
| parent | bde2f4c0018ebdc3b9cca5047e61ab517556b78b (diff) | |
| download | chouette-core-1f21fe9db19049d7d1052efb4928b67dc640c9eb.tar.bz2 | |
Ie Report : split file and line in partials
Diffstat (limited to 'app/views/shared')
| -rw-r--r-- | app/views/shared/_ie_report.html.erb | 92 | ||||
| -rw-r--r-- | app/views/shared/_ie_report_file.html.erb | 26 | ||||
| -rw-r--r-- | app/views/shared/_ie_report_line.html.erb | 37 |
3 files changed, 73 insertions, 82 deletions
diff --git a/app/views/shared/_ie_report.html.erb b/app/views/shared/_ie_report.html.erb index 9aea46f79..9c799ef1c 100644 --- a/app/views/shared/_ie_report.html.erb +++ b/app/views/shared/_ie_report.html.erb @@ -1,12 +1,11 @@ -<div class="resume row"> - <ul class="nav nav-tabs" role="tablist" id="ie_tab"> - <% if job.respond_to?(:file_path) %> +<div class="resume"> + <% if job.respond_to?(:file_path) %> + <ul class="nav nav-tabs" role="tablist"> <li role="presentation" class="active"> - <a href="#ie_tab_file" class="ie_tab_file" aria-controls="ie_tabe_file" role="tab" data-toggle="tab"> + <a href="#ie_tab_file" class="ie_tab_file" aria-controls="ie_tab_file" role="tab" data-toggle="tab"> <%=t('.tab.file')%> </a> </li> - <% end %> <li role="presentation"> <a href="#ie_tab_line" class="ie_tab_line" aria-controls="ie_tab_line" role="tab" data-toggle="tab"> <%=t('.tab.line')%> @@ -15,85 +14,14 @@ </ul> <div class="tab-content"> - <% if job.respond_to?(:file_path) %> - <div role="tabpanel" class="tab-pane active" id="ie_tabe_file"> - <div class="caption"><%= t(".graph.files.title_default", {:job => job.class.model_name.human, :extension => job.filename_extension} ) %></div> - <div id="files_statistics"></div> + <div role="tabpanel" class="tab-pane active" id="ie_tab_file"> + <%= render partial: 'shared/ie_report_file', locals: { job: job } %> </div> - <% end %> <div role="tabpanel" class="tab-pane" id="ie_tab_line"> - <table class="table"> - <thead> - <tr> - <th>nombre de lignes lues</th> - <th>nombre de lignes sauvegardés</th> - <th>nombre de lignes non-sauvegardées (A-B ...)</th> - </tr> - </thead> - <tbody> - <tr> - <td><%= job.report.lines %></td> - <td><%= job.report.saved_lines %></td> - <td><%= job.report.unsaved_lines %></td> - </tr> - </tbody> - </table> + <%= render partial: 'shared/ie_report_line', locals: { job: job } %> </div> </div> -</div> - -<div class="report" data-refresh-interval="<%= job_refresh_interval(job) %>"> - <div class="files files_error" data-label="<%= t('.graph.files.error') %>"> - <% job.report.error_files.each_with_index do |file, index| %> - <div class="col-md-6"> - <%= image_tag "icons/file_xml_md.png" %><span class="file_name" title='<%= file.name %>'><%= truncate(file.name, :length => 40) %></span> - </div> - <% end %> - </div> - <div class="files files_ignored" data-label="<%= t('.graph.files.ignored') %>"> - <% job.report.ignored_files.each_with_index do |file, index| %> - <div class="col-md-6"> - <%= image_tag "icons/file_xml_md.png" %><span class="file_name" title='<%= file.name %>'><%= truncate(file.name, :length => 40) %></span> - </div> - <% end %> - </div> - <div class="files files_ok" data-label="<%= t('.graph.files.ok') %>"> - <% job.report.ok_files.each_with_index do |file, index| %> - <div class="col-md-6"> - <%= image_tag "icons/file_xml_md.png" %><span class="file_name" title='<%= file.name %>'><%= truncate(file.name, :length => 40) %></span> - </div> - <% end %> - </div> - <div class="lines"> - <table class="table table-hover table-striped" data-label="<%= t('.graph.lines.objects_label') %>" data-total-lines="<%= job.report.lines %>" data-total-routes="<%= job.report.routes %>" data-total-connection_links="<%= job.report.connection_links %>", data-total-time_tables="<%= job.report.time_tables %>" data-total-stop_areas="<%= job.report.stop_areas %>" data-total-access_points="<%= job.report.access_points %>" data-total-vehicle_journeys="<%= job.report.vehicle_journeys %>" data-total-journey_patterns="<%= job.report.journey_patterns %>" > - <thead> - <tr> - <th class="save"><%= t(".table.line.save") %></th> - <th class="lines"><%= t(".table.line.lines") %></th> - <th class="routes"><%= t(".table.line.routes") %></th> - <th class="connection_links"><%= t(".table.line.connection_links") %></th> - <th class="time_tables"><%= t(".table.line.time_tables") %></th> - <th class="stop_areas"><%= t(".table.line.stop_areas") %></th> - <th class="access_points"><%= t(".table.line.access_points") %></th> - <th class="vehicle_journeys"><%= t(".table.line.vehicle_journeys") %></th> - <th class="journey_patterns"><%= t(".table.line.journey_patterns") %></th> - </tr> - </thead> - <tbody> - <% job.report.line_items.each_with_index do |line_item, index| %> - <tr> - <td><%= line_item.status ? font_awesome_classic_tag("fa-check") : font_awesome_classic_tag("fa-times") %></td> - <td><%= line_item.name %></td> - <td><%= line_item.routes %></td> - <td><%= line_item.connection_links %></td> - <td><%= line_item.time_tables %></td> - <td><%= line_item.stop_areas %></td> - <td><%= line_item.access_points %></td> - <td><%= line_item.vehicle_journeys %></td> - <td><%= line_item.journey_patterns %></td> - </tr> - <% end %> - </tbody> - </table> - </div> + <% else %> + <%= render partial: 'shared/ie_report_line', locals: { job: job } %> + <% end %> </div> diff --git a/app/views/shared/_ie_report_file.html.erb b/app/views/shared/_ie_report_file.html.erb new file mode 100644 index 000000000..78c363446 --- /dev/null +++ b/app/views/shared/_ie_report_file.html.erb @@ -0,0 +1,26 @@ +<div class="caption"><%= t(".graph.files.title_default", {:job => job.class.model_name.human, :extension => job.filename_extension} ) %></div> +<div id="files_statistics"></div> + +<div class="report results" data-refresh-interval="<%= job_refresh_interval(job) %>"> + <div class="files files_error" data-label="<%= t('.graph.files.error') %>"> + <% job.report.error_files.each_with_index do |file, index| %> + <div class="col-md-6"> + <%= image_tag "icons/file_xml_md.png" %><span class="file_name" title='<%= file.name %>'><%= truncate(file.name, :length => 40) %></span> + </div> + <% end %> + </div> + <div class="files files_ignored" data-label="<%= t('.graph.files.ignored') %>"> + <% job.report.ignored_files.each_with_index do |file, index| %> + <div class="col-md-6"> + <%= image_tag "icons/file_xml_md.png" %><span class="file_name" title='<%= file.name %>'><%= truncate(file.name, :length => 40) %></span> + </div> + <% end %> + </div> + <div class="files files_ok" data-label="<%= t('.graph.files.ok') %>"> + <% job.report.ok_files.each_with_index do |file, index| %> + <div class="col-md-6"> + <%= image_tag "icons/file_xml_md.png" %><span class="file_name" title='<%= file.name %>'><%= truncate(file.name, :length => 40) %></span> + </div> + <% end %> + </div> +</div> diff --git a/app/views/shared/_ie_report_line.html.erb b/app/views/shared/_ie_report_line.html.erb new file mode 100644 index 000000000..3fa40f641 --- /dev/null +++ b/app/views/shared/_ie_report_line.html.erb @@ -0,0 +1,37 @@ +<p class="lead"> + <p><b><%=t('.read_lines') %></b> : <%= job.report.lines %></p> + <p><b><%=t('.saved_lines') %></b> : <%= job.report.saved_lines %></p> + <p><b><%=t('.unsaved_lines') %></b> : <%= job.report.unsaved_lines %></p> +</p> +<div class="report" data-refresh-interval="<%= job_refresh_interval(job) %>"> + <table class="table table-hover table-striped"> + <thead> + <tr> + <th class="save"><%= t(".table.line.save") %></th> + <th class="lines"><%= t(".table.line.lines") %></th> + <th class="routes"><%= t(".table.line.routes") %></th> + <th class="connection_links"><%= t(".table.line.connection_links") %></th> + <th class="time_tables"><%= t(".table.line.time_tables") %></th> + <th class="stop_areas"><%= t(".table.line.stop_areas") %></th> + <th class="access_points"><%= t(".table.line.access_points") %></th> + <th class="vehicle_journeys"><%= t(".table.line.vehicle_journeys") %></th> + <th class="journey_patterns"><%= t(".table.line.journey_patterns") %></th> + </tr> + </thead> + <tbody> + <% job.report.line_items.each_with_index do |line_item, index| %> + <tr> + <td><%= line_item.status ? font_awesome_classic_tag("fa-check") : font_awesome_classic_tag("fa-times") %></td> + <td><%= line_item.name %></td> + <td><%= line_item.routes %></td> + <td><%= line_item.connection_links %></td> + <td><%= line_item.time_tables %></td> + <td><%= line_item.stop_areas %></td> + <td><%= line_item.access_points %></td> + <td><%= line_item.vehicle_journeys %></td> + <td><%= line_item.journey_patterns %></td> + </tr> + <% end %> + </tbody> + </table> +</div> |
