From 1b0142513e21fd37d477ca776ccf8d6f6f1bc928 Mon Sep 17 00:00:00 2001 From: FuXiaoHei Date: Sun, 6 Apr 2014 16:29:45 +0800 Subject: release-new page ui --- public/css/gogs.css | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++ public/js/app.js | 20 +++++++++++++++ 2 files changed, 90 insertions(+) (limited to 'public') diff --git a/public/css/gogs.css b/public/css/gogs.css index a6d6b4cc..da2a7fd1 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -1304,4 +1304,74 @@ html, body { #release .release-item .info .avatar { vertical-align: middle; +} + +#release-new-form { + margin-top: 24px; +} + +#release-new-form .target-at { + margin: 0 1em; +} + +#release-new-form .target-text { + color: #888; +} + +#release-new-target-branch-list { + padding-top: 0; + padding-bottom: 0; + min-width: 200px; +} + +#release-new-target-branch-list ul { + margin-bottom: 0; +} + +#release-new-target-branch-list li { + padding: 8px 20px; +} + +#release-new-target-branch-list li a { + margin-left: 0; + background-color: transparent; + padding: 0; +} + +#release-new-target-branch-list li a:hover { + background-image: none; +} + +#release-new-target-branch-list li:hover { + background-color: #0093c4; +} + +#release-new-target-branch-list li:hover a { + color: #FFF; +} + +#release-new-title { + width: 50%; +} + +#release-new-content-div { + margin-top: 16px; + padding-left: 0; +} + +#release-new-content-div .md-help { + margin-top: 6px; +} + +#release-textarea .form-group { + display: block; +} + +#release-new-content { + width: 100%; + margin: 16px 0; +} + +#release-preview{ + margin: 6px 0; } \ No newline at end of file diff --git a/public/js/app.js b/public/js/app.js index 0ba0675f..93e01abd 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -520,6 +520,23 @@ function initIssue() { } +function initRelease() { +// release new ajax preview + (function () { + $('[data-ajax-name=release-preview]').on("click", function () { + var $this = $(this); + $this.toggleAjax(function (json) { + if (json.ok) { + $($this.data("preview")).html(json.content); + } + }) + }); + $('.release-write a[data-toggle]').on("click", function () { + $('.release-preview-content').html("loading..."); + }); + }()) +} + (function ($) { $(function () { initCore(); @@ -539,5 +556,8 @@ function initIssue() { if ($('#issue').length) { initIssue(); } + if ($('#release').length) { + initRelease(); + } }); })(jQuery); -- cgit v1.2.3 From d3a987eded8bf2d0afc35dce32238e59da8080a8 Mon Sep 17 00:00:00 2001 From: FuXiaoHei Date: Sun, 6 Apr 2014 16:48:02 +0800 Subject: username & repo-name changing help message --- public/js/app.js | 27 ++++++++++++++++++++++++++- templates/repo/setting.tmpl | 5 +++-- templates/user/setting.tmpl | 5 +++-- 3 files changed, 32 insertions(+), 5 deletions(-) (limited to 'public') diff --git a/public/js/app.js b/public/js/app.js index 93e01abd..059663e1 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -354,6 +354,7 @@ function initRegister() { } function initUserSetting() { + // ssh confirmation $('#ssh-keys .delete').confirmation({ singleton: true, onConfirm: function (e, $this) { @@ -366,6 +367,18 @@ function initUserSetting() { }); } }); + + // profile form + (function () { + $('#user-setting-username').on("keyup", function () { + var $this = $(this); + if ($this.val() != $this.attr('title')) { + $this.next('.help-block').toggleShow(); + } else { + $this.next('.help-block').toggleHide(); + } + }); + }()) } function initRepository() { @@ -383,7 +396,7 @@ function initRepository() { $clone.find('span.clone-url').text($this.data('link')); } }).eq(0).trigger("click"); - $("#repo-clone").on("shown.bs.dropdown",function () { + $("#repo-clone").on("shown.bs.dropdown", function () { Gogits.bindCopy("[data-init=copy]"); }); Gogits.bindCopy("[data-init=copy]:visible"); @@ -438,6 +451,18 @@ function initRepository() { $item.find(".bar .add").css("width", addPercent + "%"); }); }()); + + // repo setting form + (function () { + $('#repo-setting-name').on("keyup", function () { + var $this = $(this); + if ($this.val() != $this.attr('title')) { + $this.next('.help-block').toggleShow(); + } else { + $this.next('.help-block').toggleHide(); + } + }); + }()) } function initInstall() { diff --git a/templates/repo/setting.tmpl b/templates/repo/setting.tmpl index 6e2d3bec..85d08c59 100644 --- a/templates/repo/setting.tmpl +++ b/templates/repo/setting.tmpl @@ -23,9 +23,10 @@ {{.CsrfTokenHtml}}
- +
- + +
diff --git a/templates/user/setting.tmpl b/templates/user/setting.tmpl index b32689fe..d5828338 100644 --- a/templates/user/setting.tmpl +++ b/templates/user/setting.tmpl @@ -10,9 +10,10 @@ {{if .IsSuccess}}

Your profile has been successfully updated.

{{else if .HasError}}

{{.ErrorMsg}}

{{end}}

Your Email will be public and used for Account related notifications and any web based operations made via the web.

- +
- + +
-- cgit v1.2.3