From 89dd167379ae6ff6420be959f31ed5b1755cbaca Mon Sep 17 00:00:00 2001 From: Luc Donnet Date: Mon, 30 Jun 2014 15:58:09 +0200 Subject: Add spec requests for vehicle journey import --- app/assets/javascripts/plugins/tooltip.js.coffee | 2 + .../javascripts/vehicle_journey_import.js.coffee | 0 .../vehicle_journey_imports_controller.rb | 27 ++-------- app/models/vehicle_journey_import.rb | 5 +- app/views/vehicle_journey_imports/new.html.erb | 13 +---- config/locales/vehicle_journey_imports.yml | 27 +++++++--- .../vehicle_journey_imports_controller_spec.rb | 7 +++ spec/requests/vehicle_journey_imports_spec.rb | 59 ++++++++++++++++++++++ 8 files changed, 94 insertions(+), 46 deletions(-) create mode 100644 app/assets/javascripts/plugins/tooltip.js.coffee create mode 100644 app/assets/javascripts/vehicle_journey_import.js.coffee create mode 100644 spec/controllers/vehicle_journey_imports_controller_spec.rb create mode 100644 spec/requests/vehicle_journey_imports_spec.rb diff --git a/app/assets/javascripts/plugins/tooltip.js.coffee b/app/assets/javascripts/plugins/tooltip.js.coffee new file mode 100644 index 000000000..ca521279e --- /dev/null +++ b/app/assets/javascripts/plugins/tooltip.js.coffee @@ -0,0 +1,2 @@ +jQuery -> + $('input').tooltip() \ No newline at end of file diff --git a/app/assets/javascripts/vehicle_journey_import.js.coffee b/app/assets/javascripts/vehicle_journey_import.js.coffee new file mode 100644 index 000000000..e69de29bb diff --git a/app/controllers/vehicle_journey_imports_controller.rb b/app/controllers/vehicle_journey_imports_controller.rb index e3a6dde77..d58b3c2b0 100644 --- a/app/controllers/vehicle_journey_imports_controller.rb +++ b/app/controllers/vehicle_journey_imports_controller.rb @@ -10,36 +10,15 @@ class VehicleJourneyImportsController < ChouetteController def new @vehicle_journey_import = VehicleJourneyImport.new(:route => route) - flash[:notice] = "A CSV or Excel file can be used to import records. The first row should be the column name. -

-The following columns are allowed : -

-

" new! end def create - @vehicle_journey_import = VehicleJourneyImport.new(params[:vehicle_journey_import].merge({:route => route})) + @vehicle_journey_import = VehicleJourneyImport.new( params[:vehicle_journey_import].present? ? params[:vehicle_journey_import].merge({:route => route}) : {:route => route} ) if @vehicle_journey_import.save - redirect_to referential_line_route_path( @referential, @line, @route ), notice: "Import successful" + redirect_to referential_line_route_path( @referential, @line, @route ), notice: I18n.t("vehicle_journey_imports.new.success") else + flash[:error] = I18n.t("stop_area_imports.errors.import_aborted") + "
" + @vehicle_journey_import.errors.full_messages.join("
") render :new end end diff --git a/app/models/vehicle_journey_import.rb b/app/models/vehicle_journey_import.rb index 8da54abc6..15569c3d4 100644 --- a/app/models/vehicle_journey_import.rb +++ b/app/models/vehicle_journey_import.rb @@ -11,7 +11,7 @@ class VehicleJourneyImport validates_presence_of :route def initialize(attributes = {}) - attributes.each { |name, value| send("#{name}=", value) } + attributes.each { |name, value| send("#{name}=", value) } if attributes end def persisted? @@ -34,7 +34,8 @@ class VehicleJourneyImport end end rescue Exception => exception - errors.add :base, I18n.t("vehicle_journey_imports.errors.exception", :message => exception.message) + Rails.logger.error(exception.message) + errors.add :base, I18n.t("vehicle_journey_imports.errors.exception") false end end diff --git a/app/views/vehicle_journey_imports/new.html.erb b/app/views/vehicle_journey_imports/new.html.erb index a8459848c..65bfd6b17 100644 --- a/app/views/vehicle_journey_imports/new.html.erb +++ b/app/views/vehicle_journey_imports/new.html.erb @@ -13,19 +13,8 @@ <%= semantic_form_for [@referential, @line, @route, @vehicle_journey_import] do |form| %> - <% if @vehicle_journey_import.errors.any? %> -
-

<%= pluralize(@vehicle_journey_import.errors.count, "error") %> prohibited this import from completing:

- -
- <% end %> -
<%= form.inputs do %> - <%= form.input :file, :as => :file %> + <%= form.input :file, :as => :file, :input_html => { :title => "#{t('.tooltip.file')}", :'data-placement' => "right", :'data-toggle' => "tooltip", :'data-trigger' =>"hover" } %> <% end %> <%= form.actions do %> <%= form.action :submit, :as => :button , :label => t( 'formtastic.import' ) %> diff --git a/config/locales/vehicle_journey_imports.yml b/config/locales/vehicle_journey_imports.yml index f3d3be918..476996f41 100644 --- a/config/locales/vehicle_journey_imports.yml +++ b/config/locales/vehicle_journey_imports.yml @@ -2,24 +2,35 @@ en: vehicle_journey_imports: new: title: "Import vehicle journey at stops" - export_vehicle_journeys: "Export existing vehicle journey at stops :" - form: - file: "File" + export_vehicle_journeys: "Export existing vehicle journey at stops" + succcess: "Import is a success" + tooltip: + file: "Select a CSV or Excel file" errors: + import_aborted: "Des erreurs ont empéchées le bon déroulement de l'import: " not_same_stop_points: "Error column 1 : Not same stop points than in route %{route}" invalid_vehicle_journey_at_stop: "Error column %{column} line %{line} : vehicle journey at stop invalid %{time}" invalid_vehicle_journey: "Error column %{column}, vehicle journey is invalid : %{message}" - exception: "An exception occured : %{message}" + exception: "Invalid file, you must provide valid csv, xls or xlsx file" + activemodel: + attributes: + vehicle_journey_import: + file: "File" fr: vehicle_journey_imports: new: title: "Import des horaires à l'arrêt" export_vehicle_journeys: "Exporter les horaires existants" - form: - file: "Fichier" + succcess: "L'import des données est un succès" + tooltip: + file: "Sélectionner un fichier CSV ou Excel" errors: + import_aborted: "Des erreurs ont empéchées le bon déroulement de l'import: " not_same_stop_points: "Erreur colonne 1 : Pas les mêmes points d'arrêt que sur l'itinéraire %{route}" invalid_vehicle_journey_at_stop: "Erreur colonne %{column} ligne %{line} : horaire à l'arrêt invalide %{time}" invalid_vehicle_journey: "Erreur colonne %{column}, la course est invalide : %{message}" - exception: "Une exception est survenu : %{message}" - \ No newline at end of file + exception: "Le fichier est invalide, vous devez fournir un fichier csv, xls ou xlsx valide" + activemodel: + attributes: + vehicle_journey_import: + file: "Fichier" \ No newline at end of file diff --git a/spec/controllers/vehicle_journey_imports_controller_spec.rb b/spec/controllers/vehicle_journey_imports_controller_spec.rb new file mode 100644 index 000000000..091826205 --- /dev/null +++ b/spec/controllers/vehicle_journey_imports_controller_spec.rb @@ -0,0 +1,7 @@ +require 'spec_helper' + +describe ImportTasksController do + login_user + + +end diff --git a/spec/requests/vehicle_journey_imports_spec.rb b/spec/requests/vehicle_journey_imports_spec.rb new file mode 100644 index 000000000..c7a772fd3 --- /dev/null +++ b/spec/requests/vehicle_journey_imports_spec.rb @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +require 'spec_helper' + +describe "VehicleJourneyImports" do + login_user + + let!(:route) { create :route } + + let(:valid_file_path) { + csv_file = update_csv_file_with_factory_data("vehicle_journey_imports_valid.csv") + File.path(csv_file) + } + + let(:invalid_file_path) { + csv_file = update_csv_file_with_factory_data("vehicle_journey_imports_with_vjas_invalid.csv") + File.path(csv_file) + } + + def update_csv_file_with_factory_data(filename) + csv_file = CSV.open("/tmp/#{filename}", "wb") do |csv| + counter = 0 + CSV.foreach( Rails.root.join("spec", "fixtures", "#{filename}").to_s ) do |row| + if counter == 0 + csv << row + else + csv << ( row[0] = route.stop_points[counter - 1].id; row) + end + counter += 1 + end + + end + + File.open("/tmp/#{filename}") + end + + describe "new" do + it "should create stop areas and return to stop areas index page" do + visit new_referential_line_route_vehicle_journey_import_path(referential, route.line, route) + attach_file('Fichier', valid_file_path) + click_button "Lancer l'import" + expect(page).to have_content(I18n.t("vehicle_journey_imports.new.success")) + expect(page).to have_content("Séquence d'arrêts #{route.name}") + end + + it "should return error messages when file is invalid" do + visit new_referential_line_route_vehicle_journey_import_path(referential, route.line, route) + attach_file('Fichier', invalid_file_path) + click_button "Lancer l'import" + expect(page).to have_content(I18n.t("vehicle_journey_imports.errors.import_aborted")) + end + + it "should return error message when file missing on upload" do + visit new_referential_line_route_vehicle_journey_import_path(referential, route.line, route) + click_button "Lancer l'import" + expect(page).to have_content(I18n.t("vehicle_journey_imports.errors.import_aborted")) + end + end + +end -- cgit v1.2.3 From bf05e79d81b5fa9f53154317ba7049661ab732fb Mon Sep 17 00:00:00 2001 From: Luc Donnet Date: Mon, 30 Jun 2014 16:00:14 +0200 Subject: Add stop areas import Refs #0026832 --- app/assets/javascripts/stop_area_imports.js.coffee | 0 app/controllers/stop_area_imports_controller.rb | 24 +++++++++++++++ app/models/stop_area_import.rb | 9 +++--- app/views/routes/show.html.erb | 6 ++-- app/views/stop_area_imports/new.html.erb | 24 +++++++++++++++ app/views/stop_areas/index.html.erb | 3 ++ config/locales/stop_area_import.yml | 18 ------------ config/locales/stop_area_imports.yml | 33 +++++++++++++++++++++ config/routes.rb | 1 + spec/fixtures/stop_area_import_invalid.csv | 14 ++++----- spec/fixtures/stop_area_import_valid.csv | 14 ++++----- spec/models/stop_area_import_spec.rb | 2 +- spec/requests/stop_area_imports_spec.rb | 34 ++++++++++++++++++++++ 13 files changed, 142 insertions(+), 40 deletions(-) create mode 100644 app/assets/javascripts/stop_area_imports.js.coffee create mode 100644 app/controllers/stop_area_imports_controller.rb create mode 100644 app/views/stop_area_imports/new.html.erb delete mode 100644 config/locales/stop_area_import.yml create mode 100644 config/locales/stop_area_imports.yml create mode 100644 spec/requests/stop_area_imports_spec.rb diff --git a/app/assets/javascripts/stop_area_imports.js.coffee b/app/assets/javascripts/stop_area_imports.js.coffee new file mode 100644 index 000000000..e69de29bb diff --git a/app/controllers/stop_area_imports_controller.rb b/app/controllers/stop_area_imports_controller.rb new file mode 100644 index 000000000..ff93dc40e --- /dev/null +++ b/app/controllers/stop_area_imports_controller.rb @@ -0,0 +1,24 @@ +class StopAreaImportsController < ChouetteController + belongs_to :referential + + actions :new, :create + respond_to :html, :only => :new + + def new + @stop_area_import = StopAreaImport.new + new! + end + + def create + @stop_area_import = StopAreaImport.new(params[:stop_area_import]) + if @stop_area_import.save + redirect_to referential_stop_areas_path( @referential ), notice: I18n.t("stop_area_imports.new.success") + else + flash[:error] = I18n.t("stop_area_imports.errors.import_aborted") + "
" + @stop_area_import.errors.full_messages.join("
") + render :new + end + end + + protected + +end diff --git a/app/models/stop_area_import.rb b/app/models/stop_area_import.rb index 09fd92ddb..52d8a94bb 100644 --- a/app/models/stop_area_import.rb +++ b/app/models/stop_area_import.rb @@ -10,7 +10,7 @@ class StopAreaImport validates_presence_of :file def initialize(attributes = {}) - attributes.each { |name, value| send("#{name}=", value) } + attributes.each { |name, value| send("#{name}=", value) } if attributes end def persisted? @@ -26,14 +26,15 @@ class StopAreaImport else imported_stop_areas.each_with_index do |imported_stop_area, index| imported_stop_area.errors.full_messages.each do |message| - errors.add :base, I18n.t("stop_area_import.errors.invalid_stop_area", :column => index+2, :message => message) + errors.add :base, I18n.t("stop_area_imports.errors.invalid_stop_area", :column => index+2, :message => message) end end false end end rescue Exception => exception - errors.add :base, I18n.t("stop_area_import.errors.exception", :message => exception.message) + Rails.logger.error(exception.message) + errors.add :base, I18n.t("stop_area_imports.errors.exception") false end end @@ -58,7 +59,7 @@ class StopAreaImport when '.csv' then Roo::CSV.new(file.path) when '.xls' then Roo::Excel.new(file.path) when '.xlsx' then Roo::Excelx.new(file.path) - else + else raise "Unknown file type: #{file.original_filename}" end end diff --git a/app/views/routes/show.html.erb b/app/views/routes/show.html.erb index c36ce0e94..63f52974c 100644 --- a/app/views/routes/show.html.erb +++ b/app/views/routes/show.html.erb @@ -101,9 +101,9 @@ <%= link_to t('journey_patterns.actions.new'), new_referential_line_route_journey_pattern_path(@referential, @line, @route), :class => "add" %> <% end %> - - - +
  • + <%= link_to t('vehicle_journey_imports.new.title'), new_referential_line_route_vehicle_journey_import_path( @referential, @line, @route ), :class => "import" %> +
  • <% if @route.journey_patterns.size > 0 %>
  • <%= link_to t('vehicle_journeys.actions.index'), [@referential, @line, @route, :vehicle_journeys], :class => "vehicle_journeys" %> diff --git a/app/views/stop_area_imports/new.html.erb b/app/views/stop_area_imports/new.html.erb new file mode 100644 index 000000000..67b02892d --- /dev/null +++ b/app/views/stop_area_imports/new.html.erb @@ -0,0 +1,24 @@ +<%= title_tag t('stop_area_imports.new.title') %> + +
    +
    + + +
    +
    + +<%= semantic_form_for [@referential, @stop_area_import] do |form| %> +
    + <%= form.inputs do %> + <%= form.input :file, :as => :file, :input_html => { :title => "#{t('.tooltip.file')}", :'data-placement' => "right", :'data-toggle' => "tooltip", :'data-trigger' =>"hover" } %> + <% end %> + <%= form.actions do %> + <%= form.action :submit, :as => :button , :label => t( 'formtastic.import' ) %> + <%= form.action :cancel, :as => :link %> + <% end %> +<% end %> diff --git a/app/views/stop_areas/index.html.erb b/app/views/stop_areas/index.html.erb index 5519ea55e..1ff6f73d4 100644 --- a/app/views/stop_areas/index.html.erb +++ b/app/views/stop_areas/index.html.erb @@ -26,6 +26,9 @@

    <%= t(".selection") %>

    diff --git a/config/locales/stop_area_import.yml b/config/locales/stop_area_import.yml deleted file mode 100644 index cb557b540..000000000 --- a/config/locales/stop_area_import.yml +++ /dev/null @@ -1,18 +0,0 @@ -en: - stop_area_import: - new: - title: "Import stop areas" - form: - file: "File" - errors: - invalid_stop_area: "Error column %{column}, stop_area is invalid : %{message}" - exception: "An exception occured : %{message}" -fr: - stop_area_import: - new: - title: "Import des arrêts" - form: - file: "Fichier" - errors: - invalid_stop_area: "Erreur colonne %{column}, l'arrêt est invalide : %{message}" - exception: "Une exception est survenu : %{message}" \ No newline at end of file diff --git a/config/locales/stop_area_imports.yml b/config/locales/stop_area_imports.yml new file mode 100644 index 000000000..124157cba --- /dev/null +++ b/config/locales/stop_area_imports.yml @@ -0,0 +1,33 @@ +en: + stop_area_imports: + new: + title: "Import stop areas" + export_stop_areas: "Export a model" + succcess: "Import is a success" + tooltip: + file: "Select a CSV or Excel file" + errors: + import_aborted: "Errors prohibited this import from completing: " + invalid_stop_area: "Error column %{column}, stop_area is invalid : %{message}" + exception: "Invalid file, you must provide valid csv, xls or xlsx file" + activemodel: + attributes: + stop_area_import: + file: "File" +fr: + stop_area_imports: + new: + title: "Import des arrêts" + export_stop_areas: "Exporter un modèle" + succcess: "L'import des données est un succès" + tooltip: + file: "Sélectionner un fichier CSV ou Excel" + errors: + import_aborted: "Des erreurs ont empéchées le bon déroulement de l'import: " + invalid_stop_area: "Erreur colonne %{column}, l'arrêt est invalide : %{message}" + exception: "Le fichier est invalide, vous devez fournir un fichier csv, xls ou xlsx valide" + activemodel: + attributes: + stop_area_import: + file: "Fichier" + \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 12a83eea1..fe4db9a12 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -37,6 +37,7 @@ ChouetteIhm::Application.routes.draw do end resources :referentials do + resources :stop_area_imports resources :api_keys resources :rule_parameter_sets resources :stop_point_areas diff --git a/spec/fixtures/stop_area_import_invalid.csv b/spec/fixtures/stop_area_import_invalid.csv index 522bf029c..7fc4caefc 100644 --- a/spec/fixtures/stop_area_import_invalid.csv +++ b/spec/fixtures/stop_area_import_invalid.csv @@ -1,7 +1,7 @@ -"id","name","registration_number","longitude","latitude","area_type","comment","country_code","street_name","mobility_restricted_suitability","stairs_availability","lift_availability","int_user_needs" -,"StopArea1",,"0.1","0.1",,"Comment",,,,,, -,"StopArea2",,"0.2","0.2",,"Comment",,,,,, -,"StopArea3",,"0.3","0.3",,"Comment",,,,,, -,"StopArea4",,"0.4","0.4",,"Comment",,,,,, -,"StopArea5",,"0.5","0.5",,"Comment",,,,,, -,"StopArea6",,"0.6","0.6",,"Comment",,,,,, +"id","name","longitude","latitude","area_type","comment","country_code","street_name","mobility_restricted_suitability","stairs_availability","lift_availability","int_user_needs" +,"StopArea1","0.1","0.1",,"Comment",,,,,, +,"StopArea2","0.2","0.2",,"Comment",,,,,, +,"StopArea3","0.3","0.3",,"Comment",,,,,, +,"StopArea4","0.4","0.4",,"Comment",,,,,, +,"StopArea5","0.5","0.5",,"Comment",,,,,, +,"StopArea6","0.6","0.6",,"Comment",,,,,, diff --git a/spec/fixtures/stop_area_import_valid.csv b/spec/fixtures/stop_area_import_valid.csv index 0dc54f215..a929378f9 100644 --- a/spec/fixtures/stop_area_import_valid.csv +++ b/spec/fixtures/stop_area_import_valid.csv @@ -1,7 +1,7 @@ -"id","name","registration_number","longitude","latitude","area_type","comment","country_code","street_name","mobility_restricted_suitability","stairs_availability","lift_availability","int_user_needs" -,"StopArea1","1","0.1","0.1","Quay","Comment",,,,,, -,"StopArea2","2","0.2","0.2","Quay","Comment",,,,,, -,"StopArea3","3","0.3","0.3","Quay","Comment",,,,,, -,"StopArea4","4","0.4","0.4","Quay","Comment",,,,,, -,"StopArea5","5","0.5","0.5","Quay","Comment",,,,,, -,"StopArea6","6","0.6","0.6","Quay","Comment",,,,,, +"id","name","longitude","latitude","area_type","comment","country_code","street_name","mobility_restricted_suitability","stairs_availability","lift_availability","int_user_needs" +,"StopArea1","0.1","0.1","Quay","Comment",,,,,, +,"StopArea2","0.2","0.2","Quay","Comment",,,,,, +,"StopArea3","0.3","0.3","Quay","Comment",,,,,, +,"StopArea4","0.4","0.4","Quay","Comment",,,,,, +,"StopArea5","0.5","0.5","Quay","Comment",,,,,, +,"StopArea6","0.6","0.6","Quay","Comment",,,,,, diff --git a/spec/models/stop_area_import_spec.rb b/spec/models/stop_area_import_spec.rb index 1792ba8a3..07f3a111b 100644 --- a/spec/models/stop_area_import_spec.rb +++ b/spec/models/stop_area_import_spec.rb @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- require 'spec_helper' -describe VehicleJourneyImport do +describe StopAreaImport do let(:valid_file) { csv_file = File.open(Rails.root.join("spec", "fixtures", "stop_area_import_valid.csv").to_s, "r") diff --git a/spec/requests/stop_area_imports_spec.rb b/spec/requests/stop_area_imports_spec.rb new file mode 100644 index 000000000..c0da1edac --- /dev/null +++ b/spec/requests/stop_area_imports_spec.rb @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +require 'spec_helper' + +describe "StopAreaImports" do + login_user + + let!(:line) { create :line } + let!(:valid_file_path) { Rails.root + "spec/fixtures/stop_area_import_valid.csv" } + let!(:invalid_file_path) { Rails.root + "spec/fixtures/stop_area_import_invalid.csv" } + + describe "new" do + it "should create stop areas and return to stop areas index page" do + visit new_referential_stop_area_import_path(referential) + attach_file('Fichier', valid_file_path) + click_button "Lancer l'import" + expect(page).to have_content(I18n.t("stop_area_imports.new.success")) + expect(page).to have_content("StopArea1") + end + + it "should return error messages when file is invalid" do + visit new_referential_stop_area_import_path(referential) + attach_file('Fichier', invalid_file_path) + click_button "Lancer l'import" + expect(page).to have_content(I18n.t("stop_area_imports.errors.import_aborted")) + end + + it "should return error message when file missing on upload" do + visit new_referential_stop_area_import_path(referential) + click_button "Lancer l'import" + expect(page).to have_content(I18n.t("stop_area_imports.errors.import_aborted")) + end + end + +end -- cgit v1.2.3 From 05c0f38181e2962eaaaec3591b1dc8b140826536 Mon Sep 17 00:00:00 2001 From: Luc Donnet Date: Mon, 30 Jun 2014 16:01:54 +0200 Subject: Extract header from layout Refs #0026847 --- app/views/layouts/application.html.erb | 91 +----------------------------- app/views/layouts/without_sidebar.html.erb | 91 +----------------------------- app/views/shared/_footer.erb | 2 +- app/views/shared/_header.erb | 90 +++++++++++++++++++++++++++++ 4 files changed, 93 insertions(+), 181 deletions(-) create mode 100644 app/views/shared/_header.erb diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 2e4f98c0b..5ff860a54 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -18,96 +18,7 @@
    diff --git a/app/views/layouts/without_sidebar.html.erb b/app/views/layouts/without_sidebar.html.erb index 948070695..d07139c2f 100644 --- a/app/views/layouts/without_sidebar.html.erb +++ b/app/views/layouts/without_sidebar.html.erb @@ -18,96 +18,7 @@
    diff --git a/app/views/shared/_footer.erb b/app/views/shared/_footer.erb index 059a96d4c..3ad00df77 100644 --- a/app/views/shared/_footer.erb +++ b/app/views/shared/_footer.erb @@ -8,7 +8,7 @@
  • <%= t("layouts.footer.product.title") %>

  • <%= link_to t("layouts.footer.product.licence"), "http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.html" %>
  • <%= link_to t("layouts.footer.product.source_code"), "https://github.com/afimb/chouette2" %>
  • -
  • <%= link_to t("layouts.footer.product.user_group") %>
  • +
  • <%= link_to t("layouts.footer.product.user_group"), "http://www.chouette.mobi/les-utilisateurs/club-utilisateur-des-outils-chouette-et-irys/" %>
  • diff --git a/app/views/shared/_header.erb b/app/views/shared/_header.erb new file mode 100644 index 000000000..98da232ac --- /dev/null +++ b/app/views/shared/_header.erb @@ -0,0 +1,90 @@ + -- cgit v1.2.3 From 10b73256b26cbfb04dcb605529ef78505649d70e Mon Sep 17 00:00:00 2001 From: Luc Donnet Date: Mon, 30 Jun 2014 16:02:34 +0200 Subject: Fix css for referentials index Refs #0026847 --- app/assets/stylesheets/main/referentials.css.scss | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/app/assets/stylesheets/main/referentials.css.scss b/app/assets/stylesheets/main/referentials.css.scss index 715b152e8..f5c2fa030 100644 --- a/app/assets/stylesheets/main/referentials.css.scss +++ b/app/assets/stylesheets/main/referentials.css.scss @@ -7,17 +7,7 @@ .referentials { margin-top: 20px; - } - - .referential { - - /* to create multi-column index */ - width: 350px; - float: left; - padding-right: 10px; - position: relative; - - } + } } #workspace.referentials.show { @@ -64,12 +54,3 @@ } } } - -ul.logos { - margin: 30px 30px 0 0; - - li { - display: inline; - margin: 0 3px; - } -} -- cgit v1.2.3 From 404e29a4123f8fe5e8a0abf6b307124616b584d3 Mon Sep 17 00:00:00 2001 From: Luc Donnet Date: Mon, 30 Jun 2014 16:09:18 +0200 Subject: Fix referentials names and links on header Refs #0026847 --- app/views/shared/_header.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shared/_header.erb b/app/views/shared/_header.erb index 98da232ac..64c43acac 100644 --- a/app/views/shared/_header.erb +++ b/app/views/shared/_header.erb @@ -26,7 +26,7 @@ <% current_organisation.referentials.each do |referential| %>
  • - <%= link_to @referential.name, referential_path(@referential) %> + <%= link_to referential.name, referential_path(referential) %>
  • <% end %> -- cgit v1.2.3 From 21049ba3379dc8b6ebc2c2b06d788ebad3f9fb1d Mon Sep 17 00:00:00 2001 From: Luc Donnet Date: Mon, 30 Jun 2014 16:17:17 +0200 Subject: Add more info when select datas from header Refs #0026847 --- app/views/shared/_header.erb | 3 +++ config/locales/layouts.yml | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/views/shared/_header.erb b/app/views/shared/_header.erb index 64c43acac..a1d05ca38 100644 --- a/app/views/shared/_header.erb +++ b/app/views/shared/_header.erb @@ -34,6 +34,9 @@