Commit a8f67508975e1f96efd5bd4b120b2d12cce62c98
Committed by
Diego Camarinha
1 parent
8a4f651a
Exists in
master
and in
29 other branches
[Mezuro] Displaying message when loading project.
Showing
2 changed files
with
18 additions
and
11 deletions
Show diff stats
plugins/mezuro/public/javascripts/project_content.js
... | ... | @@ -59,22 +59,24 @@ function reloadProject(date){ |
59 | 59 | } |
60 | 60 | |
61 | 61 | function showProjectContentFor(state){ |
62 | - alert(state); | |
63 | - if (state == 'ERROR') | |
62 | + if (state == 'ERROR') { | |
63 | + jQuery('#project-state').html('ERROR'); | |
64 | 64 | callAction('project_error', {}, showProjectResult); |
65 | + } | |
65 | 66 | else if (state == 'READY') { |
66 | - jQuery('.msg-time').hide(); | |
67 | + jQuery('#msg-time').html(''); | |
68 | + jQuery('#project-state').html('READY'); | |
67 | 69 | callAction('project_result', {}, showProjectResult); |
68 | 70 | callAction('project_tree', {}, showProjectTree); |
69 | 71 | var project_name = jQuery("#project-result").attr('data-project-name'); |
70 | 72 | callAction('module_result', {module_name: project_name}, showModuleResult); |
71 | 73 | } |
72 | - else if (state.endsWith("ING")) | |
73 | - jQuery('.msg-time').show(); | |
74 | - jQuery('.msg-time').replaceWith('O carregamento do projeto pode levar algumas horas!'); | |
75 | - | |
76 | - showProjectContentAfter(20); | |
77 | - } | |
74 | + else if (state.endsWith("ING")) { | |
75 | + jQuery('#project-state').html(state); | |
76 | + jQuery('#msg-time').html("The project analysis may take long. <br/> You'll receive an e-mail when it's ready!"); | |
77 | + showProjectContentAfter(20); | |
78 | + } | |
79 | +} | |
78 | 80 | |
79 | 81 | function showProjectContentAfter(seconds){ |
80 | 82 | if (seconds > 0){ | ... | ... |
plugins/mezuro/views/content_viewer/show_project.rhtml
... | ... | @@ -26,11 +26,16 @@ |
26 | 26 | <td><%= _('Configuration') %></td> |
27 | 27 | <td><%= @project.configuration_name %></td> |
28 | 28 | </tr> |
29 | + <tr> | |
30 | + <td><%= _('Status')%></td> | |
31 | + <td> | |
32 | + <div id="project-state"><%= @project.state %></div> | |
33 | + <div id="msg-time"></div> | |
34 | + </td> | |
35 | + </tr> | |
29 | 36 | </table> |
30 | 37 | |
31 | 38 | <br /> |
32 | -<div class="msg-time"></div> | |
33 | - | |
34 | 39 | |
35 | 40 | <div id="project-result" data-profile="<%= @page.profile.identifier %>" data-content="<%= @page.id %>" |
36 | 41 | data-project-name="<%= @project.name %>"> | ... | ... |