Commit d02c2ee7f892e6adf6bb504eab02d313faba11d1
1 parent
5e3adf33
Exists in
master
and in
79 other branches
Show the title of steps 1 and 2 on both pages, but by highlighting the active step and the inactive
Signed-off-by: Arthur Del Esposte <arthurmde@gmail.com> Signed-off-by: Luciano Prestes Cavalcanti <lucianopcbr@gmail.com>
Showing
8 changed files
with
108 additions
and
24 deletions
Show diff stats
lib/ext/profile_editor_controller.rb
| ... | ... | @@ -7,6 +7,12 @@ class ProfileEditorController |
| 7 | 7 | def edit_software_community |
| 8 | 8 | @profile_data = profile |
| 9 | 9 | @possible_domains = profile.possible_domains |
| 10 | + @first_edit = profile.software_info.first_edit? | |
| 11 | + | |
| 12 | + if @first_edit | |
| 13 | + profile.software_info.first_edit = false | |
| 14 | + profile.software_info.save! | |
| 15 | + end | |
| 10 | 16 | |
| 11 | 17 | edit if request.post? |
| 12 | 18 | end | ... | ... |
lib/software_communities_plugin.rb
| ... | ... | @@ -38,14 +38,6 @@ class SoftwareCommunitiesPlugin < Noosfero::Plugin |
| 38 | 38 | |
| 39 | 39 | if profile.person? |
| 40 | 40 | expanded_template('person_editor_extras.html.erb') |
| 41 | - elsif profile.respond_to?(:software_info) && | |
| 42 | - !profile.software_info.nil? | |
| 43 | - | |
| 44 | - if profile.software_info.first_edit? | |
| 45 | - profile.software_info.first_edit = false | |
| 46 | - profile.software_info.save! | |
| 47 | - expanded_template('first_edit_software_community_extras.html.erb') | |
| 48 | - end | |
| 49 | 41 | end |
| 50 | 42 | end |
| 51 | 43 | ... | ... |
public/style.css
views/first_edit_software_community_extras.html.erb
views/profile_editor/_first_edit_software_community_extras.html.erb
0 → 100644
| ... | ... | @@ -0,0 +1,72 @@ |
| 1 | +<h2><%= _('General information') %></h2> | |
| 2 | + | |
| 3 | + <%= required_fields_message %> | |
| 4 | + | |
| 5 | + <%= required f.text_field(:name) %> | |
| 6 | + | |
| 7 | + <%= @plugins.dispatch(:profile_info_extra_contents).collect { |content| instance_exec(&content) }.join("") %> | |
| 8 | + | |
| 9 | +<% if @environment.enabled?('enable_organization_url_change') %> | |
| 10 | + <script type="text/javascript"> | |
| 11 | + function updateUrlField(name_field, id) { | |
| 12 | + url_field = $(id); | |
| 13 | + url_field.value = convToValidIdentifier(name_field.value, "-"); | |
| 14 | + warn_value_change(url_field); | |
| 15 | + } | |
| 16 | + </script> | |
| 17 | +<% end %> | |
| 18 | + | |
| 19 | +<% if @environment.enabled?('enable_organization_url_change') %> | |
| 20 | + <script type="text/javascript"> | |
| 21 | + function submit_button() { | |
| 22 | + return jQuery("#profile-data").find("input.submit")[0]; | |
| 23 | + } | |
| 24 | + function warn_value_change() { | |
| 25 | + show_warning('profile-identifier-formitem', "identifier-change-confirmation"); | |
| 26 | + disable_button(submit_button()); | |
| 27 | + } | |
| 28 | + function confirm_change() { | |
| 29 | + enable_button(submit_button()); | |
| 30 | + hide_warning('identifier-change-confirmation'); | |
| 31 | + } | |
| 32 | + function no_change() { | |
| 33 | + jQuery("#profile_data_identifier").val(jQuery("#old_profile_identifier").val()); | |
| 34 | + enable_button(submit_button()); | |
| 35 | + hide_warning('identifier-change-confirmation'); | |
| 36 | + } | |
| 37 | + | |
| 38 | + </script> | |
| 39 | + | |
| 40 | + <%= hidden_field_tag 'old_profile_identifier', @profile.identifier %> | |
| 41 | + <div id="profile-identifier-formitem"> | |
| 42 | + <%= required labelled_form_field( _('Address'), | |
| 43 | + content_tag('code', | |
| 44 | + url_for(profile.url).gsub(/#{profile.identifier}$/, '') + | |
| 45 | + text_field(:profile_data, :identifier, :onchange => "warn_value_change()", :size => 25) | |
| 46 | + ) + | |
| 47 | + content_tag('div', | |
| 48 | + content_tag('strong', _('WARNING!')) + ' ' + | |
| 49 | + _("You are about to change the address, and this will break external links to the homepage or to content inside it. Do you really want to change?") + | |
| 50 | + content_tag('div', | |
| 51 | + button_to_function(:ok, _("Yes"), "confirm_change()") + ' ' + | |
| 52 | + button_to_function(:cancel, _('No'), 'no_change()') | |
| 53 | + ), | |
| 54 | + :id => 'identifier-change-confirmation', | |
| 55 | + :class => 'change-confirmation', | |
| 56 | + :style => 'display: none;' | |
| 57 | + ) | |
| 58 | + ) | |
| 59 | + %> | |
| 60 | + </div> | |
| 61 | +<% end %> | |
| 62 | + | |
| 63 | +<%= render :partial => 'shared/organization_custom_fields', :locals => { :f => f, :object_name => 'profile_data', :profile => @profile } %> | |
| 64 | + | |
| 65 | +<%= labelled_check_box(_('Enable "contact us"'), 'profile_data[enable_contact_us]', "1", @profile.enable_contact_us) if @profile.enterprise? %> | |
| 66 | + | |
| 67 | +<%= render :partial => 'moderation', :locals => { :profile => @profile } %> | |
| 68 | + | |
| 69 | +<% if profile.enterprise? && profile.environment.enabled?('products_for_enterprises') %> | |
| 70 | + <h2><%=_('Products/Services catalog')%></h2> | |
| 71 | + <%= labelled_form_field(_('Number of products/services displayed per page on catalog'), text_field(:profile_data, :products_per_catalog_page, :size => 3)) %> | |
| 72 | +<% end %> | ... | ... |
views/profile_editor/edit_software_community.html.erb
| 1 | -<h1><%= _('Configure Community') %></h1> | |
| 1 | +<%= render :partial => 'first_edit_software_community_extras', :locals => {:class_step_one => "another-step", :class_step_two => "current-step"} if @first_edit %> | |
| 2 | 2 | |
| 3 | -<h6><%= _('Set the basic settings of the software associated community') %></h6> | |
| 3 | +<h1><%= _('Configure Software Community') %></h1> | |
| 4 | + | |
| 5 | +<div class='step-explanation'> | |
| 6 | + <spam> | |
| 7 | + <%= _('Set the basic settings of the software associated community') %> | |
| 8 | + </spam> | |
| 9 | +</div> | |
| 4 | 10 | |
| 5 | 11 | <%= javascript_include_tag 'deactivate_profile' %> |
| 6 | 12 | <%= error_messages_for :profile_data %> |
| ... | ... | @@ -13,7 +19,7 @@ |
| 13 | 19 | </div> |
| 14 | 20 | <% end %> |
| 15 | 21 | |
| 16 | - <%= render :partial => partial_for_class(@profile.class), :locals => { :f => f } %> | |
| 22 | + <%= render :partial => 'software_community', :locals => { :f => f } %> | |
| 17 | 23 | |
| 18 | 24 | <div id="profile_change_picture_title"> |
| 19 | 25 | <h2><%= _('Change picture') %></h2> | ... | ... |
views/software_communities_plugin_myprofile/new_software.html.erb
| 1 | 1 | <span id="new-software-page"></span> |
| 2 | 2 | |
| 3 | -<div class="software-step-info"> | |
| 4 | - <h3><%= _("Step 1 - Software Creation")%></h3> | |
| 5 | - <h3 style="color: rgba(0, 0, 0, 0.2)"><%= _("Step 2 - Edit Community info ")%></h3> | |
| 3 | +<%= render :partial => 'profile_editor/first_edit_software_community_extras', :locals => {:class_step_one => "current-step", :class_step_two => "another-step"} %> | |
| 6 | 4 | |
| 7 | - <p> | |
| 8 | - <spam class = 'software-message' >Enter the basic information about the software.<br> | |
| 9 | - You can add the details after you create it. | |
| 10 | - </spam> | |
| 11 | - </p> | |
| 5 | +<h1><%= _('Creating new software') %></h1> | |
| 12 | 6 | |
| 7 | +<div class='step-explanation'> | |
| 8 | + <spam> | |
| 9 | + <%= _('Enter the basic information about the software.<br> | |
| 10 | + You can add the details after you create it.') %> | |
| 11 | + </spam> | |
| 13 | 12 | </div> |
| 14 | 13 | |
| 15 | -<h1><%= _('Creating new software') %></h1> | |
| 16 | - | |
| 17 | 14 | <% if environment.enabled?('admin_must_approve_new_communities') %> |
| 18 | 15 | <div class='explanation'> |
| 19 | 16 | <%= _("Note that the creation of communities in this environment is restricted. Your request to create this new community will be sent to %{environment} administrators and will be approved or rejected according to their methods and criteria.") % { :environment => environment.name }%> | ... | ... |