GitLab steht Mittwoch, den 08. Juli, zwischen 09:00 und 13:00 Uhr aufgrund von Wartungsarbeiten nicht zur Verfügung.

Commit c8be63fe authored by maeda's avatar maeda

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

Patch by Sho HASHIMOTO.


git-svn-id: https://svn.redmine.org/redmine/trunk@17452 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent b59c7a80
......@@ -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'
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment