Feature #35044 » 0002-Add-project-public-badge.patch
app/views/projects/show.html.erb | ||
---|---|---|
21 | 21 |
<% end %> |
22 | 22 |
</div> |
23 | 23 | |
24 |
<h2><%=l(:label_overview)%></h2> |
|
24 |
<h2><%=l(:label_overview)%> <% if @project.is_public %><span class="badge badge-project-public"><%= l(:label_public_projects) %></span><% end %></h2>
|
|
25 | 25 | |
26 | 26 |
<% unless @project.active? %> |
27 | 27 |
<p class="warning"><span class="icon icon-lock"><%= l(:text_project_closed) %></span></p> |
public/stylesheets/application.css | ||
---|---|---|
1462 | 1462 |
color: #fff; |
1463 | 1463 |
border: 1px solid #d22; |
1464 | 1464 |
} |
1465 |
.badge-project-public { |
|
1466 |
color: #d22; |
|
1467 |
border: 1px solid #d22; |
|
1468 |
} |
|
1465 | 1469 |
.badge-count { |
1466 | 1470 |
color: #fff; |
1467 | 1471 |
background:#9DB9D5; |
test/functional/projects_controller_test.rb | ||
---|---|---|
700 | 700 |
assert_select '#is-public-project-notice', :count => 0 |
701 | 701 |
end |
702 | 702 | |
703 |
def test_show_should_display_project_public_badge_if_project_is_public |
|
704 |
p = Project.find('ecookbook') |
|
705 |
assert p.is_public? |
|
706 | ||
707 |
get(:show, params: {id: p.identifier}) |
|
708 |
assert_response :success |
|
709 |
assert_select '.badge.badge-project-public', text: l(:label_public_projects) |
|
710 |
end |
|
711 | ||
712 |
def test_show_should_not_display_project_public_badge_if_project_is_private |
|
713 |
@request.session[:user_id] = 1 |
|
714 |
p = Project.find('private-child') |
|
715 |
assert_not p.is_public? |
|
716 | ||
717 |
get(:show, params: {id: p.identifier}) |
|
718 |
assert_response :success |
|
719 |
assert_select '.badge.badge-project-public', count: 0 |
|
720 |
end |
|
721 | ||
703 | 722 |
def test_show_should_display_visible_custom_fields |
704 | 723 |
ProjectCustomField.find_by_name('Development status').update_attribute :visible, true |
705 | 724 |
get(:show, :params => {:id => 'ecookbook'}) |