aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuc Donnet2016-11-20 16:10:42 +0100
committerLuc Donnet2016-11-20 16:10:42 +0100
commitfb8b8b292b09d29eb87b454cece5ec252776dc12 (patch)
tree9e8549d8042e5c0872b237fd02999ee299efef5f
parentcf477df0e759e7caf266c26435f58ae482e97bab (diff)
downloadchouette-core-fb8b8b292b09d29eb87b454cece5ec252776dc12.tar.bz2
Fix line notes Refs #873
-rw-r--r--app/policies/line_policy.rb4
-rw-r--r--app/views/referential_lines/_form.html.slim32
-rw-r--r--app/views/referential_lines/show.html.slim10
3 files changed, 23 insertions, 23 deletions
diff --git a/app/policies/line_policy.rb b/app/policies/line_policy.rb
index 61cf6c1b8..92310f042 100644
--- a/app/policies/line_policy.rb
+++ b/app/policies/line_policy.rb
@@ -8,8 +8,8 @@ class LinePolicy < ApplicationPolicy
def create?
false
end
- def update? ; create? end
+ def update? ; true end
def new? ; create? end
- def edit? ; create? end
+ def edit? ; true end
def destroy? ; create? end
end
diff --git a/app/views/referential_lines/_form.html.slim b/app/views/referential_lines/_form.html.slim
index ca90ef8c3..a4c98d43d 100644
--- a/app/views/referential_lines/_form.html.slim
+++ b/app/views/referential_lines/_form.html.slim
@@ -1,21 +1,21 @@
= semantic_form_for [@referential, @line] do |form|
= form.inputs do
- = form.input :network, as: :select, :collection => Chouette::Network.all, :include_blank => false
- = form.input :company, as: :select, :collection => Chouette::Company.all, :include_blank => false
- = form.input :name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.line.name") }
- = form.input :published_name
- = form.input :registration_number, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.line.registration_number") }
- = form.input :number, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.line.number") }
- = form.input :transport_mode, include_blank: false
- = form.input :color, as: :string
- = form.input :text_color
- = form.input :stable_id
- = form.input :url
- = form.input :mobility_restricted_suitability, as: :select, :collection => [[@line.human_attribute_name("accessible"), true], [@line.human_attribute_name("not_accessible"), false]], :include_blank => true
- = form.input :flexible_service, as: :select, :collection => [[@line.human_attribute_name("on_demaond_fs"), true], [@line.human_attribute_name("regular_fs"), false]], :include_blank => true
- = form.input :comment
- = form.input :objectid, :required => !@line.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.line.objectid") }
- = form.input :group_of_line_tokens, :label => t('.group_of_lines'), as: :text, :input_html => { :"data-pre" => ( @line.group_of_lines.map { |group_of_line| { :id => group_of_line.id, :name => group_of_line.name } } ).to_json }
+ / = form.input :network, as: :select, :collection => Chouette::Network.all, :include_blank => false
+ / = form.input :company, as: :select, :collection => Chouette::Company.all, :include_blank => false
+ / = form.input :name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.line.name") }
+ / = form.input :published_name
+ / = form.input :registration_number, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.line.registration_number") }
+ / = form.input :number, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.line.number") }
+ / = form.input :transport_mode, include_blank: false
+ / = form.input :color, as: :string
+ / = form.input :text_color
+ / = form.input :stable_id
+ / = form.input :url
+ / = form.input :mobility_restricted_suitability, as: :select, :collection => [[@line.human_attribute_name("accessible"), true], [@line.human_attribute_name("not_accessible"), false]], :include_blank => true
+ / = form.input :flexible_service, as: :select, :collection => [[@line.human_attribute_name("on_demaond_fs"), true], [@line.human_attribute_name("regular_fs"), false]], :include_blank => true
+ / = form.input :comment
+ / = form.input :objectid, :required => !@line.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.line.objectid") }
+ / = form.input :group_of_line_tokens, :label => t('.group_of_lines'), as: :text, :input_html => { :"data-pre" => ( @line.group_of_lines.map { |group_of_line| { :id => group_of_line.id, :name => group_of_line.name } } ).to_json }
.footnotes_block
h3 = t("footnotes.index.title")
diff --git a/app/views/referential_lines/show.html.slim b/app/views/referential_lines/show.html.slim
index 07143488b..0f7dea862 100644
--- a/app/views/referential_lines/show.html.slim
+++ b/app/views/referential_lines/show.html.slim
@@ -107,11 +107,11 @@ h2
/
/ = ": #{@line.vehicle_journeys.count - (@line.vehicle_journeys.where('flexible_service = ?', true).count + @line.vehicle_journeys.where('flexible_service = ?', false).count)}"
/
- / p
- / label = "#{@line.human_attribute_name('footnotes')} : "
- / ul
- / - @line.footnotes.each do |footnote|
- / li = "#{footnote.code} : #{footnote.label}"
+ p
+ label = "#{@line.human_attribute_name('footnotes')} : "
+ ul
+ - @line.footnotes.each do |footnote|
+ li = "#{footnote.code} : #{footnote.label}"
/ p
/ label = "#{@line.human_attribute_name('comment')} : "