Commit e23b6d328a772dd5336581f584f9d75ce38e0f81
1 parent
a80f69f8
Exists in
master
and in
22 other branches
Enhancements on visibility of profiles and articles
(ActionItem2495)
Showing
4 changed files
with
13 additions
and
45 deletions
Show diff stats
app/helpers/article_helper.rb
| ... | ... | @@ -6,11 +6,11 @@ module ArticleHelper |
| 6 | 6 | content_tag('div', |
| 7 | 7 | content_tag('div', |
| 8 | 8 | radio_button(:article, :published, true) + |
| 9 | - content_tag('label', _('Public (visible to other people)'), :for => 'article_published') | |
| 9 | + content_tag('label', _('Public (visible to other people)'), :for => 'article_published_true') | |
| 10 | 10 | ) + |
| 11 | 11 | content_tag('div', |
| 12 | 12 | radio_button(:article, :published, false) + |
| 13 | - content_tag('label', _('Private')) | |
| 13 | + content_tag('label', _('Private'), :for => 'article_published_false') | |
| 14 | 14 | ) |
| 15 | 15 | ) + |
| 16 | 16 | content_tag('h4', _('Options')) + | ... | ... |
app/helpers/folder_helper.rb
| ... | ... | @@ -62,21 +62,14 @@ module FolderHelper |
| 62 | 62 | content_tag('div', |
| 63 | 63 | content_tag('div', |
| 64 | 64 | radio_button(:article, :published, true) + |
| 65 | - content_tag('label', _('Public (visible to other people)'), :for => 'article_published') | |
| 65 | + content_tag('label', _('Public (visible to other people)'), :for => 'article_published_true') | |
| 66 | 66 | ) + |
| 67 | 67 | content_tag('div', |
| 68 | 68 | radio_button(:article, :published, false) + |
| 69 | - content_tag('label', _('Private')) | |
| 69 | + content_tag('label', _('Private'), :for => 'article_published_false') | |
| 70 | 70 | ) |
| 71 | 71 | ) + |
| 72 | - content_tag('h4', _('Options')) + | |
| 73 | 72 | content_tag('div', |
| 74 | - (article.can_display_hits? ? | |
| 75 | - content_tag( | |
| 76 | - 'div', | |
| 77 | - check_box(:article, :display_hits) + | |
| 78 | - content_tag('label', _('I want this article to display the number of hits it received'), :for => 'article_display_hits') | |
| 79 | - ) : '') + | |
| 80 | 73 | hidden_field_tag('article[accept_comments]', 0) |
| 81 | 74 | ) |
| 82 | 75 | end | ... | ... |
app/views/profile_editor/edit.rhtml
| ... | ... | @@ -25,43 +25,18 @@ |
| 25 | 25 | |
| 26 | 26 | <% if profile.person? %> |
| 27 | 27 | <div> |
| 28 | - <%= radio_button 'profile_data', 'public_profile', 'true' %> | |
| 29 | - <%= content_tag('label', _('Public'), :for => 'profile_data_public_profile_true') %> | |
| 30 | - — show my contents to all internet users | |
| 28 | + <%= labelled_radio_button _('Public — show my contents to all internet users'), 'profile_data[public_profile]', true, @profile.public_profile? %> | |
| 31 | 29 | </div> |
| 32 | 30 | <div> |
| 33 | - <%= radio_button 'profile_data', 'public_profile', 'false' %> | |
| 34 | - <%= content_tag('label', _('Private'), :for => 'profile_data_public_profile_false') %> | |
| 35 | - — show my contents only to friends | |
| 31 | + <%= labelled_radio_button _('Private — show my contents only to friends'), 'profile_data[public_profile]', false, !@profile.public_profile? %> | |
| 36 | 32 | </div> |
| 37 | 33 | <% else %> |
| 38 | - <table> | |
| 39 | - <tr> | |
| 40 | - <th style='text-align: right;'> | |
| 41 | - <%= _('This profile is:') %> | |
| 42 | - </th> | |
| 43 | - <th> | |
| 44 | - <%= radio_button 'profile_data', 'public_profile', 'true' %> | |
| 45 | - <label for="profile_data_public_profile_true"><u><%= _('Public') %></u></label> | |
| 46 | - </th> | |
| 47 | - <th style='padding: 2px 10px 2px 2px;'> | |
| 48 | - <%= radio_button 'profile_data', 'public_profile', 'false' %> | |
| 49 | - <label for="profile_data_public_profile_false"><u><%= _('Private') %></u></label> | |
| 50 | - </th> | |
| 51 | - </tr> | |
| 52 | - <tr> | |
| 53 | - <td> <%= _('Activate Intranet access (restricted area only for members)') %> </td><td><%= _('Yes') %></td><td><%= _('Yes') %></td> | |
| 54 | - </tr> | |
| 55 | - <tr> | |
| 56 | - <td> <%= _('Include this group directory of groups') %> </td><td><%= _('Yes') %></td><td><%= _('Yes') %></td> | |
| 57 | - </tr> | |
| 58 | - <tr> | |
| 59 | - <td> <%= _('Show content of this group to all internet users') %> </td><td><%= _('Yes') %></td><td><%= _('No') %></td> | |
| 60 | - </tr> | |
| 61 | - <tr> | |
| 62 | - <td> <%= _('Show content of this group to members') %> </td><td><%= _('Yes') %></td><td><%= _('Yes') %></td> | |
| 63 | - </tr> | |
| 64 | - </table> | |
| 34 | + <div> | |
| 35 | + <%= labelled_radio_button _('Public — show content of this group to all internet users'), 'profile_data[public_profile]', true, @profile.public_profile? %> | |
| 36 | + </div> | |
| 37 | + <div> | |
| 38 | + <%= labelled_radio_button _('Private — show content of this group only to members'), 'profile_data[public_profile]', false, !@profile.public_profile? %> | |
| 39 | + </div> | |
| 65 | 40 | <% end %> |
| 66 | 41 | |
| 67 | 42 | <h2><%= _('Translations') %></h2> | ... | ... |
test/functional/cms_controller_test.rb
| ... | ... | @@ -965,7 +965,7 @@ class CmsControllerTest < ActionController::TestCase |
| 965 | 965 | |
| 966 | 966 | post :upload_files, :profile => profile.identifier, :parent_id => folder.id, :back_to => @request.referer, :uploaded_files => [fixture_file_upload('files/rails.png', 'image/png')] |
| 967 | 967 | assert_template nil |
| 968 | - assert_redirected_to 'http://colivre.net/testinguser/test-folder' | |
| 968 | + assert_redirected_to "#{profile.environment.top_url}/testinguser/test-folder" | |
| 969 | 969 | end |
| 970 | 970 | |
| 971 | 971 | should 'record when coming from public view on edit files with view true' do | ... | ... |