Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Commit

Permalink
show exchange states and notice for refresh on creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Michel Etienne committed Aug 22, 2014
1 parent 95aa351 commit a1dcead
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 7 deletions.
Binary file modified app/assets/images/compliance_check_task-pending.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/import_task-pending.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions app/controllers/compliance_check_tasks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ def rule_parameter_set
render "rule_parameter_sets/show"
end

def create
create! do |success, failure|
success.html { flash[:notice] = I18n.t('compliance_check_tasks.new.flash'); redirect_to referential_compliance_check_tasks_path(@referential) }
end
end

protected

alias_method :compliance_check_task, :resource
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/exports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def new
def create
create! do |success, failure|
available_exports
success.html { redirect_to referential_exports_path(@referential) }
success.html { flash[:notice] = I18n.t('exports.new.flash'); redirect_to referential_exports_path(@referential) }
end
end

Expand Down
4 changes: 2 additions & 2 deletions app/controllers/import_tasks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ def file_to_import
end

def create
create! do |success, failure|
create! do |success, failure|
available_imports
success.html { redirect_to referential_import_tasks_path(@referential) }
success.html { flash[:notice] = I18n.t('import_tasks.new.flash'); redirect_to referential_import_tasks_path(@referential) }
end
end

Expand Down
3 changes: 3 additions & 0 deletions app/views/compliance_check_tasks/_compliance_check_task.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
<li class="title"><%= link_to(compliance_check_task.name, referential_compliance_check_task_path(@referential, compliance_check_task)) %></li>
<li class="remove"><%= link_to "<i class='fa fa-trash-o'></i>".html_safe, referential_compliance_check_task_path(@referential, compliance_check_task), :method => :delete, :class => "delete", :data => {:confirm => t('compliance_check_tasks.actions.destroy_confirm')} %></li>
</ul>
<div class="history">
<%= t("compliance_check_tasks.statuses.#{compliance_check_task.status}") %>
</div>
<div class="links">
<% if compliance_check_task.import_task.present? %>
<p><%= link_to( image_tag('icons/link_page.png') + t("compliance_check_tasks.import_task"), referential_import_task_path(@referential, compliance_check_task.import_task)) %></p>
Expand Down
3 changes: 3 additions & 0 deletions app/views/exports/_export.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
</li>
<li class="remove"><%= link_to "<i class='fa fa-trash-o'></i>".html_safe, referential_export_path(@referential, export), :method => :delete, :data => {:confirm => t('exports.actions.destroy_confirm')}, :class => "remove" %></li>
</ul>
<div class="history">
<%= t("exports.statuses.#export.status}") %>
</div>
<div class="links">
<% if export.status == 'completed' %>
<%= link_to t("exports.actions.download"), referential_export_path(@referential, export, :format => :zip), :class => "download" %>
Expand Down
3 changes: 3 additions & 0 deletions app/views/import_tasks/_import_task.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
<li class="title"><% if import_task.save_requested? %><i class="fa fa-save"></i><% end %> <%= link_to(import_task.name, referential_import_task_path(@referential, import_task)) %></li>
<li class="remove"><%= link_to "<i class='fa fa-trash-o'></i>".html_safe, referential_import_task_path(@referential, import_task), :method => :delete, :class => "delete", :data => {:confirm => t('import_tasks.actions.destroy_confirm')} %></li>
</ul>
<div class="history">
<%= t("import_tasks.statuses.#{import_task.status}") %>
</div>
<div class="links">
<p><%= link_to image_tag("icons/file_#{import_task.file_path_extension}.png") + t("import_tasks.show.imported_file"), file_to_import_referential_import_task_path(@referential, import_task) %></p>
<% if import_task.compliance_check_task.present? %>
Expand Down
6 changes: 5 additions & 1 deletion config/locales/compliance_check_tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ en:
title: "Create a new validation"
submit: "Create a validation"
all: "All"
flash: "Validation task on queue, refresh page to see progression"
actions:
new: "Add a validation"
destroy_confirm: "Do you confirm to destroy this validation ?"
Expand All @@ -24,6 +25,7 @@ en:
rule_parameter_set: "Rule parameter set"
statuses:
pending: "Pending"
processing: "Processing"
completed: "Completed"
failed: "Failed"
file_validation_log_messages:
Expand Down Expand Up @@ -80,14 +82,16 @@ fr:
title: "Démarrer une nouvelle validation"
submit: "Lancer la validation"
all: "Toutes"
flash: "La demande de validation est mise en file d'attente, veuillez rafraichir régulièrement la page pour le suivre"
actions:
new: "Ajouter une validation"
destroy_confirm: "Voulez-vous supprimer ce résultat de validation ?"
destroy: "Supprimer cette validation"
edit: "Editer cette validation"
rule_parameter_set: "Jeu de paramètres"
statuses:
pending: "En cours"
pending: "En attente ..."
processing: "En cours ..."
completed: "Achevé"
failed: "Echoué"
uncheck_count:
Expand Down
8 changes: 6 additions & 2 deletions config/locales/exports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ en:
new:
title: "New export"
all: "All"
flash: "Export task on queue, refresh page to see progression"
index:
title: "Exports"
warning: ""
show:
report: "Report"
statuses:
pending: "Pending"
pending: "Pending ..."
processing: "Processing ..."
completed: "Completed"
failed: "Failed"
export_log_messages:
Expand Down Expand Up @@ -118,13 +120,15 @@ fr:
new:
title: "Nouvel export"
all: "Toutes"
flash: "La demande d'export est mise en file d'attente, veuillez rafraichir régulièrement la page pour le suivre"
index:
title: "Exports"
warning: ""
show:
report: "Rapport"
statuses:
pending: "En cours"
pending: "En attente ou en cours ..."
processing: "En cours ..."
completed: "Achevé"
failed: "Echoué"
export_log_messages:
Expand Down
6 changes: 5 additions & 1 deletion config/locales/import_tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ en:
destroy_confirm: "Are you sure you want destroy this import?"
new:
title: "New import"
flash: "Import task on queue, refresh page to see progression"
index:
title: "Imports"
warning: ""
Expand Down Expand Up @@ -37,6 +38,7 @@ en:
journey_patterns_stats: "Journey Patterns"
statuses:
pending: "Pending"
processing: "Processing"
completed: "Completed"
failed: "Failed"
compliance_check_task: "Validate Report"
Expand Down Expand Up @@ -96,6 +98,7 @@ fr:
destroy_confirm: "Etes vous sûr de supprimer cet import ?"
new:
title: "Nouvel import"
flash: "La demande d'import est mise en file d'attente, veuillez rafraichir régulièrement la page pour le suivre"
index:
title: "Imports"
warning: ""
Expand Down Expand Up @@ -140,7 +143,8 @@ fr:
saved: "Sauvé"
save_error: "Sauvegarde en erreur"
statuses:
pending: "En cours"
pending: "En attente ..."
processing: "En cours ..."
completed: "Achevé"
failed: "Echoué"
compliance_check_task: "Validation"
Expand Down

0 comments on commit a1dcead

Please sign in to comment.