diff --git a/plugins/mezuro/controllers/profile/mezuro_plugin_repository_controller.rb b/plugins/mezuro/controllers/profile/mezuro_plugin_repository_controller.rb index 7e925e0..b333ad1 100644 --- a/plugins/mezuro/controllers/profile/mezuro_plugin_repository_controller.rb +++ b/plugins/mezuro/controllers/profile/mezuro_plugin_repository_controller.rb @@ -32,6 +32,13 @@ class MezuroPluginRepositoryController < MezuroPluginProfileController end end + def show_repository + project_content = profile.articles.find(params[:id]) + @project_name = project_content.name + @repository = project_content.repositories.select{ |repository| repository.id == params[:repository_id].to_s }.first + @configuration_name = Kalibro::Configuration.find(@repository.configuration_id).name + end + def processing(repository_id) begin if Kalibro::Processing.has_ready_processing(repository_id) diff --git a/plugins/mezuro/views/content_viewer/show_project.rhtml b/plugins/mezuro/views/content_viewer/show_project.rhtml index 6675c01..8201a9f 100644 --- a/plugins/mezuro/views/content_viewer/show_project.rhtml +++ b/plugins/mezuro/views/content_viewer/show_project.rhtml @@ -22,6 +22,11 @@ <%= _('Repositories') %> <% @page.repositories.each do |repository| %> <%= repository.name %> + <%= link_to repository.name, :controller => "mezuro_plugin_repository", + :profile => @page.profile.identifier, + :action => "show_repository", + :id => @page.id, + :repository_id => repository.id %>
<% end %>
diff --git a/plugins/mezuro/views/mezuro_plugin_repository/show_repository.html.erb b/plugins/mezuro/views/mezuro_plugin_repository/show_repository.html.erb index 3fcbd82..8d3d022 100644 --- a/plugins/mezuro/views/mezuro_plugin_repository/show_repository.html.erb +++ b/plugins/mezuro/views/mezuro_plugin_repository/show_repository.html.erb @@ -1,124 +1,24 @@ -

<%= _(MezuroPlugin::ProjectContent.short_description) %>

- -<% - @project = @article.title.nil? ? nil : @article.project - begin - @repository_types = Kalibro::Repository.repository_types.sort - @configuration_names = Kalibro::Configuration.all_names.sort - rescue Exception => exception - @article.errors.add_to_base(exception.message) - @repository_types = [] - @configuration_names = [] - end -%> - -<%= error_messages_for 'project_content' %> - -<%= hidden_field_tag 'project_content[profile_id]', profile.id %> -<%= hidden_field_tag 'id', @article.id %> - -<%= required_fields_message %> -<% if !@project.nil? && !@article.id.nil? %> - <%= required f.text_field(:name, :disabled => 'true') %> -<% else %> - <%= required f.text_field(:name) %> -<% end %> - -<% selected = (@project.nil? ? "" : @project.license) %> -<%= required labelled_form_field _('License'), - f.select(:project_license, MezuroPlugin::Helpers::ContentViewerHelper.create_license_options ,{:selected => selected}) %>
- -<%= f.text_field :description %>
- -<% @selected = (@project.nil? ? @repository_types : @project.repository.type) %> -<%= required labelled_form_field _('Repository type'), - f.select(:repository_type, @repository_types, {:selected => @selected}) %>
- -<%= required f.text_field(:repository_url) %>
- -<% @selected = (@project.nil? ? @configuration_names[0] : @project.configuration_name) %> - -<% if !@project.nil? && !@article.id.nil? %> - <%= required labelled_form_field _('Configuration') + " (Changing the configuration will erase your saved periodic avaliations)", - f.select(:configuration_name, @configuration_names, {:selected => @selected}) %> -<% else %> - <%= required labelled_form_field _('Configuration'), - f.select(:configuration_name, @configuration_names, {:selected => @selected}) %>
-<% end %> - -<% selected = (@project.nil? ? 0 : @project.process_period.to_i) %> -<%= required labelled_form_field _('Periodic Avaliation'), - f.select(:periodicity_in_days, MezuroPlugin::Helpers::ContentViewerHelper.create_periodicity_options ,{:selected => selected}) %>
- - - - - - - - - ************************************* - - - - - - -<% @project = @page.project %> -<% unless @page.errors[:base].nil? %> - <% if @page.errors[:base] =~ /There is no project named/ %> -

Warning:

-

This project doesn't exist on the Web Service. Do you want to <%= link_to 'delete', :action => 'destroy', :controller => 'cms', :profile => @page.profile.identifier, :id => @page.id %> or <%= link_to 'save it again', :action => 'edit', :controller => 'cms', :profile => @page.profile.identifier, :id => @page.id %>?

- <% else %> - <%= @page.errors[:base] %> - <% end %> -<% else %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
<%= _('Name') %><%= @project.name %>
<%= _('License') %><%= @project.license %>
<%= _('Description') %><%= @project.description %>
<%= _('Repository type') %><%= @project.repository.type %>
<%= _('Repository address') %><%= @project.repository.address %>
<%= _('Configuration') %><%= @project.configuration_name %>
<%= _('Periodicity') %><%= MezuroPlugin::Helpers::ContentViewerHelper.get_periodicity_option(@page.periodicity_in_days) %>
<%= _('Status')%> -
<%= @project.state %>
-
-
- -
- -
-
-
-
-
-<% end %> - +

+ <%= "Project Name: " + @project_name %> +

+

+ <%= "Name: " + @repository.name %> +

+

+ <%= "Description: " + @repository.description %> +

+

+ <%= "License: " + @repository.license %> +

+

+ <%= "Process Period: " + @repository.process_period %> +

+

+ <%= "Type: " + @repository.type %> +

+

+ <%= "Address: " + @repository.address %> +

+

+ <%= "Configuration: " + @configuration_name %> +

-- libgit2 0.21.2