diff options
| author | Luc Donnet | 2016-10-12 23:06:15 +0200 |
|---|---|---|
| committer | Luc Donnet | 2016-10-12 23:06:15 +0200 |
| commit | 56e6b5146aca41563b8e64ce95a7cd183fe80b13 (patch) | |
| tree | d3a845d76419a77fafbda66b9bf08f5379ce1ca5 /app/views | |
| parent | c2403fa61c0639d2165af57e6db993a429ae5984 (diff) | |
| parent | d66abf8f9b58ddeeabc4e53e8ed1fd382b9f1907 (diff) | |
| download | chouette-core-56e6b5146aca41563b8e64ce95a7cd183fe80b13.tar.bz2 | |
Merge branch 'master' into staging
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/companies/_companies.html.slim | 11 | ||||
| -rw-r--r-- | app/views/companies/index.html.slim | 7 | ||||
| -rw-r--r-- | app/views/companies/show.html.slim | 21 | ||||
| -rw-r--r-- | app/views/group_of_lines/_group_of_line.html.slim | 8 | ||||
| -rw-r--r-- | app/views/group_of_lines/index.html.slim | 7 | ||||
| -rw-r--r-- | app/views/group_of_lines/show.html.slim | 23 | ||||
| -rw-r--r-- | app/views/line_referentials/show.html.slim | 24 | ||||
| -rw-r--r-- | app/views/lines/_line.html.slim | 6 | ||||
| -rw-r--r-- | app/views/lines/show.html.slim | 17 | ||||
| -rw-r--r-- | app/views/networks/_network.html.slim | 13 | ||||
| -rw-r--r-- | app/views/networks/index.html.slim | 7 | ||||
| -rw-r--r-- | app/views/networks/show.html.slim | 17 | ||||
| -rw-r--r-- | app/views/offer_workbenches/show.html.slim | 4 | ||||
| -rw-r--r-- | app/views/referential_companies/index.js.slim | 2 | ||||
| -rw-r--r-- | app/views/referentials/index.html.slim | 4 | ||||
| -rw-r--r-- | app/views/stop_area_referentials/show.html.slim | 18 | ||||
| -rw-r--r-- | app/views/stop_areas/_stop_area.html.slim | 10 | ||||
| -rw-r--r-- | app/views/stop_areas/index.html.slim | 9 | ||||
| -rw-r--r-- | app/views/stop_areas/show.html.slim | 9 |
19 files changed, 131 insertions, 86 deletions
diff --git a/app/views/companies/_companies.html.slim b/app/views/companies/_companies.html.slim index bcd471cc7..a83b3bada 100644 --- a/app/views/companies/_companies.html.slim +++ b/app/views/companies/_companies.html.slim @@ -1,9 +1,12 @@ .page_info span.search = t('will_paginate.page_entries_info.search') - = page_entries_info(@companies) + = page_entries_info @companies -.companies.paginated_content - = paginated_content(@companies) +.companies.paginated_content style="margin-top:20px;" + = table_builder CompanyDecorator.decorate_collection(@companies), + [:name, :edited_at, :published_at, :validity_period, :linecount, :transporter, :status], + ["show", "delete"], + 'table table-bordered' .pagination - = will_paginate @companies, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer
\ No newline at end of file + = will_paginate @companies, container: false, renderer: RemoteBootstrapPaginationLinkRenderer diff --git a/app/views/companies/index.html.slim b/app/views/companies/index.html.slim index bf295dee7..1b616a6c8 100644 --- a/app/views/companies/index.html.slim +++ b/app/views/companies/index.html.slim @@ -20,6 +20,7 @@ - content_for :sidebar do ul.actions - li - = link_to t('companies.actions.new'), new_line_referential_company_path(@line_referential), class: 'add' - br
\ No newline at end of file + - if policy(Chouette::Company).create? + li + = link_to t('companies.actions.new'), new_line_referential_company_path(@line_referential), class: 'add' + br diff --git a/app/views/companies/show.html.slim b/app/views/companies/show.html.slim index 693cea352..1c244a53a 100644 --- a/app/views/companies/show.html.slim +++ b/app/views/companies/show.html.slim @@ -44,12 +44,15 @@ - content_for :sidebar do ul.actions - li - = link_to t('companies.actions.new'), new_line_referential_company_path(@line_referential), class: 'add' - li - = link_to t('companies.actions.edit'), edit_line_referential_company_path(@line_referential, @company), class: 'edit' - li - = link_to t('companies.actions.destroy'), line_referential_company_path(@line_referential, @company), :method => :delete, :data => {:confirm => t('companies.actions.destroy_confirm')}, class: 'remove' - br - - = creation_tag(@company)
\ No newline at end of file + - if policy(Chouette::Company).create? + li + = link_to t('companies.actions.new'), new_line_referential_company_path(@line_referential), class: 'add' + - if policy(@company).update? + li + = link_to t('companies.actions.edit'), edit_line_referential_company_path(@line_referential, @company), class: 'edit' + - if policy(@company).destroy? + li + = link_to t('companies.actions.destroy'), line_referential_company_path(@line_referential, @company), :method => :delete, :data => {:confirm => t('companies.actions.destroy_confirm')}, class: 'remove' + br + + = creation_tag(@company) diff --git a/app/views/group_of_lines/_group_of_line.html.slim b/app/views/group_of_lines/_group_of_line.html.slim index 16ac4e252..fb9f95894 100644 --- a/app/views/group_of_lines/_group_of_line.html.slim +++ b/app/views/group_of_lines/_group_of_line.html.slim @@ -2,11 +2,11 @@ .panel-heading .panel-title.clearfix span.pull-right - - if edit + - if edit && policy(group_of_line).update? = link_to edit_line_referential_group_of_line_path(@line_referential, group_of_line), class: 'btn btn-default btn-sm' do span.fa.fa-pencil - - = link_to('<span class="fa fa-trash-o"></span>'.html_safe, line_referential_group_of_line_path(@line_referential, group_of_line), :method => :delete, :data => {:confirm => t('group_of_lines.actions.destroy_confirm')}, class: 'btn btn-danger btn-sm') if delete + - if delete && policy(group_of_line).destroy? + = link_to('<span class="fa fa-trash-o"></span>'.html_safe, line_referential_group_of_line_path(@line_referential, group_of_line), :method => :delete, :data => {:confirm => t('group_of_lines.actions.destroy_confirm')}, class: 'btn btn-danger btn-sm') h5 = link_to [@line_referential, group_of_line], :class => "preview", :title => "#{Chouette::GroupOfLine.model_name.human.capitalize} #{group_of_line.name}" do @@ -16,4 +16,4 @@ .panel-body p = group_of_line.human_attribute_name('line_count') - = group_of_line.lines.count
\ No newline at end of file + = group_of_line.lines.count diff --git a/app/views/group_of_lines/index.html.slim b/app/views/group_of_lines/index.html.slim index 8cd39407f..a684095f0 100644 --- a/app/views/group_of_lines/index.html.slim +++ b/app/views/group_of_lines/index.html.slim @@ -19,6 +19,7 @@ - content_for :sidebar do ul.actions - li - = link_to t('group_of_lines.actions.new'), new_line_referential_group_of_line_path(@line_referential), class: 'add' - br
\ No newline at end of file + - if policy(Chouette::GroupOfLine).create? + li + = link_to t('group_of_lines.actions.new'), new_line_referential_group_of_line_path(@line_referential), class: 'add' + br diff --git a/app/views/group_of_lines/show.html.slim b/app/views/group_of_lines/show.html.slim index c93f5277e..b934cb1ef 100644 --- a/app/views/group_of_lines/show.html.slim +++ b/app/views/group_of_lines/show.html.slim @@ -2,7 +2,7 @@ .group_of_line_show = @map.to_html - + .summary p label = "#{@group_of_line.human_attribute_name('registration_number')} : " @@ -13,19 +13,22 @@ = @group_of_line.comment p.after_map - + h3.group_of_line_lines = t('.lines') .lines_detail - == render partial: "lines_detail" + == render partial: "lines_detail" - content_for :sidebar do ul.actions - li - = link_to t('group_of_lines.actions.new'), new_line_referential_group_of_line_path(@line_referential), class: 'add' - li - = link_to t('group_of_lines.actions.edit'), edit_line_referential_group_of_line_path(@line_referential, @group_of_line), class: 'edit' - li - = link_to t('group_of_lines.actions.destroy'), line_referential_group_of_line_path(@line_referential, @group_of_line), :method => :delete, :data => {:confirm => t('group_of_lines.actions.destroy_confirm')} , class: 'remove' + - if policy(Chouette::GroupOfLine).create? + li + = link_to t('group_of_lines.actions.new'), new_line_referential_group_of_line_path(@line_referential), class: 'add' + - if policy(@group_of_line).edit? + li + = link_to t('group_of_lines.actions.edit'), edit_line_referential_group_of_line_path(@line_referential, @group_of_line), class: 'edit' + - if policy(@group_of_line).destroy? + li + = link_to t('group_of_lines.actions.destroy'), line_referential_group_of_line_path(@line_referential, @group_of_line), :method => :delete, :data => {:confirm => t('group_of_lines.actions.destroy_confirm')} , class: 'remove' br - = creation_tag(@group_of_line)
\ No newline at end of file + = creation_tag(@group_of_line) diff --git a/app/views/line_referentials/show.html.slim b/app/views/line_referentials/show.html.slim index 929eda7dd..408a07c2d 100644 --- a/app/views/line_referentials/show.html.slim +++ b/app/views/line_referentials/show.html.slim @@ -13,21 +13,31 @@ span.badge = @line_referential.networks.size = link_to Referential.human_attribute_name("networks"), line_referential_networks_path(@line_referential) - li.list-group-item - span.badge = @line_referential.group_of_lines.size - = link_to Referential.human_attribute_name("group_of_lines"), line_referential_group_of_lines_path(@line_referential) + / li.list-group-item + / span.badge = @line_referential.group_of_lines.size + / = link_to Referential.human_attribute_name("group_of_lines"), line_referential_group_of_lines_path(@line_referential) li.list-group-item span.badge = @line_referential.lines.size = link_to Referential.human_attribute_name("lines"), line_referential_lines_path(@line_referential) -- unless @line_referential.line_referential_sync.line_sync_operations.empty? +- unless @line_referential.line_referential_syncs.empty? h3 Historique des synchronisations ul.list-group width="75%" - - @line_referential.line_referential_sync.line_sync_operations.each do |sync| - li = "#{sync.created_at.to_formatted_s(:short)} - #{sync.message}" + - @line_referential.line_referential_syncs.each do |sync| + - unless sync.line_referential_sync_messages.empty? + - sync.line_referential_sync_messages.last.tap do |log| + - if log.criticity = log.criticity + li.alert class="alert-#{log.criticity}" + strong = l(log.created_at, format: :short) + " : " + / [:processing_time] unit conversion + - data = log.message_attributs.symbolize_keys! + - data[:processing_time] = distance_of_time_in_words(data[:processing_time].to_i) + + = t("line_referential_sync.message.#{log.message_key}", log.message_attributs.symbolize_keys!) - content_for :sidebar do ul.actions - = link_to t('line_referentials.actions.edit'), edit_line_referential_path(@line_referential), class: 'edit'
\ No newline at end of file + li = link_to t('line_referentials.actions.edit'), edit_line_referential_path(@line_referential), class: 'edit' + li = link_to t('line_referentials.actions.sync'), sync_line_referential_path(@line_referential), class: 'sync', method: :post diff --git a/app/views/lines/_line.html.slim b/app/views/lines/_line.html.slim index 552e9d29b..07275e043 100644 --- a/app/views/lines/_line.html.slim +++ b/app/views/lines/_line.html.slim @@ -14,11 +14,11 @@ li .btn-group - - if edit + - if edit && policy(Chouette::Line).update? = link_to edit_line_referential_line_path(line.line_referential, line), class: 'btn btn-default btn-sm' do span.fa.fa-pencil - - if delete + - if delete && policy(Chouette::Line).destroy? = link_to line_referential_line_path(line.line_referential, line), method: :delete, data: { confirm: t('lines.actions.destroy_confirm') }, class: 'btn btn-danger btn-sm' do span.fa.fa-trash-o @@ -50,4 +50,4 @@ = line.human_attribute_name('group_of_line') = link_to_if( line.group_of_lines.first, line.group_of_lines.first.name, line_referential_group_of_line_path(line.line_referential, line.group_of_lines.first), :title => "#{line.human_attribute_name('group_of_line')} #{line.group_of_lines.first.name}") - else - = t('lines.form.several_group_of_lines', :count => line.group_of_lines.count)
\ No newline at end of file + = t('lines.form.several_group_of_lines', :count => line.group_of_lines.count) diff --git a/app/views/lines/show.html.slim b/app/views/lines/show.html.slim index 590f35a27..cca0e395c 100644 --- a/app/views/lines/show.html.slim +++ b/app/views/lines/show.html.slim @@ -131,16 +131,19 @@ h3.routes = t('.itineraries') - content_for :sidebar do ul.actions - li - = link_to t('lines.actions.new'), new_line_referential_line_path(@line_referential), class: 'add' - li - = link_to t('lines.actions.edit'), edit_line_referential_line_path(@line_referential, @line), class: 'edit' - li - = link_to t('lines.actions.destroy'), line_referential_line_path(@line_referential, @line), method: :delete, :data => {:confirm => t('lines.actions.destroy_confirm')}, class: 'remove' + - if policy(Chouette::Line).create? + li + = link_to t('lines.actions.new'), new_line_referential_line_path(@line_referential), class: 'add' + - if policy(@line).update? + li + = link_to t('lines.actions.edit'), edit_line_referential_line_path(@line_referential, @line), class: 'edit' + - if policy(@line).destroy? + li + = link_to t('lines.actions.destroy'), line_referential_line_path(@line_referential, @line), method: :delete, :data => {:confirm => t('lines.actions.destroy_confirm')}, class: 'remove' - if !@line.hub_restricted? || (@line.hub_restricted? && @line.routes.size < 2) / FIXME #825 li / = link_to t('routes.actions.new'), new_referential_line_route_path(@referential, @line), class: 'add' - = creation_tag(@line)
\ No newline at end of file + = creation_tag(@line) diff --git a/app/views/networks/_network.html.slim b/app/views/networks/_network.html.slim index ed216c4c7..94745ca3d 100644 --- a/app/views/networks/_network.html.slim +++ b/app/views/networks/_network.html.slim @@ -2,13 +2,14 @@ .panel-heading .panel-title.clearfix span.pull-right - = link_to edit_line_referential_network_path(@line_referential, network), class: 'btn btn-default btn-sm' do - span.fa.fa-pencil - - = link_to line_referential_network_path(@line_referential, network), method: :delete, :data => { :confirm => t('networks.actions.destroy_confirm') }, class: 'btn btn-danger btn-sm' do - span.fa.fa-trash-o + - if policy(network).update? + = link_to edit_line_referential_network_path(@line_referential, network), class: 'btn btn-default btn-sm' do + span.fa.fa-pencil + - if policy(network).destroy? + = link_to line_referential_network_path(@line_referential, network), method: :delete, :data => { :confirm => t('networks.actions.destroy_confirm') }, class: 'btn btn-danger btn-sm' do + span.fa.fa-trash-o h5 = link_to [@line_referential, network], class: 'preview', title: "#{Chouette::Network.model_name.human.capitalize} #{network.name}" do span.name - = truncate(network.name, :length => 20)
\ No newline at end of file + = truncate(network.name, :length => 20) diff --git a/app/views/networks/index.html.slim b/app/views/networks/index.html.slim index bc32d273c..587552729 100644 --- a/app/views/networks/index.html.slim +++ b/app/views/networks/index.html.slim @@ -18,6 +18,7 @@ - content_for :sidebar do ul.actions - li - = link_to t('networks.actions.new'), new_line_referential_network_path(@line_referential), class: 'add' - br
\ No newline at end of file + - if policy(Chouette::Network).create? + li + = link_to t('networks.actions.new'), new_line_referential_network_path(@line_referential), class: 'add' + br diff --git a/app/views/networks/show.html.slim b/app/views/networks/show.html.slim index e6bf4e399..5d5b1cd74 100644 --- a/app/views/networks/show.html.slim +++ b/app/views/networks/show.html.slim @@ -36,12 +36,15 @@ - content_for :sidebar do ul.actions - li - = link_to t('networks.actions.new'), new_line_referential_network_path(@line_referential), class: 'add' - li - = link_to t('networks.actions.edit'), edit_line_referential_network_path(@line_referential, @network), class: 'edit' - li - = link_to t('networks.actions.destroy'), line_referential_network_path(@line_referential, @network), method: :delete, data: { :confirm => t('networks.actions.destroy_confirm')}, class: 'remove' + - if policy(Chouette::Network).create? + li + = link_to t('networks.actions.new'), new_line_referential_network_path(@line_referential), class: 'add' + - if policy(@network).update? + li + = link_to t('networks.actions.edit'), edit_line_referential_network_path(@line_referential, @network), class: 'edit' + - if policy(@network).destroy? + li + = link_to t('networks.actions.destroy'), line_referential_network_path(@line_referential, @network), method: :delete, data: { :confirm => t('networks.actions.destroy_confirm')}, class: 'remove' br - = creation_tag(@network)
\ No newline at end of file + = creation_tag(@network) diff --git a/app/views/offer_workbenches/show.html.slim b/app/views/offer_workbenches/show.html.slim index bed9205ba..49396a0e2 100644 --- a/app/views/offer_workbenches/show.html.slim +++ b/app/views/offer_workbenches/show.html.slim @@ -1,5 +1,5 @@ -= title_tag "#{@offer_workbench.name} - Tableau de bord" += title_tag "#{@workbench.name} - Tableau de bord" .referentials.paginated_content h4 Liste des jeux de données - = paginated_content @offer_workbench.referentials
\ No newline at end of file + = paginated_content @workbench.referentials diff --git a/app/views/referential_companies/index.js.slim b/app/views/referential_companies/index.js.slim index cfb1c719c..3a1739abf 100644 --- a/app/views/referential_companies/index.js.slim +++ b/app/views/referential_companies/index.js.slim @@ -1 +1 @@ -| $('#companies').html("= escape_javascript(render('companies'))");
\ No newline at end of file +/ | $('#companies').html("= escape_javascript(render('companies'))"); diff --git a/app/views/referentials/index.html.slim b/app/views/referentials/index.html.slim index d9c5376a1..e37f157de 100644 --- a/app/views/referentials/index.html.slim +++ b/app/views/referentials/index.html.slim @@ -1,5 +1,5 @@ / FIXME #827 -- current_organisation.offer_workbenches.each do |workbench| +- current_organisation.workbenches.each do |workbench| h2 = link_to workbench.name, workbench p = "#{workbench.referentials.count} jeu(x) de données à l'heure actuelle" @@ -22,4 +22,4 @@ / FIXME #824 / Don't blame me. See #824 - li = link_to 'Données CodifLigne', line_referential_path(1)
\ No newline at end of file + li = link_to 'Données CodifLigne', line_referential_path(1) diff --git a/app/views/stop_area_referentials/show.html.slim b/app/views/stop_area_referentials/show.html.slim index 32fe950dc..9cceed5e5 100644 --- a/app/views/stop_area_referentials/show.html.slim +++ b/app/views/stop_area_referentials/show.html.slim @@ -9,12 +9,22 @@ span.badge = @stop_area_referential.stop_areas.size = link_to Referential.human_attribute_name("stop_areas"), stop_area_referential_stop_areas_path(@stop_area_referential) -- unless @stop_area_referential.stop_area_referential_sync.stop_area_sync_operations.empty? +- unless @stop_area_referential.stop_area_referential_syncs.empty? h3 Historique des synchronisations ul.list-group width="75%" - - @stop_area_referential.stop_area_referential_sync.stop_area_sync_operations.each do |sync| - li = "#{sync.created_at.to_formatted_s(:short)} - #{sync.message}" + - @stop_area_referential.stop_area_referential_syncs.each do |sync| + - unless sync.stop_area_referential_sync_messages.empty? + - sync.stop_area_referential_sync_messages.last.tap do |log| + - if log.criticity = log.criticity + li.alert class="alert-#{log.criticity}" + strong = l(log.created_at, format: :short) + " : " + / [:processing_time] unit conversion + - data = log.message_attributs.symbolize_keys! + - data[:processing_time] = distance_of_time_in_words(data[:processing_time].to_i) + + = t("stop_area_referential_sync.message.#{log.message_key}", log.message_attributs.symbolize_keys!) - content_for :sidebar do - ul.actions
\ No newline at end of file + ul.actions + li = link_to t('stop_area_referentials.actions.sync'), sync_stop_area_referential_path(@stop_area_referential), class: 'sync', method: :post diff --git a/app/views/stop_areas/_stop_area.html.slim b/app/views/stop_areas/_stop_area.html.slim index 15f9e4452..39cb09660 100644 --- a/app/views/stop_areas/_stop_area.html.slim +++ b/app/views/stop_areas/_stop_area.html.slim @@ -2,11 +2,13 @@ .panel-heading .panel-title.clearfix span.pull-right - = link_to edit_stop_area_referential_stop_area_path(@stop_area_referential, stop_area), class: 'btn btn-default btn-sm' do - span.fa.fa-pencil + - if policy(stop_area).update? + = link_to edit_stop_area_referential_stop_area_path(@stop_area_referential, stop_area), class: 'btn btn-default btn-sm' do + span.fa.fa-pencil - = link_to stop_area_referential_stop_area_path(@stop_area_referential, stop_area), method: :delete, :data => { :confirm => t('stop_areas.actions.destroy_confirm') }, class: 'btn btn-danger btn-sm' do - span.fa.fa-trash-o + - if policy(stop_area).destroy? + = link_to stop_area_referential_stop_area_path(@stop_area_referential, stop_area), method: :delete, :data => { :confirm => t('stop_areas.actions.destroy_confirm') }, class: 'btn btn-danger btn-sm' do + span.fa.fa-trash-o h5 = link_to([@stop_area_referential, stop_area], class: 'preview', :title => t("area_types.label.#{stop_area.stop_area_type}") + " #{stop_area.name}") do diff --git a/app/views/stop_areas/index.html.slim b/app/views/stop_areas/index.html.slim index 6a01bdcb3..b6328c6f9 100644 --- a/app/views/stop_areas/index.html.slim +++ b/app/views/stop_areas/index.html.slim @@ -8,7 +8,7 @@ .panel-heading .input-group.col-md-9 = f.text_field :name_cont, placeholder: "#{t('.name')}", class: 'form-control' - + .input-group-btn button.btn.btn-default type="submit" i.fa.fa-search @@ -27,6 +27,7 @@ - content_for :sidebar do ul.actions - li = link_to t('stop_areas.actions.new'), new_stop_area_referential_stop_area_path(@stop_area_referential), class: 'add' - li - / = link_to t('stop_areas.actions.default_geometry'), default_geometry_referential_stop_areas_path(@stop_area_referential), :method => :put, :class => "calculator"
\ No newline at end of file + - if policy(Chouette::StopArea).create? + li = link_to t('stop_areas.actions.new'), new_stop_area_referential_stop_area_path(@stop_area_referential), class: 'add' + + / = link_to t('stop_areas.actions.default_geometry'), default_geometry_referential_stop_areas_path(@stop_area_referential), :method => :put, :class => "calculator" diff --git a/app/views/stop_areas/show.html.slim b/app/views/stop_areas/show.html.slim index c9d0b67a3..50e535cb5 100644 --- a/app/views/stop_areas/show.html.slim +++ b/app/views/stop_areas/show.html.slim @@ -123,9 +123,12 @@ p.after_map tr td ul.actions - li = link_to t('stop_areas.actions.new'), new_stop_area_referential_stop_area_path(@stop_area_referential), class: 'add' - li = link_to t('stop_areas.actions.edit'), edit_stop_area_referential_stop_area_path(@stop_area_referential, @stop_area), class: 'edit' - li = link_to t('stop_areas.actions.destroy'), stop_area_referential_stop_area_path(@stop_area_referential, @stop_area), method: :delete, :data => {:confirm => t('stop_areas.actions.destroy_confirm')}, class: 'remove' + - if policy(Chouette::StopArea).new? + li = link_to t('stop_areas.actions.new'), new_stop_area_referential_stop_area_path(@stop_area_referential), class: 'add' + - if policy(@stop_area).update? + li = link_to t('stop_areas.actions.edit'), edit_stop_area_referential_stop_area_path(@stop_area_referential, @stop_area), class: 'edit' + - if policy(@stop_area).destroy? + li = link_to t('stop_areas.actions.destroy'), stop_area_referential_stop_area_path(@stop_area_referential, @stop_area), method: :delete, :data => {:confirm => t('stop_areas.actions.destroy_confirm')}, class: 'remove' - if manage_itl #Fixme |
