Commit 61c32004327aa4fa71a38fe13fba72c24ce7555b

Authored by Carlos Morais + Paulo Meirelles
Committed by Carlos Morais
1 parent e9d92f2c

Rename toogle -> toggle

plugins/mezuro/lib/mezuro_plugin.rb
... ... @@ -17,7 +17,7 @@ class MezuroPlugin < Noosfero::Plugin
17 17 end
18 18  
19 19 def js_files
20   - ['javascripts/results.js', 'javascripts/toogle.js', 'javascripts/autoreload.js']
  20 + ['javascripts/results.js', 'javascripts/toggle.js', 'javascripts/autoreload.js']
21 21 end
22 22  
23 23 end
... ...
plugins/mezuro/public/javascripts/autoreload.js
... ... @@ -5,7 +5,7 @@ function show_autoreload($){
5 5 var project_name = $('#autoreload').attr('data-project-name');
6 6 var endpoint = '/profile/' + profile + '/plugins/mezuro/autoreload/' + project;
7 7  
8   - jQuery('#autoreload').html('Loading ...'); // #FIXME
  8 + jQuery('#autoreload').html('Loading results for ...' + project_name); // #FIXME
9 9 $.get(endpoint, {project_name: project_name}, show_page_with_results);
10 10 return false;
11 11 }
... ...
plugins/mezuro/public/javascripts/toggle.js 0 → 100644
... ... @@ -0,0 +1,6 @@
  1 +function toggle(id){
  2 + var suffixes = ['_hidden', '_plus', '_minus'];
  3 + for (var i in suffixes){
  4 + jQuery('#' + id + suffixes[i]).toggle();
  5 + }
  6 +}
0 7 \ No newline at end of file
... ...
plugins/mezuro/public/javascripts/toogle.js
... ... @@ -1,6 +0,0 @@
1   -function toogle(id){
2   - var suffixes = ['_hidden', '_plus', '_minus'];
3   - for (var i in suffixes){
4   - jQuery('#' + id + suffixes[i]).toggle();
5   - }
6   -}
7 0 \ No newline at end of file
plugins/mezuro/views/content_viewer/_autoreload.rhtml
1   -<% if @project_content.project.state == 'READY' %>
  1 +<% if ! @project_content.project.error.nil? %>
  2 + <h3><%= _('ERROR') %></h3>
  3 + <p>
  4 + <%= "State when error ocurred: #{@project_content.project.state}" %>
  5 + <br/>
  6 + <% error = @project_content.project.error %>
  7 + <%= error.message %>
  8 + <ul><% error.stack_trace.each do |trace| %>
  9 + <li><%= "#{trace.declaring_class}.#{trace.method_name}(#{trace.file_name}:#{trace.line_number})" %></li>
  10 + <% end %></ul>
  11 + </p>
  12 +<% elsif @project_content.project.state.end_with?('ING') %>
  13 +
  14 + <%= _("Loading results for %s ...") % @project_content.project.name %>
  15 +
  16 +<% elsif @project_content.project.state == 'READY' %>
2 17  
3 18 <h3><%= _('LAST RESULT') %></h3>
4 19 <% @project_result = @project_content.project_result %>
... ... @@ -30,8 +45,4 @@
30 45 jQuery(results);
31 46 </script>
32 47  
33   -<% else %>
34   -
35   - <%= _("Loading results for %s ...") % project_content.project.name %>
36   -
37 48 <% end %>.
... ...
plugins/mezuro/views/content_viewer/_source_tree.rhtml
... ... @@ -5,9 +5,9 @@
5 5 <tr>
6 6 <td width="10%">
7 7 <img alt="+" src="/plugins/mezuro/images/plus.png" class="link"
8   - id="<%= module_name %>_plus" onclick="toogle('<%= module_name %>')"/>
  8 + id="<%= module_name %>_plus" onclick="toggle('<%= module_name %>')" style="display: none"/>
9 9 <img alt="-" src="/plugins/mezuro/images/minus.png" class="link"
10   - id="<%= module_name %>_minus" onclick="toogle('<%= module_name %>')" style="display: none"/>
  10 + id="<%= module_name %>_minus" onclick="toggle('<%= module_name %>')"/>
11 11 </td>
12 12 <td>
13 13 <a href="#" class="module-result-link" data-module-name="<%= module_name %>">
... ... @@ -15,7 +15,7 @@
15 15 </a>
16 16 </td>
17 17 </tr>
18   - <tr id="<%= module_name %>_hidden" style="display: none">
  18 + <tr id="<%= module_name %>_hidden">
19 19 <td></td>
20 20 <td style="text-align: left">
21 21 <% source_tree.children.each do |child| %>
... ...
plugins/mezuro/views/content_viewer/show_project.rhtml
... ... @@ -30,24 +30,9 @@
30 30  
31 31 <br />
32 32  
33   -<% if ! @project.error.nil? %>
34   - <h3><%= _('ERROR') %></h3>
35   - <p>
36   - <%= "State when error ocurred: #{@project.state}" %>
37   - <br/>
38   - <% error = @project.error %>
39   - <%= error.message %>
40   - <ul><% error.stack_trace.each do |trace| %>
41   - <li><%= "#{trace.declaring_class}.#{trace.method_name}(#{trace.file_name}:#{trace.line_number})" %></li>
42   - <% end %></ul>
43   - </p>
44   -<% else %>
45   -
46   - <div id='autoreload' data-profile="<%= @project_content.profile.identifier %>" data-project-id='<%= @project_content.id %>' data-project-name='<%= @project.name %>' data-project-state='<%= @project.state %>'>
47   - </div>
  33 +<div id='autoreload' data-profile="<%= @project_content.profile.identifier %>" data-project-id='<%= @project_content.id %>' data-project-name='<%= @project.name %>' data-project-state='<%= @project.state %>'>
  34 +</div>
48 35  
49   - <script type="text/javascript">
50   - jQuery(show_autoreload);
51   - </script>
52   -
53   -<% end %>
  36 +<script type="text/javascript">
  37 + jQuery(show_autoreload);
  38 +</script>
54 39 \ No newline at end of file
... ...