diff options
author | Adam Strzelecki <ono@java.pl> | 2015-12-07 23:30:52 +0100 |
---|---|---|
committer | Adam Strzelecki <ono@java.pl> | 2015-12-08 00:57:46 +0100 |
commit | da2585c11e11023ffa7a8c69d21c6fecac520a8e (patch) | |
tree | 1c2a575dfc00e0e78f47c497a6d9347b3edeca9a /templates/repo/settings | |
parent | dd8a06a397e26c46639eba1313102560dfa49c95 (diff) | |
download | gitea-da2585c11e11023ffa7a8c69d21c6fecac520a8e.tar.gz gitea-da2585c11e11023ffa7a8c69d21c6fecac520a8e.zip |
Indent all templates with tabs
This commit improves templates readability, since all of them use consistent
indent with all template command blocks indented too.
1. Indents both HTML containers such as <div>, <p> and Go HTML template blocks
such as {{if}} {{with}}
2. Cleans all trailing white-space
3. Adds trailing last line-break to each file
Diffstat (limited to 'templates/repo/settings')
-rw-r--r-- | templates/repo/settings/collaboration.tmpl | 60 | ||||
-rw-r--r-- | templates/repo/settings/deploy_keys.tmpl | 94 | ||||
-rw-r--r-- | templates/repo/settings/githook_edit.tmpl | 40 | ||||
-rw-r--r-- | templates/repo/settings/githooks.tmpl | 30 | ||||
-rw-r--r-- | templates/repo/settings/hook_delete_modal.tmpl | 36 | ||||
-rw-r--r-- | templates/repo/settings/hook_gogs.tmpl | 52 | ||||
-rw-r--r-- | templates/repo/settings/hook_history.tmpl | 128 | ||||
-rw-r--r-- | templates/repo/settings/hook_list.tmpl | 70 | ||||
-rw-r--r-- | templates/repo/settings/hook_new.tmpl | 24 | ||||
-rw-r--r-- | templates/repo/settings/hook_settings.tmpl | 102 | ||||
-rw-r--r-- | templates/repo/settings/hook_slack.tmpl | 50 | ||||
-rw-r--r-- | templates/repo/settings/hooks.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/settings/nav.tmpl | 26 | ||||
-rw-r--r-- | templates/repo/settings/navbar.tmpl | 34 | ||||
-rw-r--r-- | templates/repo/settings/options.tmpl | 316 |
15 files changed, 533 insertions, 533 deletions
diff --git a/templates/repo/settings/collaboration.tmpl b/templates/repo/settings/collaboration.tmpl index 651c453cd5..57b76fd8bf 100644 --- a/templates/repo/settings/collaboration.tmpl +++ b/templates/repo/settings/collaboration.tmpl @@ -7,37 +7,37 @@ <div class="twelve wide column content"> {{template "base/alert" .}} <h4 class="ui top attached header"> - {{.i18n.Tr "repo.settings.collaboration"}} + {{.i18n.Tr "repo.settings.collaboration"}} </h4> <div class="ui attached segment collaborator list"> - {{range .Collaborators}} - <div class="item"> - {{if not (eq .Id $.Owner.Id)}} - <a href="{{$.RepoLink}}/settings/collaboration?remove={{.Name}}" class="ui right text red"><i class="fa fa-times"></i></a> - {{end}} - <a href="{{AppSubUrl}}/{{.Name}}"> - <img class="ui avatar image" src="{{.AvatarLink}}"> - {{.DisplayName}} - </a> - </div> - {{end}} - </div> - <div class="ui bottom attached segment"> - <form class="ui form" id="repo-collab-form" action="{{.Link}}" method="post"> - {{.CsrfTokenHtml}} - <div class="inline field ui left"> - <div id="search-user-box"> - <div class="ui input"> - <input class="prompt" name="collaborator" placeholder="{{.i18n.Tr "repo.settings.search_user_placeholder"}}" autocomplete="off" required> - </div> - <div class="ui segment results hide"></div> - </div> - </div> - <button class="ui green button">{{.i18n.Tr "repo.settings.add_collaborator"}}</button> - </form> - </div> - </div> - </div> + {{range .Collaborators}} + <div class="item"> + {{if not (eq .Id $.Owner.Id)}} + <a href="{{$.RepoLink}}/settings/collaboration?remove={{.Name}}" class="ui right text red"><i class="fa fa-times"></i></a> + {{end}} + <a href="{{AppSubUrl}}/{{.Name}}"> + <img class="ui avatar image" src="{{.AvatarLink}}"> + {{.DisplayName}} + </a> + </div> + {{end}} + </div> + <div class="ui bottom attached segment"> + <form class="ui form" id="repo-collab-form" action="{{.Link}}" method="post"> + {{.CsrfTokenHtml}} + <div class="inline field ui left"> + <div id="search-user-box"> + <div class="ui input"> + <input class="prompt" name="collaborator" placeholder="{{.i18n.Tr "repo.settings.search_user_placeholder"}}" autocomplete="off" required> + </div> + <div class="ui segment results hide"></div> + </div> + </div> + <button class="ui green button">{{.i18n.Tr "repo.settings.add_collaborator"}}</button> + </form> + </div> + </div> + </div> </div> </div> -{{template "base/footer" .}}
\ No newline at end of file +{{template "base/footer" .}} diff --git a/templates/repo/settings/deploy_keys.tmpl b/templates/repo/settings/deploy_keys.tmpl index 5406d0433d..1f6b26a6da 100644 --- a/templates/repo/settings/deploy_keys.tmpl +++ b/templates/repo/settings/deploy_keys.tmpl @@ -7,41 +7,41 @@ <div class="twelve wide column content"> {{template "base/alert" .}} <h4 class="ui top attached header"> - {{.i18n.Tr "repo.settings.deploy_keys"}} - <div class="ui right"> - <div class="ui blue tiny show-panel button" data-panel="#add-deploy-key-panel">{{.i18n.Tr "repo.settings.add_deploy_key"}}</div> - </div> + {{.i18n.Tr "repo.settings.deploy_keys"}} + <div class="ui right"> + <div class="ui blue tiny show-panel button" data-panel="#add-deploy-key-panel">{{.i18n.Tr "repo.settings.add_deploy_key"}}</div> + </div> </h4> <div class="ui attached segment"> {{if .Deploykeys}} - <div class="ui key list"> - {{range .Deploykeys}} - <div class="item ui grid"> - <div class="one wide column"> - <i class="ssh-key-state-indicator fa fa-circle{{if .HasRecentActivity}} active invert poping up{{else}}-o{{end}}" {{if .HasRecentActivity}}data-content="{{$.i18n.Tr "settings.key_state_desc"}}" data-variation="inverted"{{end}}></i> - </div> - <div class="one wide column"> - <i class="mega-octicon octicon-key left"></i> - </div> - <div class="eleven wide column"> - <strong>{{.Name}}</strong> - <div class="print meta"> - {{.Fingerprint}} + <div class="ui key list"> + {{range .Deploykeys}} + <div class="item ui grid"> + <div class="one wide column"> + <i class="ssh-key-state-indicator fa fa-circle{{if .HasRecentActivity}} active invert poping up{{else}}-o{{end}}" {{if .HasRecentActivity}}data-content="{{$.i18n.Tr "settings.key_state_desc"}}" data-variation="inverted"{{end}}></i> + </div> + <div class="one wide column"> + <i class="mega-octicon octicon-key left"></i> + </div> + <div class="eleven wide column"> + <strong>{{.Name}}</strong> + <div class="print meta"> + {{.Fingerprint}} + </div> + <div class="activity meta"> + <i>{{$.i18n.Tr "settings.add_on"}} <span>{{DateFmtShort .Created}}</span> — <i class="octicon octicon-info"></i> {{if .HasUsed}}{{$.i18n.Tr "settings.last_used"}} <span>{{DateFmtShort .Updated}}</span>{{else}}{{$.i18n.Tr "settings.no_activity"}}{{end}}</i> + </div> + </div> + <div class="two wide column"> + <button class="ui red tiny button delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}"> + {{$.i18n.Tr "settings.delete_key"}} + </button> + </div> </div> - <div class="activity meta"> - <i>{{$.i18n.Tr "settings.add_on"}} <span>{{DateFmtShort .Created}}</span> — <i class="octicon octicon-info"></i> {{if .HasUsed}}{{$.i18n.Tr "settings.last_used"}} <span>{{DateFmtShort .Updated}}</span>{{else}}{{$.i18n.Tr "settings.no_activity"}}{{end}}</i> - </div> - </div> - <div class="two wide column"> - <button class="ui red tiny button delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}"> - {{$.i18n.Tr "settings.delete_key"}} - </button> - </div> + {{end}} </div> - {{end}} - </div> {{else}} - {{.i18n.Tr "repo.settings.no_deploy_keys"}} + {{.i18n.Tr "repo.settings.no_deploy_keys"}} {{end}} </div> <br> @@ -75,22 +75,22 @@ </div> <div class="ui small basic delete modal"> - <div class="ui icon header"> - <i class="trash icon"></i> - {{.i18n.Tr "repo.settings.deploy_key_deletion"}} - </div> - <div class="content"> - <p>{{.i18n.Tr "repo.settings.deploy_key_deletion_desc"}}</p> - </div> - <div class="actions"> - <div class="ui red basic inverted cancel button"> - <i class="remove icon"></i> - {{.i18n.Tr "modal.no"}} - </div> - <div class="ui green basic inverted ok button"> - <i class="checkmark icon"></i> - {{.i18n.Tr "modal.yes"}} - </div> - </div> + <div class="ui icon header"> + <i class="trash icon"></i> + {{.i18n.Tr "repo.settings.deploy_key_deletion"}} + </div> + <div class="content"> + <p>{{.i18n.Tr "repo.settings.deploy_key_deletion_desc"}}</p> + </div> + <div class="actions"> + <div class="ui red basic inverted cancel button"> + <i class="remove icon"></i> + {{.i18n.Tr "modal.no"}} + </div> + <div class="ui green basic inverted ok button"> + <i class="checkmark icon"></i> + {{.i18n.Tr "modal.yes"}} + </div> + </div> </div> -{{template "base/footer" .}}
\ No newline at end of file +{{template "base/footer" .}} diff --git a/templates/repo/settings/githook_edit.tmpl b/templates/repo/settings/githook_edit.tmpl index b9b75a3aa6..22c278fe4f 100644 --- a/templates/repo/settings/githook_edit.tmpl +++ b/templates/repo/settings/githook_edit.tmpl @@ -7,30 +7,30 @@ <div class="twelve wide column content"> {{template "base/alert" .}} <h4 class="ui top attached header"> - {{.i18n.Tr "repo.settings.githooks"}} + {{.i18n.Tr "repo.settings.githooks"}} </h4> <div class="ui attached segment"> <p>{{.i18n.Tr "repo.settings.githook_edit_desc"}}</p> - <form class="ui form" action="{{.Link}}" method="post"> - {{.CsrfTokenHtml}} - {{with .Hook}} - <div class="inline field"> - <label>{{$.i18n.Tr "repo.settings.githook_name"}}</label> - <span>{{.Name}}</span> - </div> - <div class="field"> - <label for="content">{{$.i18n.Tr "repo.settings.githook_content"}}</label> - <textarea id="content" name="content" rows="20" wrap="off">{{if .IsActive}}{{.Content}}{{else}}{{.Sample}}{{end}}</textarea> - </div> + <form class="ui form" action="{{.Link}}" method="post"> + {{.CsrfTokenHtml}} + {{with .Hook}} + <div class="inline field"> + <label>{{$.i18n.Tr "repo.settings.githook_name"}}</label> + <span>{{.Name}}</span> + </div> + <div class="field"> + <label for="content">{{$.i18n.Tr "repo.settings.githook_content"}}</label> + <textarea id="content" name="content" rows="20" wrap="off">{{if .IsActive}}{{.Content}}{{else}}{{.Sample}}{{end}}</textarea> + </div> - <div class="inline field"> - <button class="ui green button">{{$.i18n.Tr "repo.settings.update_githook"}}</button> - </div> - {{end}} - </form> + <div class="inline field"> + <button class="ui green button">{{$.i18n.Tr "repo.settings.update_githook"}}</button> + </div> + {{end}} + </form> </div> - </div> - </div> + </div> + </div> </div> </div> -{{template "base/footer" .}}
\ No newline at end of file +{{template "base/footer" .}} diff --git a/templates/repo/settings/githooks.tmpl b/templates/repo/settings/githooks.tmpl index 8120b80e17..8d8923b475 100644 --- a/templates/repo/settings/githooks.tmpl +++ b/templates/repo/settings/githooks.tmpl @@ -7,24 +7,24 @@ <div class="twelve wide column content"> {{template "base/alert" .}} <h4 class="ui top attached header"> - {{.i18n.Tr "repo.settings.githooks"}} + {{.i18n.Tr "repo.settings.githooks"}} </h4> <div class="ui attached table segment"> - <div class="ui hook list"> - <div class="item"> - {{.i18n.Tr "repo.settings.githooks_desc" | Str2html}} - </div> - {{range .Hooks}} + <div class="ui hook list"> <div class="item"> - <span class="text {{if .IsActive}}green{{else}}grey{{end}}"><i class="octicon octicon-primitive-dot"></i></span> - <span>{{.Name}}</span> - <a class="text blue ui right" href="{{$.RepoLink}}/settings/hooks/git/{{.Name}}"><i class="fa fa-pencil"></i></a> + {{.i18n.Tr "repo.settings.githooks_desc" | Str2html}} </div> - {{end}} - </div> - </div> - </div> - </div> + {{range .Hooks}} + <div class="item"> + <span class="text {{if .IsActive}}green{{else}}grey{{end}}"><i class="octicon octicon-primitive-dot"></i></span> + <span>{{.Name}}</span> + <a class="text blue ui right" href="{{$.RepoLink}}/settings/hooks/git/{{.Name}}"><i class="fa fa-pencil"></i></a> + </div> + {{end}} + </div> + </div> + </div> + </div> </div> </div> -{{template "base/footer" .}}
\ No newline at end of file +{{template "base/footer" .}} diff --git a/templates/repo/settings/hook_delete_modal.tmpl b/templates/repo/settings/hook_delete_modal.tmpl index bafd1ce93c..2a2a7c8da2 100644 --- a/templates/repo/settings/hook_delete_modal.tmpl +++ b/templates/repo/settings/hook_delete_modal.tmpl @@ -1,19 +1,19 @@ <div class="ui small basic delete modal"> - <div class="ui icon header"> - <i class="trash icon"></i> - {{.i18n.Tr "repo.settings.webhook_deletion"}} - </div> - <div class="content"> - <p>{{.i18n.Tr "repo.settings.webhook_deletion_desc"}}</p> - </div> - <div class="actions"> - <div class="ui red basic inverted cancel button"> - <i class="remove icon"></i> - {{.i18n.Tr "modal.no"}} - </div> - <div class="ui green basic inverted ok button"> - <i class="checkmark icon"></i> - {{.i18n.Tr "modal.yes"}} - </div> - </div> -</div>
\ No newline at end of file + <div class="ui icon header"> + <i class="trash icon"></i> + {{.i18n.Tr "repo.settings.webhook_deletion"}} + </div> + <div class="content"> + <p>{{.i18n.Tr "repo.settings.webhook_deletion_desc"}}</p> + </div> + <div class="actions"> + <div class="ui red basic inverted cancel button"> + <i class="remove icon"></i> + {{.i18n.Tr "modal.no"}} + </div> + <div class="ui green basic inverted ok button"> + <i class="checkmark icon"></i> + {{.i18n.Tr "modal.yes"}} + </div> + </div> +</div> diff --git a/templates/repo/settings/hook_gogs.tmpl b/templates/repo/settings/hook_gogs.tmpl index b0b3311a55..633577d8a9 100644 --- a/templates/repo/settings/hook_gogs.tmpl +++ b/templates/repo/settings/hook_gogs.tmpl @@ -1,28 +1,28 @@ {{if eq .HookType "gogs"}} -<p>{{.i18n.Tr "repo.settings.add_webhook_desc" "http://gogs.io/docs/features/webhook.html" | Str2html}}</p> -<form class="ui form" action="{{.BaseLink}}/settings/hooks/gogs/{{if .PageIsSettingsHooksNew}}new{{else}}{{.Webhook.ID}}{{end}}" method="post"> - {{.CsrfTokenHtml}} - <div class="required field {{if .Err_PayloadURL}}error{{end}}"> - <label for="payload_url">{{.i18n.Tr "repo.settings.payload_url"}}</label> - <input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required> - </div> - <div class="field"> - <label>{{.i18n.Tr "repo.settings.content_type"}}</label> - <div class="ui selection dropdown"> - <input type="hidden" id="content_type" name="content_type" value="{{if .Webhook.ContentType}}{{.Webhook.ContentType}}{{else}}application/json{{end}}"> - <div class="default text"></div> - <i class="dropdown icon"></i> - <div class="menu"> - <div class="item" data-value="1">application/json</div> - <div class="item" data-value="2">application/x-www-form-urlencoded</div> - </div> - </div> - </div> - <input class="fake" type="password"> - <div class="field {{if .Err_Secret}}error{{end}}"> - <label for="secret">{{.i18n.Tr "repo.settings.secret"}}</label> - <input id="secret" name="secret" type="password" value="{{.Webhook.Secret}}" autocomplete="off"> - </div> - {{template "repo/settings/hook_settings" .}} -</form> + <p>{{.i18n.Tr "repo.settings.add_webhook_desc" "http://gogs.io/docs/features/webhook.html" | Str2html}}</p> + <form class="ui form" action="{{.BaseLink}}/settings/hooks/gogs/{{if .PageIsSettingsHooksNew}}new{{else}}{{.Webhook.ID}}{{end}}" method="post"> + {{.CsrfTokenHtml}} + <div class="required field {{if .Err_PayloadURL}}error{{end}}"> + <label for="payload_url">{{.i18n.Tr "repo.settings.payload_url"}}</label> + <input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required> + </div> + <div class="field"> + <label>{{.i18n.Tr "repo.settings.content_type"}}</label> + <div class="ui selection dropdown"> + <input type="hidden" id="content_type" name="content_type" value="{{if .Webhook.ContentType}}{{.Webhook.ContentType}}{{else}}application/json{{end}}"> + <div class="default text"></div> + <i class="dropdown icon"></i> + <div class="menu"> + <div class="item" data-value="1">application/json</div> + <div class="item" data-value="2">application/x-www-form-urlencoded</div> + </div> + </div> + </div> + <input class="fake" type="password"> + <div class="field {{if .Err_Secret}}error{{end}}"> + <label for="secret">{{.i18n.Tr "repo.settings.secret"}}</label> + <input id="secret" name="secret" type="password" value="{{.Webhook.Secret}}" autocomplete="off"> + </div> + {{template "repo/settings/hook_settings" .}} + </form> {{end}} diff --git a/templates/repo/settings/hook_history.tmpl b/templates/repo/settings/hook_history.tmpl index 15957a6790..9ded6a7905 100644 --- a/templates/repo/settings/hook_history.tmpl +++ b/templates/repo/settings/hook_history.tmpl @@ -1,73 +1,73 @@ {{if .PageIsSettingsHooksEdit}} -<h4 class="ui top attached header"> - {{.i18n.Tr "repo.settings.recent_deliveries"}} - {{if .IsRepositoryAdmin}} - <div class="ui right"> - <button class="ui teal tiny button poping up" id="test-delivery" data-content= - "{{.i18n.Tr "repo.settings.webhook.test_delivery_desc"}}" data-variation="inverted tiny" data-link="{{.Link}}/test" data-redirect="{{.Link}}">{{.i18n.Tr "repo.settings.webhook.test_delivery"}}</button> - </div> - {{end}} -</h4> -<div class="ui attached table segment"> - <div class="ui hook history list"> - {{range .History}} - <div class="item"> - <div class="meta"> - {{if .IsSucceed}} - <span class="text green"><i class="octicon octicon-check"></i></span> - {{else}} - <span class="text red"><i class="octicon octicon-alert"></i></span> - {{end}} - <a class="ui blue sha label toggle button" data-target="#info-{{.ID}}">{{.UUID}}</a> - <div class="ui right"> - <span class="text grey time"> - {{.DeliveredString}} - </span> - </div> + <h4 class="ui top attached header"> + {{.i18n.Tr "repo.settings.recent_deliveries"}} + {{if .IsRepositoryAdmin}} + <div class="ui right"> + <button class="ui teal tiny button poping up" id="test-delivery" data-content= + "{{.i18n.Tr "repo.settings.webhook.test_delivery_desc"}}" data-variation="inverted tiny" data-link="{{.Link}}/test" data-redirect="{{.Link}}">{{.i18n.Tr "repo.settings.webhook.test_delivery"}}</button> </div> - <div class="info hide" id="info-{{.ID}}"> - <div class="ui top attached tabular menu"> - <a class="item active" data-tab="request-{{.ID}}">{{$.i18n.Tr "repo.settings.webhook.request"}}</a> - <a class="item" data-tab="response-{{.ID}}"> - {{$.i18n.Tr "repo.settings.webhook.response"}} - {{if .ResponseInfo}} - {{if .IsSucceed}} - <span class="ui green label">{{.ResponseInfo.Status}}</span> - {{else}} - <span class="ui red label">{{.ResponseInfo.Status}}</span> - {{end}} - {{else}} - <span class="ui label">N/A</span> - {{end}} - </a> - </div> - <div class="ui bottom attached tab segment active" data-tab="request-{{.ID}}"> - {{if .RequestInfo}} - <h5>{{$.i18n.Tr "repo.settings.webhook.headers"}}</h5> - <pre class="raw"><strong>Request URL:</strong> {{.URL}} + {{end}} + </h4> + <div class="ui attached table segment"> + <div class="ui hook history list"> + {{range .History}} + <div class="item"> + <div class="meta"> + {{if .IsSucceed}} + <span class="text green"><i class="octicon octicon-check"></i></span> + {{else}} + <span class="text red"><i class="octicon octicon-alert"></i></span> + {{end}} + <a class="ui blue sha label toggle button" data-target="#info-{{.ID}}">{{.UUID}}</a> + <div class="ui right"> + <span class="text grey time"> + {{.DeliveredString}} + </span> + </div> + </div> + <div class="info hide" id="info-{{.ID}}"> + <div class="ui top attached tabular menu"> + <a class="item active" data-tab="request-{{.ID}}">{{$.i18n.Tr "repo.settings.webhook.request"}}</a> + <a class="item" data-tab="response-{{.ID}}"> + {{$.i18n.Tr "repo.settings.webhook.response"}} + {{if .ResponseInfo}} + {{if .IsSucceed}} + <span class="ui green label">{{.ResponseInfo.Status}}</span> + {{else}} + <span class="ui red label">{{.ResponseInfo.Status}}</span> + {{end}} + {{else}} + <span class="ui label">N/A</span> + {{end}} + </a> + </div> + <div class="ui bottom attached tab segment active" data-tab="request-{{.ID}}"> + {{if .RequestInfo}} + <h5>{{$.i18n.Tr "repo.settings.webhook.headers"}}</h5> + <pre class="raw"><strong>Request URL:</strong> {{.URL}} <strong>Request method:</strong> POST {{ range $key, $val := .RequestInfo.Headers }}<strong>{{$key}}:</strong> {{$val}} {{end}}</pre> - <h5>{{$.i18n.Tr "repo.settings.webhook.payload"}}</h5> - <pre class="raw"><code class="json">{{.PayloadContent}}</code></pre> - {{else}} - N/A - {{end}} - </div> - <div class="ui bottom attached tab segment" data-tab="response-{{.ID}}"> - {{if .ResponseInfo}} - <h5>{{$.i18n.Tr "repo.settings.webhook.headers"}}</h5> - <pre class="raw">{{ range $key, $val := .ResponseInfo.Headers }}<strong>{{$key}}:</strong> {{$val}} + <h5>{{$.i18n.Tr "repo.settings.webhook.payload"}}</h5> + <pre class="raw"><code class="json">{{.PayloadContent}}</code></pre> + {{else}} + N/A + {{end}} + </div> + <div class="ui bottom attached tab segment" data-tab="response-{{.ID}}"> + {{if .ResponseInfo}} + <h5>{{$.i18n.Tr "repo.settings.webhook.headers"}}</h5> + <pre class="raw">{{ range $key, $val := .ResponseInfo.Headers }}<strong>{{$key}}:</strong> {{$val}} {{end}}</pre> - <h5>{{$.i18n.Tr "repo.settings.webhook.body"}}</h5> - <pre class="raw"><code>{{.ResponseInfo.Body}}</code></pre> - {{else}} - N/A - {{end}} + <h5>{{$.i18n.Tr "repo.settings.webhook.body"}}</h5> + <pre class="raw"><code>{{.ResponseInfo.Body}}</code></pre> + {{else}} + N/A + {{end}} + </div> + </div> </div> - </div> + {{end}} </div> - {{end}} </div> -</div> -{{end}}
\ No newline at end of file +{{end}} diff --git a/templates/repo/settings/hook_list.tmpl b/templates/repo/settings/hook_list.tmpl index b5c086bb84..471d9f9bf1 100644 --- a/templates/repo/settings/hook_list.tmpl +++ b/templates/repo/settings/hook_list.tmpl @@ -1,44 +1,44 @@ <div class="twelve wide column content"> {{template "base/alert" .}} <h4 class="ui top attached header"> - {{.i18n.Tr "repo.settings.hooks"}} - <div class="ui right"> - <div class="ui floating1 jump dropdown"> - <div class="ui blue tiny button">{{.i18n.Tr "repo.settings.add_webhook"}}</div> - <div class="menu"> - <a class="item" href="{{.BaseLink}}/settings/hooks/gogs/new"> - <img class="img-10" src="{{AppSubUrl}}/img/favicon.png">Gogs - </a> - <a class="item" href="{{.BaseLink}}/settings/hooks/slack/new"> - <img class="img-10" src="{{AppSubUrl}}/img/slack.png">Slack - </a> - </div> - </div> - </div> + {{.i18n.Tr "repo.settings.hooks"}} + <div class="ui right"> + <div class="ui floating1 jump dropdown"> + <div class="ui blue tiny button">{{.i18n.Tr "repo.settings.add_webhook"}}</div> + <div class="menu"> + <a class="item" href="{{.BaseLink}}/settings/hooks/gogs/new"> + <img class="img-10" src="{{AppSubUrl}}/img/favicon.png">Gogs + </a> + <a class="item" href="{{.BaseLink}}/settings/hooks/slack/new"> + <img class="img-10" src="{{AppSubUrl}}/img/slack.png">Slack + </a> + </div> + </div> + </div> </h4> <div class="ui attached table segment"> - <div class="ui hook list"> - <div class="item"> - {{.Description | Str2html}} - </div> - {{range .Webhooks}} + <div class="ui hook list"> <div class="item"> - {{if eq .LastStatus 1}} - <span class="text green"><i class="octicon octicon-check"></i></span> - {{else if eq .LastStatus 2}} - <span class="text red"><i class="octicon octicon-alert"></i></span> - {{else}} - <span class="text grey"><i class="octicon octicon-primitive-dot"></i></span> - {{end}} - <a href="{{$.BaseLink}}/settings/hooks/{{.ID}}">{{.URL}}</a> - <div class="ui right"> - <span class="text blue"><a href="{{$.BaseLink}}/settings/hooks/{{.ID}}"><i class="fa fa-pencil"></i></a></span> - <span class="text red"><a class="delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}"><i class="fa fa-times"></i></a></span> - </div> + {{.Description | Str2html}} </div> - {{end}} - </div> - </div> + {{range .Webhooks}} + <div class="item"> + {{if eq .LastStatus 1}} + <span class="text green"><i class="octicon octicon-check"></i></span> + {{else if eq .LastStatus 2}} + <span class="text red"><i class="octicon octicon-alert"></i></span> + {{else}} + <span class="text grey"><i class="octicon octicon-primitive-dot"></i></span> + {{end}} + <a href="{{$.BaseLink}}/settings/hooks/{{.ID}}">{{.URL}}</a> + <div class="ui right"> + <span class="text blue"><a href="{{$.BaseLink}}/settings/hooks/{{.ID}}"><i class="fa fa-pencil"></i></a></span> + <span class="text red"><a class="delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}"><i class="fa fa-times"></i></a></span> + </div> + </div> + {{end}} + </div> + </div> </div> -{{template "repo/settings/hook_delete_modal" .}}
\ No newline at end of file +{{template "repo/settings/hook_delete_modal" .}} diff --git a/templates/repo/settings/hook_new.tmpl b/templates/repo/settings/hook_new.tmpl index 7c9a5de1f0..96123525bb 100644 --- a/templates/repo/settings/hook_new.tmpl +++ b/templates/repo/settings/hook_new.tmpl @@ -7,22 +7,22 @@ <div class="twelve wide column content"> {{template "base/alert" .}} <h4 class="ui top attached header"> - {{if .PageIsSettingsHooksNew}}{{.i18n.Tr "repo.settings.add_webhook"}}{{else}}{{.i18n.Tr "repo.settings.update_webhook"}}{{end}} - <div class="ui right"> - {{if eq .HookType "gogs"}} - <img class="img-13" src="{{AppSubUrl}}/img/favicon.png"> - {{else if eq .HookType "slack"}} - <img class="img-13" src="{{AppSubUrl}}/img/slack.png"> - {{end}} - </div> + {{if .PageIsSettingsHooksNew}}{{.i18n.Tr "repo.settings.add_webhook"}}{{else}}{{.i18n.Tr "repo.settings.update_webhook"}}{{end}} + <div class="ui right"> + {{if eq .HookType "gogs"}} + <img class="img-13" src="{{AppSubUrl}}/img/favicon.png"> + {{else if eq .HookType "slack"}} + <img class="img-13" src="{{AppSubUrl}}/img/slack.png"> + {{end}} + </div> </h4> <div class="ui attached segment"> - {{template "repo/settings/hook_gogs" .}} - {{template "repo/settings/hook_slack" .}} - </div> + {{template "repo/settings/hook_gogs" .}} + {{template "repo/settings/hook_slack" .}} + </div> {{template "repo/settings/hook_history" .}} - </div> + </div> </div> </div> </div> diff --git a/templates/repo/settings/hook_settings.tmpl b/templates/repo/settings/hook_settings.tmpl index 18a480e016..76d3ac2935 100644 --- a/templates/repo/settings/hook_settings.tmpl +++ b/templates/repo/settings/hook_settings.tmpl @@ -1,66 +1,66 @@ <div class="field"> - <h4>{{.i18n.Tr "repo.settings.event_desc"}}</h4> + <h4>{{.i18n.Tr "repo.settings.event_desc"}}</h4> <div class="grouped event type fields"> - <div class="field"> - <div class="ui radio non-events checkbox"> - <input class="hidden" name="events" type="radio" value="push_only" {{if or .PageIsSettingsHooksNew .Webhook.PushOnly}}checked{{end}}> - <label>{{.i18n.Tr "repo.settings.event_push_only" | Str2html}}</label> - </div> - </div> - <div class="field"> - <div class="ui radio non-events checkbox"> - <input class="hidden" name="events" type="radio" value="send_everything" {{if .Webhook.SendEverything}}checked{{end}}> - <label>{{.i18n.Tr "repo.settings.event_send_everything" | Str2html}}</label> - </div> - </div> - <div class="field"> - <div class="ui radio events checkbox"> - <input class="hidden" name="events" type="radio" value="choose_events" {{if .Webhook.ChooseEvents}}checked{{end}}> - <label>{{.i18n.Tr "repo.settings.event_choose" | Str2html}}</label> - </div> - </div> + <div class="field"> + <div class="ui radio non-events checkbox"> + <input class="hidden" name="events" type="radio" value="push_only" {{if or .PageIsSettingsHooksNew .Webhook.PushOnly}}checked{{end}}> + <label>{{.i18n.Tr "repo.settings.event_push_only" | Str2html}}</label> + </div> + </div> + <div class="field"> + <div class="ui radio non-events checkbox"> + <input class="hidden" name="events" type="radio" value="send_everything" {{if .Webhook.SendEverything}}checked{{end}}> + <label>{{.i18n.Tr "repo.settings.event_send_everything" | Str2html}}</label> + </div> + </div> + <div class="field"> + <div class="ui radio events checkbox"> + <input class="hidden" name="events" type="radio" value="choose_events" {{if .Webhook.ChooseEvents}}checked{{end}}> + <label>{{.i18n.Tr "repo.settings.event_choose" | Str2html}}</label> + </div> + </div> </div> - <div class="events fields ui grid" {{if not .Webhook.ChooseEvents}}style="display:none"{{end}}> - <!-- Create --> - <div class="seven wide column"> - <div class="field"> - <div class="ui checkbox"> - <input class="hidden" name="create" type="checkbox" tabindex="0" {{if .Webhook.Create}}checked{{end}}> - <label>{{.i18n.Tr "repo.settings.event_create"}}</label> - <span class="help">{{.i18n.Tr "repo.settings.event_create_desc"}}</span> - </div> - </div> - </div> - <!-- Push --> - <div class="seven wide column"> - <div class="field"> - <div class="ui checkbox"> - <input class="hidden" name="push" type="checkbox" tabindex="0" {{if .Webhook.Push}}checked{{end}}> - <label>{{.i18n.Tr "repo.settings.event_push"}}</label> - <span class="help">{{.i18n.Tr "repo.settings.event_push_desc"}}</span> - </div> - </div> - </div> - </div> + <div class="events fields ui grid" {{if not .Webhook.ChooseEvents}}style="display:none"{{end}}> + <!-- Create --> + <div class="seven wide column"> + <div class="field"> + <div class="ui checkbox"> + <input class="hidden" name="create" type="checkbox" tabindex="0" {{if .Webhook.Create}}checked{{end}}> + <label>{{.i18n.Tr "repo.settings.event_create"}}</label> + <span class="help">{{.i18n.Tr "repo.settings.event_create_desc"}}</span> + </div> + </div> + </div> + <!-- Push --> + <div class="seven wide column"> + <div class="field"> + <div class="ui checkbox"> + <input class="hidden" name="push" type="checkbox" tabindex="0" {{if .Webhook.Push}}checked{{end}}> + <label>{{.i18n.Tr "repo.settings.event_push"}}</label> + <span class="help">{{.i18n.Tr "repo.settings.event_push_desc"}}</span> + </div> + </div> + </div> + </div> </div> <div class="ui divider"></div> <div class="inline field"> - <div class="ui checkbox"> - <input class="hidden" name="active" type="checkbox" tabindex="0" {{if or .PageIsSettingsHooksNew .Webhook.IsActive}}checked{{end}}> - <label>{{.i18n.Tr "repo.settings.active"}}</label> - <span class="help">{{.i18n.Tr "repo.settings.active_helper"}}</span> - </div> + <div class="ui checkbox"> + <input class="hidden" name="active" type="checkbox" tabindex="0" {{if or .PageIsSettingsHooksNew .Webhook.IsActive}}checked{{end}}> + <label>{{.i18n.Tr "repo.settings.active"}}</label> + <span class="help">{{.i18n.Tr "repo.settings.active_helper"}}</span> + </div> </div> <div class="field"> {{if .PageIsSettingsHooksNew}} - <button class="ui green button">{{.i18n.Tr "repo.settings.add_webhook"}}</button> - {{else}} - <button class="ui green button">{{.i18n.Tr "repo.settings.update_webhook"}}</button> - <a class="ui red delete-button button" data-url="{{.BaseLink}}/settings/hooks/delete" data-id="{{.Webhook.ID}}">{{.i18n.Tr "repo.settings.delete_webhook"}}</a> - {{end}} + <button class="ui green button">{{.i18n.Tr "repo.settings.add_webhook"}}</button> + {{else}} + <button class="ui green button">{{.i18n.Tr "repo.settings.update_webhook"}}</button> + <a class="ui red delete-button button" data-url="{{.BaseLink}}/settings/hooks/delete" data-id="{{.Webhook.ID}}">{{.i18n.Tr "repo.settings.delete_webhook"}}</a> + {{end}} </div> {{template "repo/settings/hook_delete_modal" .}} diff --git a/templates/repo/settings/hook_slack.tmpl b/templates/repo/settings/hook_slack.tmpl index b0ebce9280..9333ae0c37 100644 --- a/templates/repo/settings/hook_slack.tmpl +++ b/templates/repo/settings/hook_slack.tmpl @@ -1,28 +1,28 @@ {{if eq .HookType "slack"}} -<p>{{.i18n.Tr "repo.settings.add_slack_hook_desc" "http://slack.com" | Str2html}}</p> -<form class="ui form" action="{{.BaseLink}}/settings/hooks/slack/{{if .PageIsSettingsHooksNew}}new{{else}}{{.Webhook.ID}}{{end}}" method="post"> - {{.CsrfTokenHtml}} - <div class="required field {{if .Err_PayloadURL}}error{{end}}"> - <label for="payload_url">{{.i18n.Tr "repo.settings.payload_url"}}</label> - <input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required> - </div> - <div class="required field {{if .Err_Channel}}error{{end}}"> - <label for="channel">{{.i18n.Tr "repo.settings.slack_channel"}}</label> - <input id="channel" name="channel" value="{{.SlackHook.Channel}}" placeholder="e.g. #general" required> - </div> + <p>{{.i18n.Tr "repo.settings.add_slack_hook_desc" "http://slack.com" | Str2html}}</p> + <form class="ui form" action="{{.BaseLink}}/settings/hooks/slack/{{if .PageIsSettingsHooksNew}}new{{else}}{{.Webhook.ID}}{{end}}" method="post"> + {{.CsrfTokenHtml}} + <div class="required field {{if .Err_PayloadURL}}error{{end}}"> + <label for="payload_url">{{.i18n.Tr "repo.settings.payload_url"}}</label> + <input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required> + </div> + <div class="required field {{if .Err_Channel}}error{{end}}"> + <label for="channel">{{.i18n.Tr "repo.settings.slack_channel"}}</label> + <input id="channel" name="channel" value="{{.SlackHook.Channel}}" placeholder="e.g. #general" required> + </div> - <div class="field"> - <label for="username">{{.i18n.Tr "repo.settings.slack_username"}}</label> - <input id="username" name="username" value="{{.SlackHook.Username}}" placeholder="e.g. Gogs"> - </div> - <div class="field"> - <label for="icon_url">{{.i18n.Tr "repo.settings.slack_icon_url"}}</label> - <input id="icon_url" name="icon_url" value="{{.SlackHook.IconURL}}" placeholder="e.g. https://example.com/img/favicon.png"> - </div> - <div class="field"> - <label for="color">{{.i18n.Tr "repo.settings.slack_color"}}</label> - <input id="color" name="color" value="{{.SlackHook.Color}}" placeholder="e.g. #dd4b39, good, warning, danger"> - </div> - {{template "repo/settings/hook_settings" .}} -</form> + <div class="field"> + <label for="username">{{.i18n.Tr "repo.settings.slack_username"}}</label> + <input id="username" name="username" value="{{.SlackHook.Username}}" placeholder="e.g. Gogs"> + </div> + <div class="field"> + <label for="icon_url">{{.i18n.Tr "repo.settings.slack_icon_url"}}</label> + <input id="icon_url" name="icon_url" value="{{.SlackHook.IconURL}}" placeholder="e.g. https://example.com/img/favicon.png"> + </div> + <div class="field"> + <label for="color">{{.i18n.Tr "repo.settings.slack_color"}}</label> + <input id="color" name="color" value="{{.SlackHook.Color}}" placeholder="e.g. #dd4b39, good, warning, danger"> + </div> + {{template "repo/settings/hook_settings" .}} + </form> {{end}} diff --git a/templates/repo/settings/hooks.tmpl b/templates/repo/settings/hooks.tmpl index e3f6f4ddae..a405b44698 100644 --- a/templates/repo/settings/hooks.tmpl +++ b/templates/repo/settings/hooks.tmpl @@ -5,7 +5,7 @@ <div class="ui grid"> {{template "repo/settings/navbar" .}} {{template "repo/settings/hook_list" .}} - </div> + </div> </div> </div> -{{template "base/footer" .}}
\ No newline at end of file +{{template "base/footer" .}} diff --git a/templates/repo/settings/nav.tmpl b/templates/repo/settings/nav.tmpl index 06bad9689d..97df429f2c 100644 --- a/templates/repo/settings/nav.tmpl +++ b/templates/repo/settings/nav.tmpl @@ -1,14 +1,14 @@ <div id="setting-menu" class="grid-1-5 panel panel-radius left"> - <p class="panel-header"><strong>{{.i18n.Tr "repo.settings"}}</strong></p> - <div class="panel-body"> - <ul class="menu menu-vertical switching-list grid-1-5 left"> - <li {{if .PageIsSettingsOptions}}class="current"{{end}}><a href="{{.RepoLink}}/settings">{{.i18n.Tr "repo.settings.options"}}</a></li> - <li {{if .PageIsSettingsCollaboration}}class="current"{{end}}><a href="{{.RepoLink}}/settings/collaboration">{{.i18n.Tr "repo.settings.collaboration"}}</a></li> - <li {{if .PageIsSettingsHooks}}class="current"{{end}}><a href="{{.RepoLink}}/settings/hooks">{{.i18n.Tr "repo.settings.hooks"}}</a></li> - {{if or .SignedUser.AllowGitHook .SignedUser.IsAdmin}} - <li {{if .PageIsSettingsGitHooks}}class="current"{{end}}><a href="{{.RepoLink}}/settings/hooks/git">{{.i18n.Tr "repo.settings.githooks"}}</a></li> - {{end}} - <li {{if .PageIsSettingsKeys}}class="current"{{end}}><a href="{{.RepoLink}}/settings/keys">{{.i18n.Tr "repo.settings.deploy_keys"}}</a></li> - </ul> - </div> -</div>
\ No newline at end of file + <p class="panel-header"><strong>{{.i18n.Tr "repo.settings"}}</strong></p> + <div class="panel-body"> + <ul class="menu menu-vertical switching-list grid-1-5 left"> + <li {{if .PageIsSettingsOptions}}class="current"{{end}}><a href="{{.RepoLink}}/settings">{{.i18n.Tr "repo.settings.options"}}</a></li> + <li {{if .PageIsSettingsCollaboration}}class="current"{{end}}><a href="{{.RepoLink}}/settings/collaboration">{{.i18n.Tr "repo.settings.collaboration"}}</a></li> + <li {{if .PageIsSettingsHooks}}class="current"{{end}}><a href="{{.RepoLink}}/settings/hooks">{{.i18n.Tr "repo.settings.hooks"}}</a></li> + {{if or .SignedUser.AllowGitHook .SignedUser.IsAdmin}} + <li {{if .PageIsSettingsGitHooks}}class="current"{{end}}><a href="{{.RepoLink}}/settings/hooks/git">{{.i18n.Tr "repo.settings.githooks"}}</a></li> + {{end}} + <li {{if .PageIsSettingsKeys}}class="current"{{end}}><a href="{{.RepoLink}}/settings/keys">{{.i18n.Tr "repo.settings.deploy_keys"}}</a></li> + </ul> + </div> +</div> diff --git a/templates/repo/settings/navbar.tmpl b/templates/repo/settings/navbar.tmpl index 512ee3002d..7ebf2886c9 100644 --- a/templates/repo/settings/navbar.tmpl +++ b/templates/repo/settings/navbar.tmpl @@ -1,22 +1,22 @@ <div class="four wide column"> <div class="ui vertical menu"> <div class="header item">{{.i18n.Tr "repo.settings"}}</div> - <a class="{{if .PageIsSettingsOptions}}active{{end}} item" href="{{.RepoLink}}/settings"> - {{.i18n.Tr "repo.settings.options"}} - </a> - <a class="{{if .PageIsSettingsCollaboration}}active{{end}} item" href="{{.RepoLink}}/settings/collaboration"> - {{.i18n.Tr "repo.settings.collaboration"}} - </a> - <a class="{{if .PageIsSettingsHooks}}active{{end}} item" href="{{.RepoLink}}/settings/hooks"> - {{.i18n.Tr "repo.settings.hooks"}} - </a> - {{if .SignedUser.CanEditGitHook}} - <a class="{{if .PageIsSettingsGitHooks}}active{{end}} item" href="{{.RepoLink}}/settings/hooks/git"> - {{.i18n.Tr "repo.settings.githooks"}} - </a> - {{end}} - <a class="{{if .PageIsSettingsKeys}}active{{end}} item" href="{{.RepoLink}}/settings/keys"> - {{.i18n.Tr "repo.settings.deploy_keys"}} - </a> + <a class="{{if .PageIsSettingsOptions}}active{{end}} item" href="{{.RepoLink}}/settings"> + {{.i18n.Tr "repo.settings.options"}} + </a> + <a class="{{if .PageIsSettingsCollaboration}}active{{end}} item" href="{{.RepoLink}}/settings/collaboration"> + {{.i18n.Tr "repo.settings.collaboration"}} + </a> + <a class="{{if .PageIsSettingsHooks}}active{{end}} item" href="{{.RepoLink}}/settings/hooks"> + {{.i18n.Tr "repo.settings.hooks"}} + </a> + {{if .SignedUser.CanEditGitHook}} + <a class="{{if .PageIsSettingsGitHooks}}active{{end}} item" href="{{.RepoLink}}/settings/hooks/git"> + {{.i18n.Tr "repo.settings.githooks"}} + </a> + {{end}} + <a class="{{if .PageIsSettingsKeys}}active{{end}} item" href="{{.RepoLink}}/settings/keys"> + {{.i18n.Tr "repo.settings.deploy_keys"}} + </a> </div> </div> diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl index f3734557d9..767f164a03 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -7,121 +7,121 @@ <div class="twelve wide column content"> {{template "base/alert" .}} <h4 class="ui top attached header"> - {{.i18n.Tr "repo.settings.basic_settings"}} + {{.i18n.Tr "repo.settings.basic_settings"}} </h4> <div class="ui attached segment"> <form class="ui form" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} - <input type="hidden" name="action" value="update"> - <div class="required field {{if .Err_RepoName}}error{{end}}"> - <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}<span class="text red hide" id="repo-name-change-prompt"> {{.i18n.Tr "repo.settings.change_reponame_prompt"}}</span></label> - <input id="repo_name" name="repo_name" value="{{.Repository.Name}}" data-repo-name="{{.Repository.Name}}" autofocus required> - </div> - <div class="field {{if .Err_Description}}error{{end}}"> - <label for="description">{{$.i18n.Tr "repo.repo_desc"}}</label> - <textarea id="description" name="description" rows="2">{{.Repository.Description}}</textarea> - </div> - <div class="field {{if .Err_Website}}error{{end}}"> - <label for="website">{{.i18n.Tr "repo.settings.site"}}</label> - <input id="website" name="website" type="url" value="{{.Repository.Website}}"> - </div> - - {{if not .Repository.IsBare}} - <div class="required inline field"> - <label>{{.i18n.Tr "repo.default_branch"}}</label> - <div class="ui selection dropdown"> - <input type="hidden" id="branch" name="branch" value="{{.Repository.DefaultBranch}}"> - <div class="text">{{.Repository.DefaultBranch}}</div> - <i class="dropdown icon"></i> - <div class="menu"> - {{range .Branches}} - <div class="item" data-value="{{.}}">{{.}}</div> - {{end}} - </div> - </div> - </div> - {{end}} - {{if not .Repository.IsFork}} - <div class="inline field"> - <label>{{.i18n.Tr "repo.visibility"}}</label> - <div class="ui checkbox"> - <input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}> - <label>{{.i18n.Tr "repo.visiblity_helper" | Safe}} {{if .Repository.NumForks}}<span class="text red">{{.i18n.Tr "repo.visiblity_fork_helper"}}</span>{{end}}</label> - </div> - </div> - {{end}} - {{if .Repository.IsMirror}} - <div class="inline field {{if .Err_Interval}}error{{end}}"> - <label for="interval">{{.i18n.Tr "repo.mirror_interval"}}</label> - <input id="interval" name="interval" type="number" value="{{.MirrorInterval}}"> - </div> - {{end}} - - <div class="ui divider"></div> - <div class="field"> - <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button> - </div> + <input type="hidden" name="action" value="update"> + <div class="required field {{if .Err_RepoName}}error{{end}}"> + <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}<span class="text red hide" id="repo-name-change-prompt"> {{.i18n.Tr "repo.settings.change_reponame_prompt"}}</span></label> + <input id="repo_name" name="repo_name" value="{{.Repository.Name}}" data-repo-name="{{.Repository.Name}}" autofocus required> + </div> + <div class="field {{if .Err_Description}}error{{end}}"> + <label for="description">{{$.i18n.Tr "repo.repo_desc"}}</label> + <textarea id="description" name="description" rows="2">{{.Repository.Description}}</textarea> + </div> + <div class="field {{if .Err_Website}}error{{end}}"> + <label for="website">{{.i18n.Tr "repo.settings.site"}}</label> + <input id="website" name="website" type="url" value="{{.Repository.Website}}"> + </div> + + {{if not .Repository.IsBare}} + <div class="required inline field"> + <label>{{.i18n.Tr "repo.default_branch"}}</label> + <div class="ui selection dropdown"> + <input type="hidden" id="branch" name="branch" value="{{.Repository.DefaultBranch}}"> + <div class="text">{{.Repository.DefaultBranch}}</div> + <i class="dropdown icon"></i> + <div class="menu"> + {{range .Branches}} + <div class="item" data-value="{{.}}">{{.}}</div> + {{end}} + </div> + </div> + </div> + {{end}} + {{if not .Repository.IsFork}} + <div class="inline field"> + <label>{{.i18n.Tr "repo.visibility"}}</label> + <div class="ui checkbox"> + <input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}> + <label>{{.i18n.Tr "repo.visiblity_helper" | Safe}} {{if .Repository.NumForks}}<span class="text red">{{.i18n.Tr "repo.visiblity_fork_helper"}}</span>{{end}}</label> + </div> + </div> + {{end}} + {{if .Repository.IsMirror}} + <div class="inline field {{if .Err_Interval}}error{{end}}"> + <label for="interval">{{.i18n.Tr "repo.mirror_interval"}}</label> + <input id="interval" name="interval" type="number" value="{{.MirrorInterval}}"> + </div> + {{end}} + + <div class="ui divider"></div> + <div class="field"> + <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button> + </div> + </form> + </div> + + <h4 class="ui top attached header"> + {{.i18n.Tr "repo.settings.advanced_settings"}} + </h4> + <div class="ui attached segment"> + <form class="ui form" action="{{.Link}}" method="post"> + {{.CsrfTokenHtml}} + <input type="hidden" name="action" value="advanced"> + + <div class="inline field"> + <label>{{.i18n.Tr "repo.wiki"}}</label> + <div class="ui checkbox"> + <input name="enable_wiki" type="checkbox" {{if .Repository.EnableWiki}}checked{{end}}> + <label>{{.i18n.Tr "repo.settings.wiki_desc"}}</label> + </div> + </div> + + <div class="ui divider"></div> + + <div class="inline field"> + <label>{{.i18n.Tr "repo.issues"}}</label> + <div class="ui checkbox"> + <input name="enable_issues" type="checkbox" {{if .Repository.EnableIssues}}checked{{end}}> + <label>{{.i18n.Tr "repo.settings.issues_desc"}}</label> + </div> + </div> + <div class="inline field"> + <div class="ui checkbox"> + <input name="enable_external_tracker" type="checkbox" {{if .Repository.EnableExternalTracker}}checked{{end}}> + <label>{{.i18n.Tr "repo.settings.use_external_issue_tracker"}}</label> + </div> + </div> + <div class="field"> + <label for="tracker_url_format">{{.i18n.Tr "repo.settings.tracker_url_format"}}</label> + <input id="tracker_url_format" name="tracker_url_format" value="{{.Repository.ExternalTrackerFormat}}" placeholder="e.g. https://github.com/{user}/{repo}/issues/{index}"> + <p class="help">{{.i18n.Tr "repo.settings.tracker_url_format_desc" | Str2html}}</p> + </div> + + <div class="ui divider"></div> + + <div class="inline field"> + <label>{{.i18n.Tr "repo.pulls"}}</label> + <div class="ui checkbox"> + <input name="enable_pulls" type="checkbox" {{if .Repository.EnablePulls}}checked{{end}}> + <label>{{.i18n.Tr "repo.settings.pulls_desc"}}</label> + </div> + </div> + + <div class="ui divider"></div> + <div class="field"> + <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button> + </div> </form> - </div> - - <h4 class="ui top attached header"> - {{.i18n.Tr "repo.settings.advanced_settings"}} - </h4> - <div class="ui attached segment"> - <form class="ui form" action="{{.Link}}" method="post"> - {{.CsrfTokenHtml}} - <input type="hidden" name="action" value="advanced"> - - <div class="inline field"> - <label>{{.i18n.Tr "repo.wiki"}}</label> - <div class="ui checkbox"> - <input name="enable_wiki" type="checkbox" {{if .Repository.EnableWiki}}checked{{end}}> - <label>{{.i18n.Tr "repo.settings.wiki_desc"}}</label> - </div> - </div> - - <div class="ui divider"></div> - - <div class="inline field"> - <label>{{.i18n.Tr "repo.issues"}}</label> - <div class="ui checkbox"> - <input name="enable_issues" type="checkbox" {{if .Repository.EnableIssues}}checked{{end}}> - <label>{{.i18n.Tr "repo.settings.issues_desc"}}</label> - </div> - </div> - <div class="inline field"> - <div class="ui checkbox"> - <input name="enable_external_tracker" type="checkbox" {{if .Repository.EnableExternalTracker}}checked{{end}}> - <label>{{.i18n.Tr "repo.settings.use_external_issue_tracker"}}</label> - </div> - </div> - <div class="field"> - <label for="tracker_url_format">{{.i18n.Tr "repo.settings.tracker_url_format"}}</label> - <input id="tracker_url_format" name="tracker_url_format" value="{{.Repository.ExternalTrackerFormat}}" placeholder="e.g. https://github.com/{user}/{repo}/issues/{index}"> - <p class="help">{{.i18n.Tr "repo.settings.tracker_url_format_desc" | Str2html}}</p> - </div> - - <div class="ui divider"></div> - - <div class="inline field"> - <label>{{.i18n.Tr "repo.pulls"}}</label> - <div class="ui checkbox"> - <input name="enable_pulls" type="checkbox" {{if .Repository.EnablePulls}}checked{{end}}> - <label>{{.i18n.Tr "repo.settings.pulls_desc"}}</label> - </div> - </div> - - <div class="ui divider"></div> - <div class="field"> - <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button> - </div> - </form> - </div> - - <h4 class="ui top attached warning header"> - {{.i18n.Tr "repo.settings.danger_zone"}} - </h4> - <div class="ui attached warning table danger segment"> + </div> + + <h4 class="ui top attached warning header"> + {{.i18n.Tr "repo.settings.danger_zone"}} + </h4> + <div class="ui attached warning table danger segment"> <div class="item"> <div class="ui right"> <button class="ui basic red show-modal button" data-modal="#transfer-repo-modal">{{.i18n.Tr "repo.settings.transfer"}}</button> @@ -131,7 +131,7 @@ <p>{{.i18n.Tr "repo.settings.transfer_desc"}}</p> </div> </div> - + <div class="ui divider"></div> <div class="item"> @@ -143,23 +143,23 @@ <p>{{.i18n.Tr "repo.settings.delete_desc"}}</p> </div> </div> - </div> - </div> - </div> - </div> + </div> + </div> + </div> + </div> </div> <div class="ui small modal" id="transfer-repo-modal"> - <div class="header"> - {{.i18n.Tr "repo.settings.transfer"}} - </div> - <div class="content"> + <div class="header"> + {{.i18n.Tr "repo.settings.transfer"}} + </div> + <div class="content"> <div class="ui warning message text left"> {{.i18n.Tr "repo.settings.transfer_notices_1" | Safe}} <br> {{.i18n.Tr "repo.settings.transfer_notices_2" | Safe}} </div> - <form class="ui form" action="{{.Link}}" method="post"> - {{.CsrfTokenHtml}} + <form class="ui form" action="{{.Link}}" method="post"> + {{.CsrfTokenHtml}} <input type="hidden" name="action" value="transfer"> <div class="field"> <label> @@ -167,28 +167,28 @@ <span class="text red">{{.Repository.Name}}</span> </label> </div> - <div class="required field"> - <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label> - <input id="repo_name" name="repo_name" required> - </div> - <div class="required field"> - <label for="new_owner_name">{{.i18n.Tr "repo.settings.transfer_owner"}}</label> - <input id="new_owner_name" name="new_owner_name" required> - </div> - + <div class="required field"> + <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label> + <input id="repo_name" name="repo_name" required> + </div> + <div class="required field"> + <label for="new_owner_name">{{.i18n.Tr "repo.settings.transfer_owner"}}</label> + <input id="new_owner_name" name="new_owner_name" required> + </div> + <div class="text right actions"> <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div> <button class="ui red button">{{.i18n.Tr "repo.settings.make_transfer"}}</button> </div> - </form> - </div> + </form> + </div> </div> <div class="ui small modal" id="delete-repo-modal"> - <div class="header"> - {{.i18n.Tr "repo.settings.delete"}} - </div> - <div class="content"> + <div class="header"> + {{.i18n.Tr "repo.settings.delete"}} + </div> + <div class="content"> <div class="ui warning message text left"> {{.i18n.Tr "repo.settings.delete_notices_1" | Safe}} <br> {{.i18n.Tr "repo.settings.delete_notices_2" | Safe}} @@ -196,27 +196,27 @@ {{.i18n.Tr "repo.settings.delete_notices_fork_1" | Safe}} <br> {{.i18n.Tr "repo.settings.delete_notices_fork_2" | Safe}} <br> {{.i18n.Tr "repo.settings.delete_notices_fork_3" | Safe}} - {{end}} + {{end}} + </div> + <form class="ui form" action="{{.Link}}" method="post"> + {{.CsrfTokenHtml}} + <input type="hidden" name="action" value="delete"> + <div class="field"> + <label> + {{.i18n.Tr "repo.settings.transfer_form_title"}} + <span class="text red">{{.Repository.Name}}</span> + </label> </div> - <form class="ui form" action="{{.Link}}" method="post"> - {{.CsrfTokenHtml}} - <input type="hidden" name="action" value="delete"> - <div class="field"> - <label> - {{.i18n.Tr "repo.settings.transfer_form_title"}} - <span class="text red">{{.Repository.Name}}</span> - </label> - </div> - <div class="required field"> - <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label> - <input id="repo_name" name="repo_name" required> - </div> - - <div class="text right actions"> - <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div> - <button class="ui red button">{{.i18n.Tr "repo.settings.confirm_delete"}}</button> - </div> - </form> - </div> + <div class="required field"> + <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label> + <input id="repo_name" name="repo_name" required> + </div> + + <div class="text right actions"> + <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div> + <button class="ui red button">{{.i18n.Tr "repo.settings.confirm_delete"}}</button> + </div> + </form> +</div> </div> -{{template "base/footer" .}}
\ No newline at end of file +{{template "base/footer" .}} |