diff options
| author | jpl | 2016-07-29 17:15:35 +0200 |
|---|---|---|
| committer | jpl | 2016-07-29 17:15:35 +0200 |
| commit | 49b1e548dce962bdc2666baba5dbf9df72ff7e91 (patch) | |
| tree | 741da1480f66331c4c1e93a747e756632246814e | |
| parent | d9d6ed17e6b23b29403a2909ccadd46975e75500 (diff) | |
| download | chouette-core-49b1e548dce962bdc2666baba5dbf9df72ff7e91.tar.bz2 | |
Refs #1295: convert erb to slim (imports)
| -rw-r--r-- | app/views/imports/_import.erb | 27 | ||||
| -rw-r--r-- | app/views/imports/_import.html.slim | 24 | ||||
| -rw-r--r-- | app/views/imports/_imports.html.erb | 9 | ||||
| -rw-r--r-- | app/views/imports/_imports.html.slim | 9 | ||||
| -rw-r--r-- | app/views/imports/index.html.erb | 12 | ||||
| -rw-r--r-- | app/views/imports/index.html.slim | 13 | ||||
| -rw-r--r-- | app/views/imports/index.js.erb | 1 | ||||
| -rw-r--r-- | app/views/imports/index.js.slim | 1 | ||||
| -rw-r--r-- | app/views/imports/show.html.erb | 32 | ||||
| -rw-r--r-- | app/views/imports/show.html.slim | 27 |
10 files changed, 74 insertions, 81 deletions
diff --git a/app/views/imports/_import.erb b/app/views/imports/_import.erb deleted file mode 100644 index 52ef5fc3d..000000000 --- a/app/views/imports/_import.erb +++ /dev/null @@ -1,27 +0,0 @@ -<div id="index_item" class="panel panel-default import"> - <div class="panel-heading"> - <div class="panel-title clearfix"> - <span class="pull-right"> - <%= link_to referential_import_path(@referential, import.id), :method => :delete, :data => {:confirm => t('imports.actions.destroy_confirm')}, :class => "btn btn-danger btn-sm" do %> - <span class="fa fa-trash-o"></span> - <% end %> - </span> - <h5> - <%= link_to( referential_import_path(@referential, import.id), :class => "preview", :title => "#{ImportTask.model_name.human.capitalize} #{import.name}") do %> - <%= job_status_title(import) %> - <% end %> - </h5> - </div> - </div> - <div class="panel-body"> - <p><%= link_to font_awesome_classic_tag("fa-file-#{import.filename_extension}-o") + t("imports.show.imported_file"), imported_file_referential_import_path(@referential, import.id) if import.file_path? %></p> - <p><%= link_to font_awesome_classic_tag("fa-external-link") + t("imports.show.compliance_check"), compliance_check_referential_import_path(@referential, import.id) if import.compliance_check? %></p> - </div> - <div class="panel-footer"> - <%= import_attributes_tag(import) %> - - <div class="history"> - <%= l(import.created_at, :format => "%d/%m/%Y %H:%M") if import.created_at %> | <%= import.user_name %> - </div> - </div> -</div> diff --git a/app/views/imports/_import.html.slim b/app/views/imports/_import.html.slim new file mode 100644 index 000000000..7d4753358 --- /dev/null +++ b/app/views/imports/_import.html.slim @@ -0,0 +1,24 @@ +#index_item.panel.panel-default.import + .panel-heading + .panel-title.clearfix + span.pull-right + = link_to referential_import_path(@referential, import.id), method: :delete, :data => {:confirm => t('imports.actions.destroy_confirm')}, class: 'btn btn-danger btn-sm' do + span.fa.fa-trash-o + + h5 + = link_to( referential_import_path(@referential, import.id), class: 'preview', :title => "#{ImportTask.model_name.human.capitalize} #{import.name}") do + = job_status_title(import) + + .panel-body + p + = link_to font_awesome_classic_tag("fa-file-#{import.filename_extension}-o") + t("imports.show.imported_file"), imported_file_referential_import_path(@referential, import.id) if import.file_path? + + p + = link_to font_awesome_classic_tag("fa-external-link") + t("imports.show.compliance_check"), compliance_check_referential_import_path(@referential, import.id) if import.compliance_check? + + .panel-footer + = import_attributes_tag(import) + + .history + = l(import.created_at, :format => "%d/%m/%Y %H:%M") if import.created_at + = " | #{import.user_name}"
\ No newline at end of file diff --git a/app/views/imports/_imports.html.erb b/app/views/imports/_imports.html.erb deleted file mode 100644 index d4c7e0b9e..000000000 --- a/app/views/imports/_imports.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -<div class="page_info"> - <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @imports %> -</div> -<div class="imports paginated_content"> - <%= paginated_content @imports, "imports/import" %> -</div> -<div class="pagination"> - <%= will_paginate @imports, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer %> -</div> diff --git a/app/views/imports/_imports.html.slim b/app/views/imports/_imports.html.slim new file mode 100644 index 000000000..3605fd10b --- /dev/null +++ b/app/views/imports/_imports.html.slim @@ -0,0 +1,9 @@ +.page_info + span.search = t("will_paginate.page_entries_info.search") + = page_entries_info @imports + +.imports.paginated_content + = paginated_content @imports, "imports/import" + +.pagination + = will_paginate @imports, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer
\ No newline at end of file diff --git a/app/views/imports/index.html.erb b/app/views/imports/index.html.erb deleted file mode 100644 index 6699819b8..000000000 --- a/app/views/imports/index.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -<%= title_tag t('.title') %> -<div class="warning"><%= t('.warning') %> </div> - -<div id="imports"><%= render 'imports' %></div> - - -<% content_for :sidebar do %> - <ul class="actions"> - <li><%= link_to t('imports.actions.new'), new_referential_import_task_path(@referential), :class => "add" %></li> - <li><%= link_to t('rule_parameter_sets.actions.index'), organisation_rule_parameter_sets_path, :class => "link" %></li> - </ul> -<% end %> diff --git a/app/views/imports/index.html.slim b/app/views/imports/index.html.slim new file mode 100644 index 000000000..b1922d005 --- /dev/null +++ b/app/views/imports/index.html.slim @@ -0,0 +1,13 @@ += title_tag t('.title') + +.warning = t('.warning') + +#imports + = render 'imports' + +- content_for :sidebar do + ul.actions + li + = link_to t('imports.actions.new'), new_referential_import_task_path(@referential), class: 'add' + li + = link_to t('rule_parameter_sets.actions.index'), organisation_rule_parameter_sets_path, class: 'link'
\ No newline at end of file diff --git a/app/views/imports/index.js.erb b/app/views/imports/index.js.erb deleted file mode 100644 index 1207b18ce..000000000 --- a/app/views/imports/index.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#imports').html('<%= escape_javascript(render("imports")) %>');
\ No newline at end of file diff --git a/app/views/imports/index.js.slim b/app/views/imports/index.js.slim new file mode 100644 index 000000000..b15c00084 --- /dev/null +++ b/app/views/imports/index.js.slim @@ -0,0 +1 @@ +$('#imports').html("#{escape_javascript(render("imports"))}");
\ No newline at end of file diff --git a/app/views/imports/show.html.erb b/app/views/imports/show.html.erb deleted file mode 100644 index 926445f93..000000000 --- a/app/views/imports/show.html.erb +++ /dev/null @@ -1,32 +0,0 @@ -<div class="title row"> - <div class="col-md-8"> - <%= title_tag job_status_title(@import) %> - </div> - <div class="col-md-4"> - <%= import_attributes_tag(@import) %> - </div> -</div> -<% if @import.report.failure_code? %> -<div class="alert alert-danger"> - <%= t("iev.failure.#{@import.report.failure_code}") %> -</div> -<% end %> -<div class="progress_bars"> - <%= progress_bar_tag(@import) %> -</div> -<div class="import_show"> - <div class="links"> - <%= link_to font_awesome_classic_tag("fa-file-#{@import.filename_extension}-o") + t("imports.show.imported_file"), imported_file_referential_import_path(@referential, @import.id) if @import.file_path? %> - <%= link_to font_awesome_classic_tag("fa-external-link") + t("imports.show.compliance_check"), compliance_check_referential_import_path(@referential, @import.id) if @import.compliance_check? %> - </div> - <%= render(partial: 'shared/ie_report', locals: {job: @import, line_items: @line_items}) %> -</div> - -<% content_for :sidebar do %> - <ul class="actions"> - <li><%= link_to t('imports.actions.destroy'), referential_import_path(@referential, @import.id), method: :delete, data: {confirm: t('imports.actions.destroy_confirm')}, class: "remove" %></li> - </ul> - - <%= history_tag(@import) %> - -<% end %> diff --git a/app/views/imports/show.html.slim b/app/views/imports/show.html.slim new file mode 100644 index 000000000..5992af311 --- /dev/null +++ b/app/views/imports/show.html.slim @@ -0,0 +1,27 @@ +.title.row + .col-md-8 + = title_tag job_status_title(@import) + + .col-md-4 + = import_attributes_tag(@import) + +- if @import.report.failure_code? + .alert.alert-danger + = t("iev.failure.#{@import.report.failure_code}") + +.progress_bars + = progress_bar_tag(@import) + +.import_show + .links + = link_to font_awesome_classic_tag("fa-file-#{@import.filename_extension}-o") + t("imports.show.imported_file"), imported_file_referential_import_path(@referential, @import.id) if @import.file_path? + = link_to font_awesome_classic_tag("fa-external-link") + t("imports.show.compliance_check"), compliance_check_referential_import_path(@referential, @import.id) if @import.compliance_check? + + = render(partial: 'shared/ie_report', locals: {job: @import, line_items: @line_items}) + +- content_for :sidebar do + ul.actions + li + = link_to t('imports.actions.destroy'), referential_import_path(@referential, @import.id), method: :delete, data: {confirm: t('imports.actions.destroy_confirm')}, class: 'remove' + + = history_tag(@import)
\ No newline at end of file |
