diff options
author | Bwko <bouwko@gmail.com> | 2018-04-09 17:15:32 +0200 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2018-04-09 23:15:32 +0800 |
commit | 8ee45eb614eaa4814936a2166addc8c1208ea1f5 (patch) | |
tree | aa63463560f676b1be03ac53f817b32e52d5e334 /templates | |
parent | 30c81a126c36da555f3e982d36c38779d962edfd (diff) | |
download | gitea-8ee45eb614eaa4814936a2166addc8c1208ea1f5.tar.gz gitea-8ee45eb614eaa4814936a2166addc8c1208ea1f5.zip |
Add EnableTimetracking option to app settings (#3719)
Diffstat (limited to 'templates')
-rw-r--r-- | templates/admin/config.tmpl | 12 | ||||
-rw-r--r-- | templates/repo/settings/options.tmpl | 23 |
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"> |