diff options
| -rw-r--r-- | app/assets/stylesheets/main/lines.css.scss | 8 | ||||
| -rw-r--r-- | app/views/footnotes/_footnote_fields.html.erb | 6 | ||||
| -rw-r--r-- | app/views/lines/_form.erb | 22 | ||||
| -rw-r--r-- | config/locales/footnotes.en.yml | 13 | ||||
| -rw-r--r-- | config/locales/footnotes.fr.yml (renamed from config/locales/footnotes.yml) | 14 |
5 files changed, 38 insertions, 25 deletions
diff --git a/app/assets/stylesheets/main/lines.css.scss b/app/assets/stylesheets/main/lines.css.scss index 6e2f14dc5..94201212a 100644 --- a/app/assets/stylesheets/main/lines.css.scss +++ b/app/assets/stylesheets/main/lines.css.scss @@ -26,6 +26,14 @@ #line_color_old{ width: 100px; color: white; font-weight: bold;} + + .nested-fields.footnote, .add_footnote{ + @extend .col-md-offset-3; + } + + .footnotes_block{ + margin-bottom: 30px; + } } #workspace.lines.show diff --git a/app/views/footnotes/_footnote_fields.html.erb b/app/views/footnotes/_footnote_fields.html.erb index 120e5e750..652b6d6af 100644 --- a/app/views/footnotes/_footnote_fields.html.erb +++ b/app/views/footnotes/_footnote_fields.html.erb @@ -1,6 +1,6 @@ <%= f.inputs :class => 'nested-fields footnote' do %> - <%= f.input :code %> - <%= f.input :label %> - <%= link_to_remove_association t('actions.destroy'), f %> + <%= f.input :code, :wrapper_html => { :class => 'col-md-3' } %> + <%= f.input :label, :wrapper_html => { :class => 'col-md-7' } %> + <%= link_to_remove_association t('actions.destroy'), f, :class => 'col-md-2 remove' %> <% end %> diff --git a/app/views/lines/_form.erb b/app/views/lines/_form.erb index 1ef94e02f..489aeba97 100644 --- a/app/views/lines/_form.erb +++ b/app/views/lines/_form.erb @@ -15,20 +15,22 @@ <%= 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.line.objectid")} %> - <% end %> - - <%= form.inputs do %> <%= 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 } %> - <div id="footnotes"> - <%= form.semantic_fields_for :footnotes do |f| %> - <%= render "footnotes/footnote_fields", :f => f %> - <% end %> - </div> - <%= link_to_add_association t("footnotes.actions.add_footnote"), form, :footnotes , + <div class="footnotes_block"> + <h3><%= t("footnotes.index.title") %></h3> + <div id="footnotes"> + <%= form.semantic_fields_for :footnotes do |f| %> + <%= render "footnotes/footnote_fields", :f => f %> + <% end %> + </div> + <div class="add_footnote"> + <%= link_to_add_association t("footnotes.actions.add_footnote"), form, :footnotes , :partial => "footnotes/footnote_fields", :"data-association-insertion-method" => "append", - :"data-association-insertion-node" => "div#footnotes"%> + :"data-association-insertion-node" => "div#footnotes", :class => "add" %> + </div> + </div> <% end %> <%= form.actions do %> diff --git a/config/locales/footnotes.en.yml b/config/locales/footnotes.en.yml new file mode 100644 index 000000000..98be688c5 --- /dev/null +++ b/config/locales/footnotes.en.yml @@ -0,0 +1,13 @@ +en: + footnotes: + actions: + add_footnote: "add footnote" + index: + title: "Footnotes" + activerecord: + models: + footnote: "footnote" + attributes: + footnote: + code: "number" + label: "line text" diff --git a/config/locales/footnotes.yml b/config/locales/footnotes.fr.yml index 3b20867b2..f1a9b2cf5 100644 --- a/config/locales/footnotes.yml +++ b/config/locales/footnotes.fr.yml @@ -1,18 +1,9 @@ -en: - footnotes: - actions: - add_footnote: "add footnote" - activerecord: - models: - footnote: "footnote" - attributes: - footnote: - code: "number" - label: "line text" fr: footnotes: actions: add_footnote: "ajouter une note en bas de page" + index: + title: "Notes en bas de page" activerecord: models: footnote: "note en bas de page" @@ -20,4 +11,3 @@ fr: footnote: code: "numéro" label: "ligne de texte" - |
