aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert2017-12-01 15:25:57 +0100
committerRobert2017-12-01 15:25:57 +0100
commitfa4ce19b047c1596ee2c1332f229e360df30620c (patch)
tree66b10a428abef624e691bb79ecba566200e7021d
parent2792336f98056f3f7df8d02a3b2da968e97bfbe1 (diff)
parent02421bba16fe1bde061d473c8d1c2fd6d88a6f19 (diff)
downloadchouette-core-fa4ce19b047c1596ee2c1332f229e360df30620c.tar.bz2
Merge branch 'master' of github.com:af83/stif-boiv
-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
-rw-r--r--config/locales/en.yml2
-rw-r--r--config/locales/fr.yml2
-rw-r--r--config/locales/workbenches.en.yml2
-rw-r--r--config/locales/workbenches.fr.yml2
-rw-r--r--db/migrate/20171109100955_add_object_id_format_to_workbenches.rb2
-rw-r--r--db/migrate/20171109101523_add_object_id_format_to_referential.rb2
-rw-r--r--db/migrate/20171109101545_add_object_id_format_to_line_referential.rb2
-rw-r--r--db/migrate/20171109101605_add_object_id_format_to_stop_area_referential.rb2
13 files changed, 37 insertions, 31 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
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 4834ceef4..e59960f95 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -47,7 +47,7 @@ en:
errors:
format: "%{message}"
- last_update: 'Last update on<br>%{time}'
+ last_update: 'Last update on %{time}'
whodunnit: 'By %{author}'
default_whodunnit: 'web service'
last_sync: 'Last sync on %{time}'
diff --git a/config/locales/fr.yml b/config/locales/fr.yml
index 24482166c..175b71ebc 100644
--- a/config/locales/fr.yml
+++ b/config/locales/fr.yml
@@ -47,7 +47,7 @@ fr:
errors:
format: "%{message}"
- last_update: 'Dernière mise à jour<br>le %{time}'
+ last_update: 'Dernière mise à jour le %{time}'
whodunnit: 'Par %{author}'
default_whodunnit: 'web service'
last_sync: 'Dernière mise à jour le %{time}'
diff --git a/config/locales/workbenches.en.yml b/config/locales/workbenches.en.yml
index 3a2fcd598..7f21f47a0 100644
--- a/config/locales/workbenches.en.yml
+++ b/config/locales/workbenches.en.yml
@@ -1,5 +1,7 @@
en:
workbenches:
+ show:
+ title: "%{name}"
index:
title: "%{organisation} dashboard"
offers:
diff --git a/config/locales/workbenches.fr.yml b/config/locales/workbenches.fr.yml
index 0f8a516e3..d76255e86 100644
--- a/config/locales/workbenches.fr.yml
+++ b/config/locales/workbenches.fr.yml
@@ -1,5 +1,7 @@
fr:
workbenches:
+ show:
+ title: "%{name}"
referential_count:
zero: "Aucun jeu de données dans cet espace de travail"
one: "1 jeu de données dans cet espace de travail"
diff --git a/db/migrate/20171109100955_add_object_id_format_to_workbenches.rb b/db/migrate/20171109100955_add_object_id_format_to_workbenches.rb
index 0e5e57643..f7e7452e1 100644
--- a/db/migrate/20171109100955_add_object_id_format_to_workbenches.rb
+++ b/db/migrate/20171109100955_add_object_id_format_to_workbenches.rb
@@ -1,5 +1,5 @@
class AddObjectIdFormatToWorkbenches < ActiveRecord::Migration
def change
- add_column :workbenches, :objectid_format, :string
+ add_column :workbenches, :objectid_format, :string unless column_exists? :workbenches, :objectid_format
end
end
diff --git a/db/migrate/20171109101523_add_object_id_format_to_referential.rb b/db/migrate/20171109101523_add_object_id_format_to_referential.rb
index fed630b75..0a28fb10a 100644
--- a/db/migrate/20171109101523_add_object_id_format_to_referential.rb
+++ b/db/migrate/20171109101523_add_object_id_format_to_referential.rb
@@ -1,5 +1,5 @@
class AddObjectIdFormatToReferential < ActiveRecord::Migration
def change
- add_column :referentials, :objectid_format, :string
+ add_column :referentials, :objectid_format, :string unless column_exists? :referentials, :objectid_format
end
end
diff --git a/db/migrate/20171109101545_add_object_id_format_to_line_referential.rb b/db/migrate/20171109101545_add_object_id_format_to_line_referential.rb
index 5d2fc9f4f..6578de73f 100644
--- a/db/migrate/20171109101545_add_object_id_format_to_line_referential.rb
+++ b/db/migrate/20171109101545_add_object_id_format_to_line_referential.rb
@@ -1,5 +1,5 @@
class AddObjectIdFormatToLineReferential < ActiveRecord::Migration
def change
- add_column :line_referentials, :objectid_format, :string
+ add_column :line_referentials, :objectid_format, :string unless column_exists? :line_referentials, :objectid_format
end
end
diff --git a/db/migrate/20171109101605_add_object_id_format_to_stop_area_referential.rb b/db/migrate/20171109101605_add_object_id_format_to_stop_area_referential.rb
index ffa77e2ed..71c7d662a 100644
--- a/db/migrate/20171109101605_add_object_id_format_to_stop_area_referential.rb
+++ b/db/migrate/20171109101605_add_object_id_format_to_stop_area_referential.rb
@@ -1,5 +1,5 @@
class AddObjectIdFormatToStopAreaReferential < ActiveRecord::Migration
def change
- add_column :stop_area_referentials, :objectid_format, :string
+ add_column :stop_area_referentials, :objectid_format, :string unless column_exists? :stop_area_referentials, :objectid_format
end
end