diff options
| author | Luc Donnet | 2015-06-09 10:09:00 +0200 |
|---|---|---|
| committer | Luc Donnet | 2015-06-09 10:09:00 +0200 |
| commit | 8bf59df0653ed0cc0ac6ac76ccfb7d99628ebf85 (patch) | |
| tree | 6a33238e8d207beddd7a90bdbb6aea7ef3870349 | |
| parent | 21c62df7d03e85ae1362e1befeabb4cfb0cb29c4 (diff) | |
| download | chouette-core-8bf59df0653ed0cc0ac6ac76ccfb7d99628ebf85.tar.bz2 | |
Add export format text in index and show pages Refs #36451
| -rw-r--r-- | app/assets/stylesheets/main/exports.css.scss | 13 | ||||
| -rw-r--r-- | app/assets/stylesheets/main/imports.css.scss | 2 | ||||
| -rw-r--r-- | app/helpers/exports_helper.rb | 10 | ||||
| -rw-r--r-- | app/views/exports/_export.erb | 3 | ||||
| -rw-r--r-- | app/views/exports/show.html.erb | 9 |
5 files changed, 32 insertions, 5 deletions
diff --git a/app/assets/stylesheets/main/exports.css.scss b/app/assets/stylesheets/main/exports.css.scss index 9fb11765e..d2ee1cb86 100644 --- a/app/assets/stylesheets/main/exports.css.scss +++ b/app/assets/stylesheets/main/exports.css.scss @@ -4,6 +4,13 @@ #workspace.exports.index { + .panel.export { + .panel-footer { + .history { + margin-top: 5px; + } + } + } } #workspace.exports.show { @@ -11,5 +18,9 @@ @import "../modules/job_status_colors"; @import "../modules/job_status_title"; @import "../modules/links"; - + + .export-attributes { + font-size: 1.7em; + margin-top: 20px; + } } diff --git a/app/assets/stylesheets/main/imports.css.scss b/app/assets/stylesheets/main/imports.css.scss index bd11332f6..32a20d1c4 100644 --- a/app/assets/stylesheets/main/imports.css.scss +++ b/app/assets/stylesheets/main/imports.css.scss @@ -14,7 +14,7 @@ } .history { - margin-top: 10px; + margin-top: 5px; } } } diff --git a/app/helpers/exports_helper.rb b/app/helpers/exports_helper.rb index 21fec001f..8ac494cfc 100644 --- a/app/helpers/exports_helper.rb +++ b/app/helpers/exports_helper.rb @@ -12,6 +12,16 @@ module ExportsHelper def export_partial_name(form) "fields_#{form.object.format.underscore}_export" end + + def export_attributes_tag(export) + content_tag :div, class: "export-attributes" do + [].tap do |parts| + if export.format.present? + parts << bh_label(t("enumerize.data_format.#{export.format}")) + end + end.join.html_safe + end + end def compliance_icon( export_task) return nil unless export_task.compliance_check_task diff --git a/app/views/exports/_export.erb b/app/views/exports/_export.erb index 7d8e24e39..005ac011a 100644 --- a/app/views/exports/_export.erb +++ b/app/views/exports/_export.erb @@ -1,4 +1,4 @@ -<div id="index_item" class="panel panel-default"> +<div id="index_item" class="panel panel-default export"> <div class="panel-heading"> <div class="panel-title clearfix"> <span class="pull-right"> @@ -17,6 +17,7 @@ <p><%= link_to( font_awesome_classic_tag("fa-file-#{export.filename_extension}-o") + t("exports.show.exported_file"), exported_file_referential_export_path(@referential, export.id) ) if export.file_path %></p> </div> <div class="panel-footer"> + <%= export_attributes_tag(export) %> <div class="history"> <%= l export.created_at, :format => "%d/%m/%Y %H:%M" %> | <%= export.user_name %> </div> diff --git a/app/views/exports/show.html.erb b/app/views/exports/show.html.erb index 768765c53..43b9773ae 100644 --- a/app/views/exports/show.html.erb +++ b/app/views/exports/show.html.erb @@ -1,5 +1,10 @@ -<div class="test"> - <%= title_tag job_status_title(@export) %> +<div class="title row"> + <div class="col-md-8"> + <%= title_tag job_status_title(@export) %> + </div> + <div class="col-md-4"> + <%= export_attributes_tag(@export) %> + </div> </div> <% if @export.report.failure_code? %> <div class="alert alert-danger"> |
