Merge pull request #3707 from Undev/default_project_settings

Default settings for project features
This commit is contained in:
Dmitriy Zaporozhets 2013-04-26 01:19:48 -07:00
commit b536acc92a
3 changed files with 18 additions and 2 deletions

View file

@ -33,8 +33,11 @@ module Projects
end end
# Disable less important features by default # Disable less important features by default
@project.wall_enabled = false @project.issues_enabled = Gitlab.config.gitlab.default_projects_features.issues
@project.snippets_enabled = false @project.wiki_enabled = Gitlab.config.gitlab.default_projects_features.wiki
@project.wall_enabled = Gitlab.config.gitlab.default_projects_features.wall
@project.snippets_enabled = Gitlab.config.gitlab.default_projects_features.snippets
@project.merge_requests_enabled = Gitlab.config.gitlab.default_projects_features.merge_requests
@project.creator = current_user @project.creator = current_user

View file

@ -37,6 +37,13 @@ production: &base
# signup_enabled: true # default: false - Account passwords are not sent via the email if signup is enabled. # signup_enabled: true # default: false - Account passwords are not sent via the email if signup is enabled.
# username_changing_enabled: false # default: true - User can change her username/namespace # username_changing_enabled: false # default: true - User can change her username/namespace
## Default project features settings
default_projects_features:
issues: true
merge_requests: true
wiki: true
wall: false
snippets: false
## External issues trackers ## External issues trackers
issues_tracker: issues_tracker:

View file

@ -60,6 +60,12 @@ Settings.gitlab['url'] ||= Settings.send(:build_gitlab_url)
Settings.gitlab['user'] ||= 'git' Settings.gitlab['user'] ||= 'git'
Settings.gitlab['signup_enabled'] ||= false Settings.gitlab['signup_enabled'] ||= false
Settings.gitlab['username_changing_enabled'] = true if Settings.gitlab['username_changing_enabled'].nil? Settings.gitlab['username_changing_enabled'] = true if Settings.gitlab['username_changing_enabled'].nil?
Settings.gitlab['default_projects_features'] ||= {}
Settings.gitlab.default_projects_features['issues'] = true if Settings.gitlab.default_projects_features['issues'].nil?
Settings.gitlab.default_projects_features['merge_requests'] = true if Settings.gitlab.default_projects_features['merge_requests'].nil?
Settings.gitlab.default_projects_features['wiki'] = true if Settings.gitlab.default_projects_features['wiki'].nil?
Settings.gitlab.default_projects_features['wall'] = false if Settings.gitlab.default_projects_features['wall'].nil?
Settings.gitlab.default_projects_features['snippets'] = false if Settings.gitlab.default_projects_features['snippets'].nil?
# #
# Gravatar # Gravatar