aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/admin/config.tmpl4
-rw-r--r--templates/install.tmpl6
-rw-r--r--templates/repo/issue/view_content/comments.tmpl44
-rw-r--r--templates/repo/issue/view_content/sidebar.tmpl101
-rw-r--r--templates/repo/settings/options.tmpl19
5 files changed, 154 insertions, 20 deletions
diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl
index f9038e1425..b57b1847f6 100644
--- a/templates/admin/config.tmpl
+++ b/templates/admin/config.tmpl
@@ -132,6 +132,10 @@
<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.no_reply_address"}}</dt>
<dd>{{if .Service.NoReplyAddress}}{{.Service.NoReplyAddress}}{{else}}-{{end}}</dd>
<div class="ui divider"></div>
diff --git a/templates/install.tmpl b/templates/install.tmpl
index 5c6d1a9473..924eb2837c 100644
--- a/templates/install.tmpl
+++ b/templates/install.tmpl
@@ -231,6 +231,12 @@
</div>
</div>
<div class="inline field">
+ <div class="ui checkbox">
+ <label class="poping up" data-content="{{.i18n.Tr "install.default_enable_timetracking_popup"}}"><strong>{{.i18n.Tr "install.default_enable_timetracking"}}</strong></label>
+ <input name="default_enable_timetracking" type="checkbox" {{if .default_enable_timetracking}}checked{{end}}>
+ </div>
+ </div>
+ <div class="inline field">
<label for="no_reply_address">{{.i18n.Tr "install.no_reply_address"}}</label>
<input id="_no_reply_address" name="no_reply_address" value="{{.no_reply_address}}">
<span class="help">{{.i18n.Tr "install.no_reply_address_helper"}}</span>
diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl
index c1b4e7f599..34609ceb31 100644
--- a/templates/repo/issue/view_content/comments.tmpl
+++ b/templates/repo/issue/view_content/comments.tmpl
@@ -1,7 +1,7 @@
{{range .Issue.Comments}}
{{ $createdStr:= TimeSince .Created $.Lang }}
- <!-- 0 = COMMENT, 1 = REOPEN, 2 = CLOSE, 3 = ISSUE_REF, 4 = COMMIT_REF, 5 = COMMENT_REF, 6 = PULL_REF, 7 = COMMENT_LABEL -->
+ <!-- 0 = COMMENT, 1 = REOPEN, 2 = CLOSE, 3 = ISSUE_REF, 4 = COMMIT_REF, 5 = COMMENT_REF, 6 = PULL_REF, 7 = COMMENT_LABEL, 12 = START_TRACKING, 13 = STOP_TRACKING, 14 = ADD_TIME_MANUAL -->
{{if eq .Type 0}}
<div class="comment" id="{{.HashTag}}">
<a class="avatar" {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}>
@@ -58,6 +58,7 @@
{{end}}
</div>
</div>
+
{{else if eq .Type 1}}
<div class="event">
<span class="octicon octicon-primitive-dot"></span>
@@ -140,5 +141,46 @@
<span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a>
{{$.i18n.Tr "repo.issues.delete_branch_at" .CommitSHA $createdStr | Safe}}
</span>
+ {{else if eq .Type 12}}
+ <div class="event">
+ <span class="octicon octicon-primitive-dot"></span>
+ <a class="ui avatar image" href="{{.Poster.HomeLink}}">
+ <img src="{{.Poster.RelAvatarLink}}">
+ </a>
+ <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a> {{$.i18n.Tr "repo.issues.start_tracking_history" $createdStr | Safe}}</span>
+ </div>
+ {{else if eq .Type 13}}
+ <div class="event">
+ <span class="octicon octicon-primitive-dot"></span>
+ <a class="ui avatar image" href="{{.Poster.HomeLink}}">
+ <img src="{{.Poster.RelAvatarLink}}">
+ </a>
+ <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a> {{$.i18n.Tr "repo.issues.stop_tracking_history" $createdStr | Safe}}</span>
+
+ <div class="detail">
+ <span class="octicon octicon-clock"></span>
+ <span class="text grey">{{.Content}}</span>
+ </div>
+ </div>
+ {{else if eq .Type 14}}
+ <div class="event">
+ <span class="octicon octicon-primitive-dot"></span>
+ <a class="ui avatar image" href="{{.Poster.HomeLink}}">
+ <img src="{{.Poster.RelAvatarLink}}">
+ </a>
+ <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a> {{$.i18n.Tr "repo.issues.add_time_history" $createdStr | Safe}}</span>
+ <div class="detail">
+ <span class="octicon octicon-clock"></span>
+ <span class="text grey">{{.Content}}</span>
+ </div>
+ </div>
+ {{else if eq .Type 15}}
+ <div class="event">
+ <span class="octicon octicon-primitive-dot"></span>
+ <a class="ui avatar image" href="{{.Poster.HomeLink}}">
+ <img src="{{.Poster.RelAvatarLink}}">
+ </a>
+ <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a> {{$.i18n.Tr "repo.issues.cancel_tracking_history" $createdStr | Safe}}</span>
+ </div>
{{end}}
{{end}}
diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl
index 2c6149ed29..079c6f52ab 100644
--- a/templates/repo/issue/view_content/sidebar.tmpl
+++ b/templates/repo/issue/view_content/sidebar.tmpl
@@ -102,26 +102,93 @@
</div>
{{if $.IssueWatch}}
- <div class="ui divider"></div>
+ <div class="ui divider"></div>
- <div class="ui watching">
- <span class="text"><strong>{{.i18n.Tr "notification.notifications"}}</strong></span>
- <div>
- <form method="POST" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/watch">
- <input type="hidden" name="watch" value="{{if $.IssueWatch.IsWatching}}0{{else}}1{{end}}" />
- {{$.CsrfTokenHtml}}
- <button class="fluid ui button">
- {{if $.IssueWatch.IsWatching}}
- <i class="octicon octicon-mute"></i>
- {{.i18n.Tr "repo.issues.unsubscribe"}}
+ <div class="ui watching">
+ <span class="text"><strong>{{.i18n.Tr "notification.notifications"}}</strong></span>
+ <div>
+ <form method="POST" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/watch">
+ <input type="hidden" name="watch" value="{{if $.IssueWatch.IsWatching}}0{{else}}1{{end}}" />
+ {{$.CsrfTokenHtml}}
+ <button class="fluid ui button">
+ {{if $.IssueWatch.IsWatching}}
+ <i class="octicon octicon-mute"></i>
+ {{.i18n.Tr "repo.issues.unsubscribe"}}
+ {{else}}
+ <i class="octicon octicon-unmute"></i>
+ {{.i18n.Tr "repo.issues.subscribe"}}
+ {{end}}
+ </button>
+ </form>
+ </div>
+ </div>
+ {{end}}
+ {{if .Repository.IsTimetrackerEnabled }}
+ {{if .CanUseTimetracker }}
+ <div class="ui divider"></div>
+ <div class="ui timetrack">
+ <span class="text"><strong>{{.i18n.Tr "repo.issues.tracker"}}</strong></span>
+ <div>
+ <form method="POST" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/times/stopwatch/toggle" id="toggle_stopwatch_form">
+ {{$.CsrfTokenHtml}}
+ </form>
+ <form method="POST" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/times/stopwatch/cancel" id="cancel_stopwatch_form">
+ {{$.CsrfTokenHtml}}
+ </form>
+ {{if $.IsStopwatchRunning}}
+ <div class="ui buttons fluid stop-cancel">
+ <button onclick="this.disabled=true;toggleStopwatch()" class="ui button stop">{{.i18n.Tr "repo.issues.stop_tracking"}}</button>
+ <button onclick="this.disabled=true;cancelStopwatch()" class="ui negative button cancel">{{.i18n.Tr "repo.issues.cancel_tracking"}}</button>
+ </div>
{{else}}
- <i class="octicon octicon-unmute"></i>
- {{.i18n.Tr "repo.issues.subscribe"}}
+ {{if .HasUserStopwatch}}
+ <div class="ui warning message">
+ {{.i18n.Tr "repo.issues.tracking_already_started" .OtherStopwatchURL | Safe}}
+ </div>
+ {{end}}
+ <div class="ui buttons two fluid start-add">
+ <button onclick="this.disabled=true;toggleStopwatch()" class="ui button poping up start" data-content='{{.i18n.Tr "repo.issues.start_tracking"}}' data-position="top center" data-variation="small inverted">{{.i18n.Tr "repo.issues.start_tracking_short"}}</button>
+ <button onclick="timeAddManual()" class="ui button green poping up add-time" data-content='{{.i18n.Tr "repo.issues.add_time"}}' data-position="top center" data-variation="small inverted">{{.i18n.Tr "repo.issues.add_time_short"}}</button>
+ <div class="ui mini modal">
+ <div class="header">{{.i18n.Tr "repo.issues.add_time"}}</div>
+ <div class="content">
+ <form method="POST" id="add_time_manual_form" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/times/add" class="ui action input fluid">
+ {{$.CsrfTokenHtml}}
+ <input placeholder='{{.i18n.Tr "repo.issues.add_time_hours"}}' type="number" name="hours">
+ <input placeholder='{{.i18n.Tr "repo.issues.add_time_minutes"}}' type="number" name="minutes" class="ui compact">
+ </form>
+ </div>
+ <div class="actions">
+ <div class="ui green approve button">{{.i18n.Tr "repo.issues.add_time_short"}}</div>
+ <div class="ui red cancel button">{{.i18n.Tr "repo.issues.add_time_cancel"}}</div>
+ </div>
+ </div>
+ </div>
{{end}}
- </button>
- </form>
- </div>
- </div>
+ </div>
+ </div>
+ {{end}}
+ {{if gt (len .WorkingUsers) 0}}
+ <div class="ui divider"></div>
+ <div class="ui participants comments">
+ <span class="text"><strong>{{.i18n.Tr "repo.issues.time_spent_total"}}</strong></span>
+ <div>
+ {{range $user, $trackedtime := .WorkingUsers}}
+ <div class="comment">
+ <a class="avatar">
+ <img src="{{$user.RelAvatarLink}}">
+ </a>
+ <div class="content">
+ <a class="author">{{$user.DisplayName}}</a>
+ <div class="text">
+ {{$trackedtime}}
+ </div>
+ </div>
+ </div>
+ {{end}}
+ </div>
+ </div>
+ {{end}}
{{end}}
</div>
</div>
diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl
index 8a7ea218bc..b2b7fc9c3a 100644
--- a/templates/repo/settings/options.tmpl
+++ b/templates/repo/settings/options.tmpl
@@ -134,13 +134,28 @@
<div class="field {{if not $isIssuesEnabled}}disabled{{end}}" id="issue_box">
<div class="field">
<div class="ui radio checkbox">
- <input class="hidden enable-system-radio" tabindex="0" name="enable_external_tracker" type="radio" value="false" data-target="#external_issue_box" {{if not (.Repository.UnitEnabled $.UnitTypeExternalTracker)}}checked{{end}}/>
+ <input class="hidden enable-system-radio" tabindex="0" name="enable_external_tracker" type="radio" value="false" data-context="#internal_issue_box" data-target="#external_issue_box" {{if not (.Repository.UnitEnabled $.UnitTypeExternalTracker)}}checked{{end}}/>
<label>{{.i18n.Tr "repo.settings.use_internal_issue_tracker"}}</label>
</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>
+ </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>
+ </div>
+ </div>
<div class="field">
<div class="ui radio checkbox">
- <input class="hidden enable-system-radio" tabindex="0" name="enable_external_tracker" type="radio" value="true" data-target="#external_issue_box" {{if .Repository.UnitEnabled $.UnitTypeExternalTracker}}checked{{end}}/>
+ <input class="hidden enable-system-radio" tabindex="0" name="enable_external_tracker" type="radio" value="true" data-context="#internal_issue_box" data-target="#external_issue_box" {{if .Repository.UnitEnabled $.UnitTypeExternalTracker}}checked{{end}}/>
<label>{{.i18n.Tr "repo.settings.use_external_issue_tracker"}}</label>
</div>
</div>