1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-01-09 09:01:31 +00:00

Add CSS class to identify public projects (#28413).

Patch by Sho HASHIMOTO.


git-svn-id: http://svn.redmine.org/redmine/trunk@17452 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA 2018-07-22 05:02:12 +00:00
parent 26f4b5181f
commit 81fcc06d55
2 changed files with 10 additions and 0 deletions

View File

@ -628,6 +628,7 @@ class Project < ActiveRecord::Base
s << ' root' if root?
s << ' child' if child?
s << (leaf? ? ' leaf' : ' parent')
s << ' public' if is_public?
unless active?
if archived?
s << ' archived'

View File

@ -1006,18 +1006,27 @@ class ProjectTest < ActiveSupport::TestCase
assert_kind_of String, p.css_classes
assert_not_include 'archived', p.css_classes.split
assert_not_include 'closed', p.css_classes.split
assert_include 'public', p.css_classes.split
end
def test_css_classes_for_archived_project
p = Project.new
p.status = Project::STATUS_ARCHIVED
assert_include 'archived', p.css_classes.split
assert_include 'public', p.css_classes.split
end
def test_css_classes_for_closed_project
p = Project.new
p.status = Project::STATUS_CLOSED
assert_include 'closed', p.css_classes.split
assert_include 'public', p.css_classes.split
end
def test_css_classes_for_private_project
p = Project.new
p.is_public = false
assert_not_include 'public', p.css_classes.split
end
def test_combination_of_visible_and_distinct_scopes_in_case_anonymous_group_has_memberships_should_not_error