Commit d02c2ee7f892e6adf6bb504eab02d313faba11d1

Authored by Luciano Prestes
1 parent 5e3adf33
Exists in master and in 79 other branches add_sisp_to_chef, add_super_archives_plugin, api_for_colab, automates_core_packing, backup_not_prod, changes_in_buttons_on_content_panel, colab_automated_login, colab_spb_plugin_recipe, colab_widgets_settings, design_validation, dev_env_minimal, disable_email_dev, fix_breadcrumbs_position, fix_categories_software_link, fix_edit_institution, fix_edit_software_with_another_license, fix_get_license_info, fix_gitlab_assets_permission, fix_list_style_inside_article, fix_list_style_on_folder_elements, fix_members_pagination, fix_merge_request_url, fix_models_translations, fix_no_license, fix_software_api, fix_software_block_migration, fix_software_communities_translations, fix_software_communities_unit_test, fix_style_create_institution_admin_panel, fix_superarchives_imports, fix_sym_links_noosfero, focus_search_field_theme, gov-user-refactoring, gov-user-refactoring-rails4, header_fix, institution_modal_on_rating, kalibro-conf-refactoring, kalibro-processor-package, lxc_settings, margin_fix, mezuro_cookbook, prezento, refactor_download_block, refactor_software_communities, refactor_software_for_sisp, register_page, release-process, release-process-v2, remove-unused-images, remove_broken_theme, remove_secondary_email_from_user, remove_sisp_buttons, removing_super_archives_email, review_message, scope2method, signals_user_noosfero, sisp_catalog_header, sisp_colab_config, sisp_dev, sisp_dev_master, sisp_simple_version, software_as_organization, software_catalog_style_fix, software_communities_html_refactor, software_infos_api, spb_minimal_env, spb_to_rails4, spec_refactor, stable-4.1, stable-4.2, stable-4.x, temp_soft_comm_refactoring, theme_header, theme_javascript_refactory, thread_dropdown, thread_page, update_search_by_categories, update_software_api, update_softwares_boxes

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>
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 &lt; 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
... ... @@ -523,3 +523,8 @@ input[type=checkbox] {
523 523 }
524 524  
525 525 /* End software catalog definitions */
  526 +
  527 +div.step-explanation {
  528 + margin-top: 2px;
  529 + margin-bottom: 15px;
  530 +}
... ...
views/first_edit_software_community_extras.html.erb
... ... @@ -1,3 +0,0 @@
1   -<div class="software-step-info" id="software_creation_step">
2   - <h3><%= _("Step 2/2 - Software Community Configuration")%></h3>
3   -</div>
4 0 \ No newline at end of file
views/profile_editor/_first_edit_software_community_extras.html.erb 0 → 100644
... ... @@ -0,0 +1,9 @@
  1 +<div class="software-step-info">
  2 + <div class= <%= class_step_one %> >
  3 + <h3><%= _("Step 1 - Software Creation")%></h3>
  4 + </div>
  5 +
  6 + <div class= <%= class_step_two %> >
  7 + <h3><%= _("Step 2 - Community Settings")%></h3>
  8 + </div>
  9 +</div>
... ...
views/profile_editor/_software_community.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!')) + '&nbsp;' +
  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 }%>
... ...