diff options
| author | jpl | 2017-02-10 13:59:44 +0100 |
|---|---|---|
| committer | jpl | 2017-02-10 13:59:44 +0100 |
| commit | ce0248b0a9773b70cdcb3ca681a74f0c353cec43 (patch) | |
| tree | e18979e5d767a6042d3e7131b95b2fa2cf9c2ab5 | |
| parent | cb5246b04c0777d10868c902f92bff7ec9176531 (diff) | |
| download | chouette-core-ce0248b0a9773b70cdcb3ca681a74f0c353cec43.tar.bz2 | |
Refs #2552: updating codifligne:sync page
| -rw-r--r-- | app/assets/stylesheets/base/_utilities.sass | 12 | ||||
| -rw-r--r-- | app/assets/stylesheets/typography/_typography.sass | 8 | ||||
| -rw-r--r-- | app/helpers/newapplication_helper.rb | 6 | ||||
| -rw-r--r-- | app/views/line_referentials/show.html.slim | 93 | ||||
| -rw-r--r-- | config/locales/actions.en.yml | 1 | ||||
| -rw-r--r-- | config/locales/actions.fr.yml | 1 | ||||
| -rw-r--r-- | config/locales/line_referential_syncs.en.yml | 3 | ||||
| -rw-r--r-- | config/locales/line_referential_syncs.fr.yml | 2 | ||||
| -rw-r--r-- | config/locales/line_referentials.en.yml | 2 | ||||
| -rw-r--r-- | config/locales/line_referentials.fr.yml | 2 |
10 files changed, 79 insertions, 51 deletions
diff --git a/app/assets/stylesheets/base/_utilities.sass b/app/assets/stylesheets/base/_utilities.sass index 4441b77db..bf7fba1d5 100644 --- a/app/assets/stylesheets/base/_utilities.sass +++ b/app/assets/stylesheets/base/_utilities.sass @@ -4,12 +4,18 @@ .mt-xs margin-top: 10px - .mt-sm margin-top: 15px - .mt-md margin-top: 20px - .mt-lg margin-top: 40px + +.mb-xs + margin-bottom: 10px +.mb-sm + margin-bottom: 15px +.mb-md + margin-bottom: 20px +.mb-lg + margin-bottom: 40px diff --git a/app/assets/stylesheets/typography/_typography.sass b/app/assets/stylesheets/typography/_typography.sass index ef6d05203..649a8cf6e 100644 --- a/app/assets/stylesheets/typography/_typography.sass +++ b/app/assets/stylesheets/typography/_typography.sass @@ -20,3 +20,11 @@ p color: $blue border-color: $blue transition: 0.2s + +// Text coloring +.text-danger + color: $red +.text-success + color: $green +.text-info + color: $blue diff --git a/app/helpers/newapplication_helper.rb b/app/helpers/newapplication_helper.rb index 413378d6a..18e0cb393 100644 --- a/app/helpers/newapplication_helper.rb +++ b/app/helpers/newapplication_helper.rb @@ -226,7 +226,11 @@ module NewapplicationHelper content_tag :div, '', class: 'page_header' do content_tag :div, '', class: 'container-fluid' do - firstRow + capture(&block) + if block_given? + firstRow + capture(&block) + else + firstRow + end end end end diff --git a/app/views/line_referentials/show.html.slim b/app/views/line_referentials/show.html.slim index 3e9cab269..749bc9af9 100644 --- a/app/views/line_referentials/show.html.slim +++ b/app/views/line_referentials/show.html.slim @@ -1,44 +1,49 @@ -/ FIXME #825 -= title_tag "Référentiel de lignes #{@line_referential.name}" - -.summary - -.panel.panel-default - ul.list-group width="75%" - li.list-group-item - span.badge = @line_referential.companies.size - = link_to Referential.human_attribute_name("companies"), line_referential_companies_path(@line_referential) - - li.list-group-item - span.badge = @line_referential.networks.size - = link_to Referential.human_attribute_name("networks"), line_referential_networks_path(@line_referential) - - / li.list-group-item - / span.badge = @line_referential.group_of_lines.size - / = link_to Referential.human_attribute_name("group_of_lines"), line_referential_group_of_lines_path(@line_referential) - - li.list-group-item - span.badge = @line_referential.lines.size - = link_to Referential.human_attribute_name("lines"), line_referential_lines_path(@line_referential) - -- unless @line_referential.line_referential_syncs.empty? - h3 Historique des synchronisations - - ul.list-group width="75%" - - @line_referential.line_referential_syncs.each_with_index do |sync, i| - / Display only 10 msgs - - if i < 10 - - unless sync.line_referential_sync_messages.empty? - - sync.line_referential_sync_messages.last.tap do |log| - - if log.criticity = log.criticity - li.alert class="alert-#{criticity_class(log.criticity)}" - strong = l(log.created_at, format: :short) + " : " - / [:processing_time] unit conversion - - data = log.message_attributs.symbolize_keys! - - data[:processing_time] = distance_of_time_in_words(data[:processing_time].to_i) - - = t("line_referential_sync.message.#{log.message_key}", log.message_attributs.symbolize_keys!) - -- content_for :sidebar do - ul.actions - li = link_to t('line_referentials.actions.sync'), sync_line_referential_path(@line_referential), class: 'sync', method: :post +/ PageHeader += pageheader 'map-marker', + t('.title'), + 'Lorem ipsum dolor sit amet', + t('last_update', time: l(@line_referential.updated_at, format: :short)), + link_to(t('actions.sync'), sync_line_referential_path(@line_referential), method: :post, class: 'btn btn-default') do + + / Below is secundary actions & opt. contents + .row.mb-md + .col-lg-12.text-right + = link_to line_referential_companies_path(@line_referential), class: 'btn btn-primary' do + = Referential.human_attribute_name(:companies) + em.small = " (#{@line_referential.companies.size})" + = link_to line_referential_networks_path(@line_referential), class: 'btn btn-primary' do + = Referential.human_attribute_name(:networks) + em.small = " (#{@line_referential.networks.size})" + = link_to line_referential_lines_path(@line_referential), class: 'btn btn-primary' do + = Referential.human_attribute_name(:lines) + em.small = " (#{@line_referential.lines.size})" + +/ PageContent +.page_content + .container-fluid + .row + .col-lg-12 + - unless @line_referential.line_referential_syncs.empty? + table.table + thead + tr + th Synchronisé + th Message + th Statut + + tbody + - @line_referential.line_referential_syncs.each_with_index do |sync, i| + / Display only 10 msgs + - if i < 10 + - unless sync.line_referential_sync_messages.empty? + - sync.line_referential_sync_messages.last.tap do |log| + - if log.criticity = log.criticity + tr + td + = l(log.created_at, format: :short) + td + - data = log.message_attributs.symbolize_keys! + - data[:processing_time] = distance_of_time_in_words(data[:processing_time].to_i) + = t("line_referential_sync.message.#{log.message_key}", log.message_attributs.symbolize_keys!).html_safe + td + .fa.fa-circle class="text-#{criticity_class(log.criticity)}" diff --git a/config/locales/actions.en.yml b/config/locales/actions.en.yml index c796c5936..e4b0bcb28 100644 --- a/config/locales/actions.en.yml +++ b/config/locales/actions.en.yml @@ -10,6 +10,7 @@ en: unarchive: "Unarchive" clone: 'Clone' clean_up: 'Clean up' + sync: 'Synchronize' or: "or" cancel: "Cancel" search_hint: "Type in a search term" diff --git a/config/locales/actions.fr.yml b/config/locales/actions.fr.yml index 7617a2d4c..1247a24f7 100644 --- a/config/locales/actions.fr.yml +++ b/config/locales/actions.fr.yml @@ -10,6 +10,7 @@ fr: unarchive: 'Déconserver' clone: 'Dupliquer' clean_up: 'Purger' + sync: 'Synchroniser' or: "ou" cancel: "Annuler" search_hint: "Entrez un texte à rechercher" diff --git a/config/locales/line_referential_syncs.en.yml b/config/locales/line_referential_syncs.en.yml index e78288299..5cbab1173 100644 --- a/config/locales/line_referential_syncs.en.yml +++ b/config/locales/line_referential_syncs.en.yml @@ -11,9 +11,8 @@ en: new: "New synchronisation added" pending: "Synchronisation en cours" successful: "Synchronization successful after %{processing_time} with %{imported} objects created, %{updated} objects updated. %{deleted} objects were deleted.." - failed: "Synchronization failed after %{processing_time} with error: %{error}." + failed: "Synchronization failed after %{processing_time} with error: <em>%{error}</em>." notice: line_referential_sync: created: 'Your synchronisation request has been created' - diff --git a/config/locales/line_referential_syncs.fr.yml b/config/locales/line_referential_syncs.fr.yml index 4a24fd937..33827fac9 100644 --- a/config/locales/line_referential_syncs.fr.yml +++ b/config/locales/line_referential_syncs.fr.yml @@ -11,7 +11,7 @@ fr: new: "Synchronisation en attente" pending: "Synchronisation en cours" successful: "Synchronisation réussie après %{processing_time}, avec %{imported} éléments importés, %{updated} éléments mise à jour. %{deleted} éléments ont été supprimés." - failed: "Synchronisation interrompue après %{processing_time}, avec l'erreur : %{error}." + failed: "Synchronisation interrompue après %{processing_time}, avec l'erreur : <em>%{error}</em>." notice: line_referential_sync: created: 'Votre demande de synchronisation a bien été créée' diff --git a/config/locales/line_referentials.en.yml b/config/locales/line_referentials.en.yml index 4c30d90e3..ad0782a38 100644 --- a/config/locales/line_referentials.en.yml +++ b/config/locales/line_referentials.en.yml @@ -6,6 +6,8 @@ en: cancel_sync: "Cancel codifligne synchronization" edit: title: "Edit %{line_referential} referential" + show: + title: "iLLICO synchronization" activerecord: models: line_referential: diff --git a/config/locales/line_referentials.fr.yml b/config/locales/line_referentials.fr.yml index 5a9e2caca..0a0caacc8 100644 --- a/config/locales/line_referentials.fr.yml +++ b/config/locales/line_referentials.fr.yml @@ -6,6 +6,8 @@ fr: cancel_sync: "Annuler la synchronisation Codifligne" edit: title: "Modifier le référentiel %{line_referential}" + show: + title: 'Synchronisation iLLICO' activerecord: models: line_referential: |
