aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorjpl2017-02-15 16:06:54 +0100
committerjpl2017-02-15 16:06:54 +0100
commit0baf5f7f29f4ba4451bc3a2d7a5f2e291220fe29 (patch)
treef4cbcf744e9bdaac8a80bc697858f5b9d187407d /app
parent147497cca3f52193061b4e95bd57d57fb054a675 (diff)
downloadchouette-core-0baf5f7f29f4ba4451bc3a2d7a5f2e291220fe29.tar.bz2
Refs #2482: upadting workbenches#show
Diffstat (limited to 'app')
-rw-r--r--app/controllers/workbenches_controller.rb2
-rw-r--r--app/views/workbenches/_filters.html.slim2
-rw-r--r--app/views/workbenches/show.html.slim13
3 files changed, 10 insertions, 7 deletions
diff --git a/app/controllers/workbenches_controller.rb b/app/controllers/workbenches_controller.rb
index ea55820d0..c261373e0 100644
--- a/app/controllers/workbenches_controller.rb
+++ b/app/controllers/workbenches_controller.rb
@@ -4,7 +4,7 @@ class WorkbenchesController < BreadcrumbController
def show
scope = Workbench.find(params[:id])
- if params[:q] and params[:q][:organisation_name_eq_any].include? current_organisation.name
+ if params[:q] and params[:q][:organisation_name_eq_any] and params[:q][:organisation_name_eq_any].include? current_organisation.name
scope = scope.referentials.ready
else
scope = scope.all_referentials
diff --git a/app/views/workbenches/_filters.html.slim b/app/views/workbenches/_filters.html.slim
index be57cd5d8..7e1c5dbf1 100644
--- a/app/views/workbenches/_filters.html.slim
+++ b/app/views/workbenches/_filters.html.slim
@@ -5,7 +5,7 @@
.form-group.togglable
= f.label 'Organisation(s)', required: false, class: 'control-label'
- = f.input :organisation_name_eq_any, collection: Organisation.all.pluck(:name), as: :check_boxes, label: false, label_method: lambda{|w| ("<span>#{w}</span>").html_safe}, required: false, wrapper_html: { class: 'checkbox_list' }
+ = f.input :organisation_name_eq_any, collection: Organisation.pluck(:name).sort, as: :check_boxes, label: false, label_method: lambda{|w| ("<span>#{w}</span>").html_safe}, required: false, wrapper_html: { class: 'checkbox_list' }
/ .form-group
/ = f.label @wbench_refs.human_attribute_name(:validity_period), required: false, class: 'control-label'
diff --git a/app/views/workbenches/show.html.slim b/app/views/workbenches/show.html.slim
index bddb8194d..50589075a 100644
--- a/app/views/workbenches/show.html.slim
+++ b/app/views/workbenches/show.html.slim
@@ -12,8 +12,8 @@
/ PageContent
.page_content
.container-fluid
- - if @wbench_refs.any?
- .row
+ - if params[:q].present? or @wbench_refs.any?
+ .row.mb-sm
.col-lg-5.col-md-6.col-sm-6.col-xs-8
= search_form_for @q, url: workbench_path(@workbench.id), builder: SimpleForm::FormBuilder do |f|
.input-group.search_bar
@@ -24,7 +24,8 @@
.col-lg-7.col-md-6.col-sm-6.col-xs-4.text-right
= new_pagination @wbench_refs
- .row.mt-sm
+ - if @wbench_refs.any?
+ .row
.col-lg-12
= render 'filters'
@@ -42,5 +43,7 @@
= new_pagination @wbench_refs, 'pull-right'
- - else
- = replacement_msg t('referentials.search_no_results')
+ - unless @wbench_refs.any?
+ .row
+ .col-lg-12
+ = replacement_msg t('referentials.search_no_results')