From 1b41bd0789c6c8e858ec86eaab8fbd46888940e9 Mon Sep 17 00:00:00 2001 From: Gabriela Navarro Date: Tue, 21 Oct 2014 10:48:31 -0200 Subject: [PATCH] Rename tabs and fix the buttons on Software Info. Add Save and configure community button --- controllers/mpog_software_plugin_myprofile_controller.rb | 6 +++++- views/mpog_software_plugin_myprofile/_public_software_info.html.erb | 1 + views/mpog_software_plugin_myprofile/edit_software.html.erb | 5 +++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/controllers/mpog_software_plugin_myprofile_controller.rb b/controllers/mpog_software_plugin_myprofile_controller.rb index a64a8a8..138c3a9 100644 --- a/controllers/mpog_software_plugin_myprofile_controller.rb +++ b/controllers/mpog_software_plugin_myprofile_controller.rb @@ -116,7 +116,11 @@ class MpogSoftwarePluginMyprofileController < MyProfileController begin @software_info.save! - redirect_to :controller => 'profile_editor', :action => 'index' + if params[:commit] == _('Save and Configure Community') + redirect_to :controller => 'profile_editor', :action => 'edit' + else + redirect_to :controller => 'profile_editor', :action => 'index' + end rescue ActiveRecord::RecordInvalid => invalid end end diff --git a/views/mpog_software_plugin_myprofile/_public_software_info.html.erb b/views/mpog_software_plugin_myprofile/_public_software_info.html.erb index b672604..02123ce 100644 --- a/views/mpog_software_plugin_myprofile/_public_software_info.html.erb +++ b/views/mpog_software_plugin_myprofile/_public_software_info.html.erb @@ -99,3 +99,4 @@ <%= label_tag(:demonstration_url ,_("Demonstration url:"), :class=>"formlabel") %> <%= text_field_tag("software[demonstration_url]", @software_info.demonstration_url) %> + diff --git a/views/mpog_software_plugin_myprofile/edit_software.html.erb b/views/mpog_software_plugin_myprofile/edit_software.html.erb index ce11fbb..49021db 100644 --- a/views/mpog_software_plugin_myprofile/edit_software.html.erb +++ b/views/mpog_software_plugin_myprofile/edit_software.html.erb @@ -4,16 +4,17 @@ <%= labelled_form_for :mpog_software_plugin_myprofile, :html => { :multipart => true, :id => 'edit-form' } do |f| %> -<% tabs << {:title => _("Basic"), :id => 'basic-info', +<% tabs << {:title => _("Software"), :id => 'basic-info', :content => (render :partial => 'main_software_editor_extras')} %> -<% tabs << {:title => _("Especific"), :id => 'especific-info', +<% tabs << {:title => _("Public Software"), :id => 'especific-info', :content => (render :partial => 'public_software_info')} %> <%= render_tabs(tabs) %> <% button_bar do %> <%= submit_button(:save, _('Save')) %> + <%= submit_button(:save, _('Save and Configure Community')) %> <%= button(:back, _('Back to control panel'), :controller => 'profile_editor') %> <% end %> <% end %> \ No newline at end of file -- libgit2 0.21.2