summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorBwko <bouwko@gmail.com>2018-04-09 17:15:32 +0200
committerLunny Xiao <xiaolunwen@gmail.com>2018-04-09 23:15:32 +0800
commit8ee45eb614eaa4814936a2166addc8c1208ea1f5 (patch)
treeaa63463560f676b1be03ac53f817b32e52d5e334 /templates
parent30c81a126c36da555f3e982d36c38779d962edfd (diff)
downloadgitea-8ee45eb614eaa4814936a2166addc8c1208ea1f5.tar.gz
gitea-8ee45eb614eaa4814936a2166addc8c1208ea1f5.zip
Add EnableTimetracking option to app settings (#3719)
Diffstat (limited to 'templates')
-rw-r--r--templates/admin/config.tmpl12
-rw-r--r--templates/repo/settings/options.tmpl23
2 files changed, 20 insertions, 15 deletions
diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl
index 7c353ad301..370325692e 100644
--- a/templates/admin/config.tmpl
+++ b/templates/admin/config.tmpl
@@ -132,10 +132,14 @@
<dd><i class="fa fa{{if .Service.DefaultKeepEmailPrivate}}-check{{end}}-square-o"></i></dd>
<dt>{{.i18n.Tr "admin.config.default_allow_create_organization"}}</dt>
<dd><i class="fa fa{{if .Service.DefaultAllowCreateOrganization}}-check{{end}}-square-o"></i></dd>
- <dt>{{.i18n.Tr "admin.config.default_enable_timetracking"}}</dt>
- <dd><i class="fa fa{{if .Service.DefaultEnableTimetracking}}-check{{end}}-square-o"></i></dd>
- <dt>{{.i18n.Tr "admin.config.default_allow_only_contributors_to_track_time"}}</dt>
- <dd><i class="fa fa{{if .Service.DefaultAllowOnlyContributorsToTrackTime}}-check{{end}}-square-o"></i></dd>
+ <dt>{{.i18n.Tr "admin.config.enable_timetracking"}}</dt>
+ <dd><i class="fa fa{{if .Service.EnableTimetracking}}-check{{end}}-square-o"></i></dd>
+ {{if .Service.EnableTimetracking}}
+ <dt>{{.i18n.Tr "admin.config.default_enable_timetracking"}}</dt>
+ <dd><i class="fa fa{{if .Service.DefaultEnableTimetracking}}-check{{end}}-square-o"></i></dd>
+ <dt>{{.i18n.Tr "admin.config.default_allow_only_contributors_to_track_time"}}</dt>
+ <dd><i class="fa fa{{if .Service.DefaultAllowOnlyContributorsToTrackTime}}-check{{end}}-square-o"></i></dd>
+ {{end}}
<dt>{{.i18n.Tr "admin.config.no_reply_address"}}</dt>
<dd>{{if .Service.NoReplyAddress}}{{.Service.NoReplyAddress}}{{else}}-{{end}}</dd>
<div class="ui divider"></div>
diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl
index 8470d6a5e2..3e811559ee 100644
--- a/templates/repo/settings/options.tmpl
+++ b/templates/repo/settings/options.tmpl
@@ -139,19 +139,20 @@
</div>
</div>
<div class="field {{if (.Repository.UnitEnabled $.UnitTypeExternalTracker)}}disabled{{end}}" id="internal_issue_box">
- <div class="field">
- <div class="ui checkbox">
- <input name="enable_timetracker" class="enable-system" data-target="#only_contributors" type="checkbox" {{if .Repository.IsTimetrackerEnabled}}checked{{end}}>
- <label>{{.i18n.Tr "repo.settings.enable_timetracker"}}</label>
+ {{if .Repository.CanEnableTimetracker}}
+ <div class="field">
+ <div class="ui checkbox">
+ <input name="enable_timetracker" class="enable-system" data-target="#only_contributors" type="checkbox" {{if .Repository.IsTimetrackerEnabled}}checked{{end}}>
+ <label>{{.i18n.Tr "repo.settings.enable_timetracker"}}</label>
+ </div>
</div>
- </div>
- <div class="field {{if not .Repository.IsTimetrackerEnabled}}disabled{{end}}" id="only_contributors">
- <div class="ui checkbox">
-
- <input name="allow_only_contributors_to_track_time" type="checkbox" {{if .Repository.AllowOnlyContributorsToTrackTime}}checked{{end}}>
- <label>{{.i18n.Tr "repo.settings.allow_only_contributors_to_track_time"}}</label>
+ <div class="field {{if not .Repository.IsTimetrackerEnabled}}disabled{{end}}" id="only_contributors">
+ <div class="ui checkbox">
+ <input name="allow_only_contributors_to_track_time" type="checkbox" {{if .Repository.AllowOnlyContributorsToTrackTime}}checked{{end}}>
+ <label>{{.i18n.Tr "repo.settings.allow_only_contributors_to_track_time"}}</label>
+ </div>
</div>
- </div>
+ {{end}}
</div>
<div class="field">
<div class="ui radio checkbox">