diff --git a/app/controllers/my_profile/cms_controller.rb b/app/controllers/my_profile/cms_controller.rb index b364bcf..8f66936 100644 --- a/app/controllers/my_profile/cms_controller.rb +++ b/app/controllers/my_profile/cms_controller.rb @@ -104,6 +104,10 @@ class CmsController < MyProfileController redirect_to :action => (@article.parent ? 'view' : 'index'), :id => @article.parent end + def why_categorize + render :action => params[:action], :layout => false + end + protected def redirect_back diff --git a/app/views/cms/edit.rhtml b/app/views/cms/edit.rhtml index 186cb2e..5d9cf76 100644 --- a/app/views/cms/edit.rhtml +++ b/app/views/cms/edit.rhtml @@ -8,7 +8,15 @@ <%= render :partial => partial_for_class(@article.class), :locals => { :f => f } %> - <%= select_categories(:article) %> + <% button_bar do %> + <%= submit_button :save, _('Save') %> + <% end %> + +
+ <%= lightbox_button :help, _('Why categorize?'), :action => 'why_categorize' %> +
+ + <%= select_categories(:article, _('Categorize your article')) %> <%# TODO display the tooltip (title below) in a directly visible way %> <%= f.text_field('tag_list', :size => 64) + diff --git a/app/views/cms/why_categorize.rhtml b/app/views/cms/why_categorize.rhtml new file mode 100644 index 0000000..b97bf7a --- /dev/null +++ b/app/views/cms/why_categorize.rhtml @@ -0,0 +1,9 @@ +<%= _('Why categorize?') %> + +

+<%= _('By categorizing your content, you increase the possibility that other people access it. When they are looking for, say, articles about Bahia and you categorize your article in "Regions/Bahia", then there is a good change that your article is going to be found.') %> +

+ +<% button_bar do %> + <%= lightbox_close_button _('OK') %> +<% end %> diff --git a/test/functional/cms_controller_test.rb b/test/functional/cms_controller_test.rb index af48392..c8d90d4 100644 --- a/test/functional/cms_controller_test.rb +++ b/test/functional/cms_controller_test.rb @@ -400,4 +400,20 @@ class CmsControllerTest < Test::Unit::TestCase assert_tag :tag => 'a', :attributes => { :href => "/myprofile/#{profile.identifier}/cms/view/#{f.id}" }, :descendant => { :content => /Cancel/ } end + should 'link to page explaining about categorization' do + get :edit, :profile => profile.identifier, :id => profile.home_page.id + assert_tag :tag => 'a', :attributes => { :href => "/myprofile/#{profile.identifier}/cms/why_categorize" } + end + + should 'present popup' do + get :why_categorize, :profile => profile.identifier + assert_template 'why_categorize' + assert_no_tag :tag => 'body' + end + + should 'display OK button on why_categorize popup' do + get :why_categorize, :profile => profile.identifier + assert_tag :tag => 'a', :attributes => { :rel => 'deactivate'} # lightbox close button + end + end -- libgit2 0.21.2