aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/calendars/_form_advanced.html.slim2
-rw-r--r--app/views/compliance_check_sets/index.html.slim7
-rw-r--r--app/views/dashboards/_dashboard.html.slim6
-rw-r--r--app/views/lines/show.html.slim10
-rw-r--r--app/views/referential_lines/show.html.slim2
-rw-r--r--app/views/referentials/_form.html.slim14
-rw-r--r--app/views/referentials/_overview.html.slim9
-rw-r--r--app/views/stif/dashboards/_dashboard.html.slim2
-rw-r--r--app/views/stop_areas/show.html.slim2
-rw-r--r--app/views/workbenches/_form.html.slim9
-rw-r--r--app/views/workbenches/edit.html.slim8
-rw-r--r--app/views/workbenches/show.html.slim2
12 files changed, 55 insertions, 18 deletions
diff --git a/app/views/calendars/_form_advanced.html.slim b/app/views/calendars/_form_advanced.html.slim
index e796e2e36..aa4fd4e40 100644
--- a/app/views/calendars/_form_advanced.html.slim
+++ b/app/views/calendars/_form_advanced.html.slim
@@ -3,6 +3,6 @@
= javascript_tag do
| window.actionType = "#{raw params[:action]}";
// | window.I18n = #{(I18n.backend.send(:translations)[I18n.locale].to_json).html_safe};
- | window.timetablesUrl = "#{calendar_url(@calendar).html_safe}";
+ | window.timetablesUrl = "#{workgroup_calendar_url(@workgroup, @calendar).html_safe}";
= javascript_pack_tag 'calendars/edit.js'
diff --git a/app/views/compliance_check_sets/index.html.slim b/app/views/compliance_check_sets/index.html.slim
index 31ad31e5b..9abd95dd1 100644
--- a/app/views/compliance_check_sets/index.html.slim
+++ b/app/views/compliance_check_sets/index.html.slim
@@ -23,9 +23,10 @@
), \
TableBuilderHelper::Column.new( \
key: :associated_object, \
- attribute: Proc.new{|n| n.referential.present? ? n.referential.name : ''}, \
+ if: ->(compliance_check_set){ compliance_check_set.referential.present? }, \
+ attribute: Proc.new{|n| n.referential.name}, \
link_to: lambda do |compliance_check_set| \
- compliance_check_set.referential.present? ? referential_path(compliance_check_set.referential_id) : '#' \
+ referential_path(compliance_check_set.referential_id) \
end \
), \
TableBuilderHelper::Column.new( \
@@ -42,6 +43,8 @@
],
sortable: true,
cls: 'table has-filter has-search'
+
+ = new_pagination @compliance_check_sets, 'pull-right'
- unless @compliance_check_sets.any?
.row.mt-xs
.col-lg-12
diff --git a/app/views/dashboards/_dashboard.html.slim b/app/views/dashboards/_dashboard.html.slim
index 7f78934a6..f93b85cad 100644
--- a/app/views/dashboards/_dashboard.html.slim
+++ b/app/views/dashboards/_dashboard.html.slim
@@ -22,12 +22,12 @@
.panel.panel-default
.panel-heading
h3.panel-title.with_actions
- = link_to I18n.t("activerecord.models.calendar", count: @dashboard.current_organisation.calendars.size), workgroup_calendars_path(workbench.workgroup)
+ = link_to I18n.t("activerecord.models.calendar", count: workbench.calendars.size), workgroup_calendars_path(workbench.workgroup)
div
= link_to '', workgroup_calendars_path(workbench.workgroup), class: ' fa fa-chevron-right pull-right'
- - if @dashboard.current_organisation.calendars.present?
+ - if workbench.calendars.present?
.list-group
- - @dashboard.current_organisation.calendars.order("updated_at desc").limit(5).each do |calendar|
+ - workbench.calendars.order("updated_at desc").limit(5).each do |calendar|
= link_to calendar.name, workgroup_calendars_path(workbench.workgroup, calendar), class: 'list-group-item'
- else
.panel-body
diff --git a/app/views/lines/show.html.slim b/app/views/lines/show.html.slim
index 34b907bdd..96bb5bb0d 100644
--- a/app/views/lines/show.html.slim
+++ b/app/views/lines/show.html.slim
@@ -6,13 +6,13 @@
.row
.col-lg-6.col-md-6.col-sm-12.col-xs-12
= definition_list t('metadatas'),
- { 'ID Codif' => @line.get_objectid.short_id,
- 'Activé' => (@line.deactivated? ? t('false') : t('true')),
+ { t('id_codif') => @line.get_objectid.short_id,
+ @line.human_attribute_name(:deactivated) => (@line.deactivated? ? t('false') : t('true')),
@line.human_attribute_name(:network_id) => (@line.network.nil? ? t('lines.index.unset') : @line.network.name),
@line.human_attribute_name(:company_id) => (@line.company.nil? ? t('lines.index.unset') : @line.company.name),
- 'Transporteur(s) secondaire(s)' => (@line.secondary_companies.nil? ? t('lines.index.unset') : array_to_html_list(@line.secondary_companies.collect(&:name))),
- 'Nom court' => @line.number,
- 'Code public' => (@line.registration_number ? @line.registration_number : '-'),
+ @line.human_attribute_name(:secondary_companies) => (@line.secondary_companies.nil? ? t('lines.index.unset') : array_to_html_list(@line.secondary_companies.collect(&:name))),
+ @line.human_attribute_name(:number) => @line.number,
+ @line.human_attribute_name(:registration_number) => (@line.registration_number ? @line.registration_number : '-'),
@line.human_attribute_name(:transport_mode) => (@line.transport_mode.present? ? t("enumerize.transport_mode.#{@line.transport_mode}") : '-'),
@line.human_attribute_name(:transport_submode) => (@line.transport_submode.present? ? t("enumerize.transport_submode.#{@line.transport_submode}") : '-'),
@line.human_attribute_name(:url) => (@line.url ? @line.url : '-'),
diff --git a/app/views/referential_lines/show.html.slim b/app/views/referential_lines/show.html.slim
index 5ea0e31bb..ef32ef6b0 100644
--- a/app/views/referential_lines/show.html.slim
+++ b/app/views/referential_lines/show.html.slim
@@ -82,6 +82,6 @@
= replacement_msg t('routes.search_no_results')
= javascript_tag do
- | window.routes = "#{URI.escape(@routes.map{|r| {name: r.name, id: r.id, stops: route_json_for_edit(r, serialize: false)}}.to_json)}"
+ | window.routes = "#{URI.escape(@routes.select{|r| r.wayback == :outbound}.map{|r| {name: r.name, id: r.id, stops: route_json_for_edit(r, serialize: false)}}.to_json)}"
= javascript_pack_tag 'referential_lines/show.js'
diff --git a/app/views/referentials/_form.html.slim b/app/views/referentials/_form.html.slim
index 1e59ab566..96d847ec1 100644
--- a/app/views/referentials/_form.html.slim
+++ b/app/views/referentials/_form.html.slim
@@ -47,8 +47,13 @@
= link_to_add_association t('simple_form.labels.referential.actions.add_period'), subform, :periods, class: 'btn btn-outline-primary'
.separator
+ .row
+ .col-lg-11
+ = subform.input :lines, as: :select, collection: Chouette::Line.includes(:company).order(:name).where(objectid: current_functional_scope), selected: subform.object.line_ids, label_method: :display_name, input_html: { 'data-select2ed': 'true', 'data-select2ed-placeholder': t('simple_form.labels.referential.placeholders.select_lines'), 'multiple': 'multiple', style: 'width: 100%' }
+ .col-lg-1
+ a.clear-lines.btn.btn-default href='#'
+ .fa.fa-trash
- = subform.input :lines, as: :select, collection: Chouette::Line.includes(:company).order(:name).where(objectid: current_functional_scope), selected: subform.object.line_ids, label_method: :display_name, input_html: { 'data-select2ed': 'true', 'data-select2ed-placeholder': t('simple_form.labels.referential.placeholders.select_lines'), 'multiple': 'multiple', style: 'width: 100%' }
.hidden = form.input :workbench_id, as: :hidden
@@ -58,3 +63,10 @@
class: 'btn btn-default formSubmitr',
data: { disable_with: t('actions.processing') },
form: 'referential_form'
+
+ - content_for :javascript do
+ coffee:
+ $(".clear-lines").click (e)->
+ e.preventDefault()
+ $(e.currentTarget).parents('.row').first().find('[name*=line]').val('').trigger('change')
+ false
diff --git a/app/views/referentials/_overview.html.slim b/app/views/referentials/_overview.html.slim
index 870f642d4..6bed5f282 100644
--- a/app/views/referentials/_overview.html.slim
+++ b/app/views/referentials/_overview.html.slim
@@ -35,9 +35,12 @@
.lines= I18n.t("referentials.overview.head.lines")
.lines
- overview.lines.each do |line|
- .line
- a.number style="background-color: #{line.color.present? ? "##{line.color}" : 'whitesmoke'}" title=line.name
- = line.number
+ a.line title=line.name
+ - if line.number.present?
+ .number style="background-color: #{line.color.present? ? "##{line.color}" : 'whitesmoke'}"
+ = line.number
+ - else
+ .name= line.name
.company= line.company&.name
.mode= line.transport_mode.present? ? t("enumerize.transport_mode.#{line.transport_mode}") : ""
.right
diff --git a/app/views/stif/dashboards/_dashboard.html.slim b/app/views/stif/dashboards/_dashboard.html.slim
index 83a2106bb..e0f754fd4 100644
--- a/app/views/stif/dashboards/_dashboard.html.slim
+++ b/app/views/stif/dashboards/_dashboard.html.slim
@@ -57,7 +57,7 @@
.panel-heading
h3.panel-title.with_actions
= I18n.t("calendars.index.title")
- span.badge.ml-xs = @dashboard.calendars.count if @dashboard.calendars.present?
+ span.badge.ml-xs = @dashboard.workbench.calendars.count if @dashboard.calendars.present?
div
= link_to '', workgroup_calendars_path(@dashboard.workbench.workgroup), class: ' fa fa-chevron-right pull-right', title: t('.see')
diff --git a/app/views/stop_areas/show.html.slim b/app/views/stop_areas/show.html.slim
index a4e14a272..34b872e91 100644
--- a/app/views/stop_areas/show.html.slim
+++ b/app/views/stop_areas/show.html.slim
@@ -20,7 +20,7 @@
@stop_area.human_attribute_name(:zip_code) => @stop_area.zip_code,
@stop_area.human_attribute_name(:city_name) => @stop_area.city_name,
@stop_area.human_attribute_name(:country_code) => @stop_area.country_code.presence || '-',
- 'Etat' => (@stop_area.deleted_at ? 'Supprimé' : 'Actif'),
+ t('activerecord.attributes.stop_area.state') => (@stop_area.deleted_at ? t('stop_areas.show.state.deactivated') : t('stop_areas.show.state.active')),
@stop_area.human_attribute_name(:comment) => @stop_area.try(:comment),
})
= definition_list t('metadatas'), attributes
diff --git a/app/views/workbenches/_form.html.slim b/app/views/workbenches/_form.html.slim
new file mode 100644
index 000000000..534a5f378
--- /dev/null
+++ b/app/views/workbenches/_form.html.slim
@@ -0,0 +1,9 @@
+= simple_form_for @workbench, html: { class: 'form-horizontal', id: 'workbench_form' }, wrapper: :horizontal_form do |f|
+ .row
+ .col-lg-12
+ = f.input :import_compliance_control_set_id, as: :select, collection: current_organisation.compliance_control_sets, value_method: :id
+ = f.input :merge_compliance_control_set_id, as: :select, collection: current_organisation.compliance_control_sets, value_method: :id
+
+ .separator
+
+ = f.button :submit, t('actions.submit'), class: 'btn btn-default formSubmitr', form: 'workbench_form'
diff --git a/app/views/workbenches/edit.html.slim b/app/views/workbenches/edit.html.slim
new file mode 100644
index 000000000..893024490
--- /dev/null
+++ b/app/views/workbenches/edit.html.slim
@@ -0,0 +1,8 @@
+- breadcrumb @workbench
+- page_header_content_for @workbench
+
+.page_content
+ .container-fluid
+ .row
+ .col-lg-8.col-lg-offset-2.col-md-8.col-md-offset-2.col-sm-10.col-sm-offset-1
+ == render 'form'
diff --git a/app/views/workbenches/show.html.slim b/app/views/workbenches/show.html.slim
index 159aa8ea2..5c2468296 100644
--- a/app/views/workbenches/show.html.slim
+++ b/app/views/workbenches/show.html.slim
@@ -3,6 +3,8 @@
- content_for :page_header_content do
.row.mb-sm
.col-lg-12.text-right
+ - if policy(Workbench).update?
+ = link_to t('workbenches.actions.configure'), edit_workbench_path(@workbench), class: 'btn btn-primary'
- if policy(Referential).create?
= link_to t('actions.import'), workbench_imports_path(@workbench), class: 'btn btn-primary'
= link_to t('actions.add'), new_workbench_referential_path(@workbench), class: 'btn btn-primary'