From 61c32004327aa4fa71a38fe13fba72c24ce7555b Mon Sep 17 00:00:00 2001 From: Carlos Morais + Paulo Meirelles Date: Wed, 15 Feb 2012 16:36:08 -0200 Subject: [PATCH] Rename toogle -> toggle --- plugins/mezuro/lib/mezuro_plugin.rb | 2 +- plugins/mezuro/public/javascripts/autoreload.js | 2 +- plugins/mezuro/public/javascripts/toggle.js | 6 ++++++ plugins/mezuro/public/javascripts/toogle.js | 6 ------ plugins/mezuro/views/content_viewer/_autoreload.rhtml | 21 ++++++++++++++++----- plugins/mezuro/views/content_viewer/_source_tree.rhtml | 6 +++--- plugins/mezuro/views/content_viewer/show_project.rhtml | 25 +++++-------------------- 7 files changed, 32 insertions(+), 36 deletions(-) create mode 100644 plugins/mezuro/public/javascripts/toggle.js delete mode 100644 plugins/mezuro/public/javascripts/toogle.js diff --git a/plugins/mezuro/lib/mezuro_plugin.rb b/plugins/mezuro/lib/mezuro_plugin.rb index 1ead1ab..40eaa45 100644 --- a/plugins/mezuro/lib/mezuro_plugin.rb +++ b/plugins/mezuro/lib/mezuro_plugin.rb @@ -17,7 +17,7 @@ class MezuroPlugin < Noosfero::Plugin end def js_files - ['javascripts/results.js', 'javascripts/toogle.js', 'javascripts/autoreload.js'] + ['javascripts/results.js', 'javascripts/toggle.js', 'javascripts/autoreload.js'] end end diff --git a/plugins/mezuro/public/javascripts/autoreload.js b/plugins/mezuro/public/javascripts/autoreload.js index c50b039..0715091 100644 --- a/plugins/mezuro/public/javascripts/autoreload.js +++ b/plugins/mezuro/public/javascripts/autoreload.js @@ -5,7 +5,7 @@ function show_autoreload($){ var project_name = $('#autoreload').attr('data-project-name'); var endpoint = '/profile/' + profile + '/plugins/mezuro/autoreload/' + project; - jQuery('#autoreload').html('Loading ...'); // #FIXME + jQuery('#autoreload').html('Loading results for ...' + project_name); // #FIXME $.get(endpoint, {project_name: project_name}, show_page_with_results); return false; } diff --git a/plugins/mezuro/public/javascripts/toggle.js b/plugins/mezuro/public/javascripts/toggle.js new file mode 100644 index 0000000..312b692 --- /dev/null +++ b/plugins/mezuro/public/javascripts/toggle.js @@ -0,0 +1,6 @@ +function toggle(id){ + var suffixes = ['_hidden', '_plus', '_minus']; + for (var i in suffixes){ + jQuery('#' + id + suffixes[i]).toggle(); + } +} \ No newline at end of file diff --git a/plugins/mezuro/public/javascripts/toogle.js b/plugins/mezuro/public/javascripts/toogle.js deleted file mode 100644 index 9398094..0000000 --- a/plugins/mezuro/public/javascripts/toogle.js +++ /dev/null @@ -1,6 +0,0 @@ -function toogle(id){ - var suffixes = ['_hidden', '_plus', '_minus']; - for (var i in suffixes){ - jQuery('#' + id + suffixes[i]).toggle(); - } -} \ No newline at end of file diff --git a/plugins/mezuro/views/content_viewer/_autoreload.rhtml b/plugins/mezuro/views/content_viewer/_autoreload.rhtml index 1529501..5d44274 100644 --- a/plugins/mezuro/views/content_viewer/_autoreload.rhtml +++ b/plugins/mezuro/views/content_viewer/_autoreload.rhtml @@ -1,4 +1,19 @@ -<% if @project_content.project.state == 'READY' %> +<% if ! @project_content.project.error.nil? %> +

<%= _('ERROR') %>

+

+ <%= "State when error ocurred: #{@project_content.project.state}" %> +
+ <% error = @project_content.project.error %> + <%= error.message %> +

+

+<% elsif @project_content.project.state.end_with?('ING') %> + + <%= _("Loading results for %s ...") % @project_content.project.name %> + +<% elsif @project_content.project.state == 'READY' %>

<%= _('LAST RESULT') %>

<% @project_result = @project_content.project_result %> @@ -30,8 +45,4 @@ jQuery(results); -<% else %> - - <%= _("Loading results for %s ...") % project_content.project.name %> - <% end %>. diff --git a/plugins/mezuro/views/content_viewer/_source_tree.rhtml b/plugins/mezuro/views/content_viewer/_source_tree.rhtml index 3f9145d..773375c 100644 --- a/plugins/mezuro/views/content_viewer/_source_tree.rhtml +++ b/plugins/mezuro/views/content_viewer/_source_tree.rhtml @@ -5,9 +5,9 @@ + + id="<%= module_name %>_plus" onclick="toggle('<%= module_name %>')" style="display: none"/> + id="<%= module_name %>_minus" onclick="toggle('<%= module_name %>')"/> @@ -15,7 +15,7 @@ - + <% source_tree.children.each do |child| %> diff --git a/plugins/mezuro/views/content_viewer/show_project.rhtml b/plugins/mezuro/views/content_viewer/show_project.rhtml index 3624ebb..28da86a 100644 --- a/plugins/mezuro/views/content_viewer/show_project.rhtml +++ b/plugins/mezuro/views/content_viewer/show_project.rhtml @@ -30,24 +30,9 @@
-<% if ! @project.error.nil? %> -

<%= _('ERROR') %>

-

- <%= "State when error ocurred: #{@project.state}" %> -
- <% error = @project.error %> - <%= error.message %> -

-

-<% else %> - -
-
+
+
- - -<% end %> + \ No newline at end of file -- libgit2 0.21.2