aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorRobert2017-12-01 15:25:57 +0100
committerRobert2017-12-01 15:25:57 +0100
commitfa4ce19b047c1596ee2c1332f229e360df30620c (patch)
tree66b10a428abef624e691bb79ecba566200e7021d /app
parent2792336f98056f3f7df8d02a3b2da968e97bfbe1 (diff)
parent02421bba16fe1bde061d473c8d1c2fd6d88a6f19 (diff)
downloadchouette-core-fa4ce19b047c1596ee2c1332f229e360df30620c.tar.bz2
Merge branch 'master' of github.com:af83/stif-boiv
Diffstat (limited to 'app')
-rw-r--r--app/decorators/import_decorator.rb22
-rw-r--r--app/helpers/application_helper.rb2
-rw-r--r--app/views/layouts/navigation/_page_header.html.slim10
-rw-r--r--app/views/referential_lines/show.html.slim16
-rw-r--r--app/views/vehicle_journeys/index.html.slim2
5 files changed, 27 insertions, 25 deletions
diff --git a/app/decorators/import_decorator.rb b/app/decorators/import_decorator.rb
index d63d723cd..e748f830d 100644
--- a/app/decorators/import_decorator.rb
+++ b/app/decorators/import_decorator.rb
@@ -12,6 +12,7 @@ class ImportDecorator < Draper::Decorator
end
def action_links
+ policy = h.policy(object)
links = []
links << Link.new(
@@ -27,16 +28,17 @@ class ImportDecorator < Draper::Decorator
href: object.file.url
)
- # if h.policy(object).destroy?
- links << Link.new(
- content: h.destroy_link_content,
- href: h.workbench_import_path(
- context[:workbench],
- object
- ),
- method: :delete,
- data: { confirm: h.t('imports.actions.destroy_confirm') }
- )
+ if policy.destroy?
+ links << Link.new(
+ content: h.destroy_link_content,
+ href: h.workbench_import_path(
+ context[:workbench],
+ object
+ ),
+ method: :delete,
+ data: { confirm: h.t('imports.actions.destroy_confirm') }
+ )
+ end
links
end
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 2ce1de497..d2cdaaa20 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -18,7 +18,7 @@ module ApplicationHelper
info = t('last_update', time: l(object.updated_at, format: :short))
if object.try(:versions)
author = object.versions.try(:last).try(:whodunnit) || t('default_whodunnit')
- info = "#{info} #{t('whodunnit', author: author)}"
+ info = "#{info} <br/> #{t('whodunnit', author: author)}"
end
content_tag :div, info.html_safe, class: 'small'
end
diff --git a/app/views/layouts/navigation/_page_header.html.slim b/app/views/layouts/navigation/_page_header.html.slim
index 2548ddd81..176624459 100644
--- a/app/views/layouts/navigation/_page_header.html.slim
+++ b/app/views/layouts/navigation/_page_header.html.slim
@@ -12,13 +12,11 @@ div.page_header
h1 = t("#{resource_class.model_name.name.underscore.pluralize}.#{params[:action]}.title")
div.col-lg-3.col-md-4.col-sm-5.col-xs-5.text-right
- div.page-meta
- - if content_for? :page_header_meta
- div.small = yield :page_header_meta
-
div.page-action
- - if content_for? :page_header_actions
- div.small = yield :page_header_actions
+ - if content_for? :page_header_meta
+ div.small = yield :page_header_meta
+ - if content_for? :page_header_actions
+ = yield :page_header_actions
- if content_for? :page_header_content
= yield :page_header_content
diff --git a/app/views/referential_lines/show.html.slim b/app/views/referential_lines/show.html.slim
index cb4791855..cfba8cab3 100644
--- a/app/views/referential_lines/show.html.slim
+++ b/app/views/referential_lines/show.html.slim
@@ -1,13 +1,13 @@
- breadcrumb :referential_line, @referential, @line
- content_for :page_header_content do
-.row
- .col-lg-12.text-right.mb-sm
- - @line.action_links.each do |link|
- = link_to link.href,
- method: link.method,
- data: link.data,
- class: 'btn btn-primary' do
- = link.content
+ .row
+ .col-lg-12.text-right.mb-sm
+ - @line.action_links.each do |link|
+ = link_to link.href,
+ method: link.method,
+ data: link.data,
+ class: 'btn btn-primary' do
+ = link.content
- page_header_content_for @line
.page_content
diff --git a/app/views/vehicle_journeys/index.html.slim b/app/views/vehicle_journeys/index.html.slim
index ef9b5a780..52c1a9728 100644
--- a/app/views/vehicle_journeys/index.html.slim
+++ b/app/views/vehicle_journeys/index.html.slim
@@ -1,4 +1,6 @@
- breadcrumb :vehicle_journeys, @referential, @route
+- content_for :page_header_title, t('vehicle_journeys.index.title', route: @route.name)
+
.page_content
.container-fluid
.row