Commit 1cdaecd5fe5079e874e4a177501946b548fd5bf4
Committed by
João M. M. da Silva
1 parent
ad7f5933
Exists in
master
and in
29 other branches
[Mezuro] refactoring show_repository view
Showing
3 changed files
with
11 additions
and
13 deletions
Show diff stats
plugins/mezuro/controllers/profile/mezuro_plugin_profile_controller.rb
1 | +#TODO Ver quais metodos precisam estar aqui e fazer os testes | ||
1 | class MezuroPluginProfileController < ProfileController | 2 | class MezuroPluginProfileController < ProfileController |
2 | 3 | ||
3 | append_view_path File.join(File.dirname(__FILE__) + '/../../views') | 4 | append_view_path File.join(File.dirname(__FILE__) + '/../../views') |
4 | 5 | ||
6 | +=begin | ||
5 | rescue_from Exception do |exception| | 7 | rescue_from Exception do |exception| |
6 | @message = process_error_message exception.message | 8 | @message = process_error_message exception.message |
7 | render :partial => "error_page" | 9 | render :partial => "error_page" |
@@ -10,7 +12,7 @@ class MezuroPluginProfileController < ProfileController | @@ -10,7 +12,7 @@ class MezuroPluginProfileController < ProfileController | ||
10 | def error_page | 12 | def error_page |
11 | @message = params[:message] | 13 | @message = params[:message] |
12 | end | 14 | end |
13 | - | 15 | +=end |
14 | protected | 16 | protected |
15 | 17 | ||
16 | def process_error_message message | 18 | def process_error_message message |
plugins/mezuro/lib/mezuro_plugin/helpers/content_viewer_helper.rb
@@ -10,7 +10,11 @@ class MezuroPlugin::Helpers::ContentViewerHelper | @@ -10,7 +10,11 @@ class MezuroPlugin::Helpers::ContentViewerHelper | ||
10 | [["Not Periodically", 0], ["1 day", 1], ["2 days", 2], ["Weekly", 7], ["Biweeky", 15], ["Monthly", 30]] | 10 | [["Not Periodically", 0], ["1 day", 1], ["2 days", 2], ["Weekly", 7], ["Biweeky", 15], ["Monthly", 30]] |
11 | end | 11 | end |
12 | 12 | ||
13 | - def self.create_license_options | 13 | + def self.periodicity_option(periodicity) |
14 | + periodicity_options.select {|x| x.last == periodicity}.first.first | ||
15 | + end | ||
16 | + | ||
17 | + def self.license_options | ||
14 | options = YAML.load_file("#{RAILS_ROOT}/plugins/mezuro/licenses.yml") | 18 | options = YAML.load_file("#{RAILS_ROOT}/plugins/mezuro/licenses.yml") |
15 | options = options.split(";") | 19 | options = options.split(";") |
16 | formated_options = [] | 20 | formated_options = [] |
@@ -44,12 +48,6 @@ class MezuroPlugin::Helpers::ContentViewerHelper | @@ -44,12 +48,6 @@ class MezuroPlugin::Helpers::ContentViewerHelper | ||
44 | metric_configuration_snapshot.metric.name.delete("() ") | 48 | metric_configuration_snapshot.metric.name.delete("() ") |
45 | end | 49 | end |
46 | 50 | ||
47 | - def self.get_license_option(selected) | ||
48 | - options = YAML.load_file("#{RAILS_ROOT}/plugins/mezuro/licenses.yml") | ||
49 | - options.split(";") | ||
50 | - selected_option = options.find { |license| license == selected } | ||
51 | - end | ||
52 | - | ||
53 | private | 51 | private |
54 | 52 | ||
55 | def self.discretize_array(array) | 53 | def self.discretize_array(array) |
plugins/mezuro/views/mezuro_plugin_repository/show.html.erb
@@ -16,7 +16,7 @@ | @@ -16,7 +16,7 @@ | ||
16 | </tr> | 16 | </tr> |
17 | <tr> | 17 | <tr> |
18 | <td><%= _('Process Period') %></td> | 18 | <td><%= _('Process Period') %></td> |
19 | - <td><%= MezuroPlugin::Helpers::ContentViewerHelper.get_periodicity_option(@repository.process_period) %></td> | 19 | + <td><%= MezuroPlugin::Helpers::ContentViewerHelper.periodicity_option(@repository.process_period.to_i) %></td> |
20 | </tr> | 20 | </tr> |
21 | <tr> | 21 | <tr> |
22 | <td><%= _('Type') %></td> | 22 | <td><%= _('Type') %></td> |
@@ -33,16 +33,14 @@ | @@ -33,16 +33,14 @@ | ||
33 | <tr> | 33 | <tr> |
34 | <td><%= _('Status')%></td> | 34 | <td><%= _('Status')%></td> |
35 | <td> | 35 | <td> |
36 | - <div id="processing-state" style="color:DarkGoldenRod"><%= @processing.state %></div> | 36 | + <div id="processing-state" style="color:DarkGoldenRod">Retrieving</div> |
37 | <div id="msg-time"></div> | 37 | <div id="msg-time"></div> |
38 | </td> | 38 | </td> |
39 | </tr> | 39 | </tr> |
40 | </table> | 40 | </table> |
41 | - | ||
42 | - | ||
43 | <br /> | 41 | <br /> |
44 | 42 | ||
45 | -<div id="processing" data-profile="<%= @page.profile.identifier %>" data-content="<%= @page.id %>" | 43 | +<div id="processing" data-profile="<%= @data_profile %>" data-content="<%= @data_content %>" |
46 | data-repository-id="<%= @repository.id %>"></div> | 44 | data-repository-id="<%= @repository.id %>"></div> |
47 | <div id="project-tree"></div> | 45 | <div id="project-tree"></div> |
48 | <div id="module-result"></div> | 46 | <div id="module-result"></div> |