From 28814564212b7c64136cc3eda3774af56983557e Mon Sep 17 00:00:00 2001 From: Unknwon Date: Wed, 26 Aug 2015 21:45:51 +0800 Subject: new webhooks list UI --- templates/org/header.tmpl | 26 +++++++++++++++ templates/org/settings/hooks.tmpl | 45 ++++++-------------------- templates/org/settings/nav.tmpl | 6 ++-- templates/org/settings/navbar.tmpl | 14 ++++++++ templates/repo/header.tmpl | 20 ++++++------ templates/repo/settings/githook_edit.tmpl | 2 +- templates/repo/settings/githooks.tmpl | 10 ++---- templates/repo/settings/hook_gogs.tmpl | 4 +-- templates/repo/settings/hook_list.tmpl | 52 ++++++++++++++++++++++++++++++ templates/repo/settings/hook_settings.tmpl | 2 +- templates/repo/settings/hook_slack.tmpl | 4 +-- templates/repo/settings/hooks.tmpl | 46 ++++++-------------------- 12 files changed, 131 insertions(+), 100 deletions(-) create mode 100644 templates/org/header.tmpl create mode 100644 templates/org/settings/navbar.tmpl create mode 100644 templates/repo/settings/hook_list.tmpl (limited to 'templates') diff --git a/templates/org/header.tmpl b/templates/org/header.tmpl new file mode 100644 index 0000000000..7843441b6e --- /dev/null +++ b/templates/org/header.tmpl @@ -0,0 +1,26 @@ +{{with .Org}} +
+ +
+
+{{end}} \ No newline at end of file diff --git a/templates/org/settings/hooks.tmpl b/templates/org/settings/hooks.tmpl index 2f6ba630e6..3b5bf4d9df 100644 --- a/templates/org/settings/hooks.tmpl +++ b/templates/org/settings/hooks.tmpl @@ -1,38 +1,11 @@ -{{template "ng/base/head" .}} -{{template "ng/base/header" .}} -{{template "org/base/header" .}} -
-
- {{template "org/settings/nav" .}} -
-
- {{template "ng/base/alert" .}} -
-
-
- {{.i18n.Tr "repo.settings.add_webhook"}} - {{.i18n.Tr "repo.settings.hooks"}} -
-
    -
  • {{.i18n.Tr "org.settings.hooks_desc" | Str2html}}
  • - {{range .Webhooks}} -
  • - {{if .IsActive}} - - {{else}} - - {{end}} - {{.Url}} - - -
  • - {{end}} -
-
-
-
-
-
+{{template "base/head" .}} +
+ {{template "org/header" .}} +
+
+ {{template "org/settings/navbar" .}} + {{template "repo/settings/hook_list" .}} +
-{{template "ng/base/footer" .}} +{{template "base/footer" .}} diff --git a/templates/org/settings/nav.tmpl b/templates/org/settings/nav.tmpl index 1285c4ab94..28af4d29a5 100644 --- a/templates/org/settings/nav.tmpl +++ b/templates/org/settings/nav.tmpl @@ -4,9 +4,9 @@
diff --git a/templates/org/settings/navbar.tmpl b/templates/org/settings/navbar.tmpl new file mode 100644 index 0000000000..30f5818768 --- /dev/null +++ b/templates/org/settings/navbar.tmpl @@ -0,0 +1,14 @@ +
+ +
diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 5d68f393e3..74e04d0988 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -1,6 +1,6 @@ {{with .Repository}}
-
+
- -
-
-
{{end}} diff --git a/templates/repo/settings/githook_edit.tmpl b/templates/repo/settings/githook_edit.tmpl index 520ebdb2d4..40334d271c 100644 --- a/templates/repo/settings/githook_edit.tmpl +++ b/templates/repo/settings/githook_edit.tmpl @@ -1,5 +1,5 @@ {{template "base/head" .}} -
+
{{template "repo/header" .}}
diff --git a/templates/repo/settings/githooks.tmpl b/templates/repo/settings/githooks.tmpl index 6c0af1f2ff..8120b80e17 100644 --- a/templates/repo/settings/githooks.tmpl +++ b/templates/repo/settings/githooks.tmpl @@ -1,5 +1,5 @@ {{template "base/head" .}} -
+
{{template "repo/header" .}}
@@ -16,13 +16,9 @@
{{range .Hooks}}
- {{if .IsActive}} - - {{else}} - - {{end}} + {{.Name}} - +
{{end}}
diff --git a/templates/repo/settings/hook_gogs.tmpl b/templates/repo/settings/hook_gogs.tmpl index 39e612b9f4..e4ece412b9 100644 --- a/templates/repo/settings/hook_gogs.tmpl +++ b/templates/repo/settings/hook_gogs.tmpl @@ -1,11 +1,11 @@
-
+ {{.CsrfTokenHtml}}
{{.i18n.Tr "repo.settings.add_webhook_desc" "http://gogs.io/docs/features/webhook.html" | Str2html}}
- +
diff --git a/templates/repo/settings/hook_list.tmpl b/templates/repo/settings/hook_list.tmpl new file mode 100644 index 0000000000..b04d86367e --- /dev/null +++ b/templates/repo/settings/hook_list.tmpl @@ -0,0 +1,52 @@ +
+ {{template "base/alert" .}} +

+ {{.i18n.Tr "repo.settings.hooks"}} + +

+
+
+
+ {{.Description | Str2html}} +
+ {{range .Webhooks}} +
+ {{if eq .LastStatus 1}} + + {{else if eq .LastStatus 2}} + + {{else}} + + {{end}} + {{.URL}} +
+ + +
+
+ {{end}} +
+
+
+ + \ No newline at end of file diff --git a/templates/repo/settings/hook_settings.tmpl b/templates/repo/settings/hook_settings.tmpl index 7bf4e2a36c..bf465c8305 100644 --- a/templates/repo/settings/hook_settings.tmpl +++ b/templates/repo/settings/hook_settings.tmpl @@ -11,5 +11,5 @@
- {{if .PageIsSettingsHooksEdit}}{{.i18n.Tr "repo.settings.delete_webhook"}}{{end}} + {{if .PageIsSettingsHooksEdit}}{{.i18n.Tr "repo.settings.delete_webhook"}}{{end}}
diff --git a/templates/repo/settings/hook_slack.tmpl b/templates/repo/settings/hook_slack.tmpl index bc307ec850..82439c4323 100644 --- a/templates/repo/settings/hook_slack.tmpl +++ b/templates/repo/settings/hook_slack.tmpl @@ -1,11 +1,11 @@
- + {{.CsrfTokenHtml}}
{{.i18n.Tr "repo.settings.add_slack_hook_desc" "http://slack.com" | Str2html}}
- +
diff --git a/templates/repo/settings/hooks.tmpl b/templates/repo/settings/hooks.tmpl index e23c0ccd63..e3f6f4ddae 100644 --- a/templates/repo/settings/hooks.tmpl +++ b/templates/repo/settings/hooks.tmpl @@ -1,39 +1,11 @@ -{{template "ng/base/head" .}} -{{template "ng/base/header" .}} -
- {{template "repo/header_old" .}} -
-
- {{template "repo/settings/nav" .}} -
-
- {{template "ng/base/alert" .}} -
-
-
- {{.i18n.Tr "repo.settings.add_webhook"}} - {{.i18n.Tr "repo.settings.hooks"}} -
-
    -
  • {{.i18n.Tr "repo.settings.hooks_desc" "http://gogs.io/docs/features/webhook.html" | Str2html}}
  • - {{range .Webhooks}} -
  • - {{if .IsActive}} - - {{else}} - - {{end}} - {{.Url}} - - -
  • - {{end}} -
-
-
-
-
-
+{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+
+ {{template "repo/settings/navbar" .}} + {{template "repo/settings/hook_list" .}} +
-{{template "ng/base/footer" .}} \ No newline at end of file +{{template "base/footer" .}} \ No newline at end of file -- cgit v1.2.3