diff options
author | Unknwon <u@gogs.io> | 2015-07-24 21:02:49 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-07-24 21:02:49 +0800 |
commit | ac95f6d50f674cae1a5ae3889fdf3c56eb7c005d (patch) | |
tree | 274c1e8087aca7b0a366eaf61b08fbd177a52a29 /templates | |
parent | 86dbda0b42d05caf11d5c6d040f18dfbcc742e04 (diff) | |
download | gitea-ac95f6d50f674cae1a5ae3889fdf3c56eb7c005d.tar.gz gitea-ac95f6d50f674cae1a5ae3889fdf3c56eb7c005d.zip |
UI: basic label list
- create new label
Diffstat (limited to 'templates')
-rw-r--r-- | templates/.VERSION | 2 | ||||
-rw-r--r-- | templates/base/head.tmpl | 6 | ||||
-rw-r--r-- | templates/repo/issue/alert.tmpl | 5 | ||||
-rw-r--r-- | templates/repo/issue/labels.tmpl | 64 | ||||
-rw-r--r-- | templates/repo/issue/list.tmpl | 6 | ||||
-rw-r--r-- | templates/repo/issue/navbar.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/issue/view.tmpl | 10 | ||||
-rw-r--r-- | templates/repo/issue2/labels.tmpl | 74 |
8 files changed, 86 insertions, 83 deletions
diff --git a/templates/.VERSION b/templates/.VERSION index 7793c8a2e4..3e39c8bbb5 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.6.1.0724 Beta
\ No newline at end of file +0.6.2.0724 Beta
\ No newline at end of file diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index 9739057d7d..cdd9da4106 100644 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -29,6 +29,12 @@ <script src="{{AppSubUrl}}/js/semantic.min.js?v={{AppVer}}"></script> <script src="{{AppSubUrl}}/js/gogs.js?v={{AppVer}}"></script> + <!-- Third-party libraries --> + {{if .PageIsLabels}} + <link rel="stylesheet" href="{{AppSubUrl}}/css/jquery.minicolors.css?v={{AppVer}}"> + <script src="{{AppSubUrl}}/js/libs/jquery.minicolors.min.js?v={{AppVer}}"></script> + {{end}} + <title>{{if .Title}}{{.Title}} - {{end}}{{AppName}}</title> </head> <body> diff --git a/templates/repo/issue/alert.tmpl b/templates/repo/issue/alert.tmpl new file mode 100644 index 0000000000..bdc32ce4fc --- /dev/null +++ b/templates/repo/issue/alert.tmpl @@ -0,0 +1,5 @@ +{{if .Flash}} +<div class="sixteen wide center aligned centered column"> + {{template "base/alert" .}} +</div> +{{end}}
\ No newline at end of file diff --git a/templates/repo/issue/labels.tmpl b/templates/repo/issue/labels.tmpl new file mode 100644 index 0000000000..47b8614cb8 --- /dev/null +++ b/templates/repo/issue/labels.tmpl @@ -0,0 +1,64 @@ +{{template "base/head" .}} +<div class="repository labels"> + {{template "repo/header" .}} + <div class="ui middle page grid body"> + <div class="navbar"> + {{template "repo/issue/navbar" .}} + {{if .IsRepositoryAdmin}} + <form class="ui right form" action="{{$.RepoLink}}/labels/new" method="post"> + {{.CsrfTokenHtml}} + <div class="ui right floated secondary menu"> + <div class="item"> + <div class="ui large input"> + <input class="new-label-input" name="title" placeholder="{{.i18n.Tr "repo.issues.new_label_placeholder"}}" required> + </div> + </div> + <div class="item"> + <div class="ui large input"> + <input class="color-picker" name="color" value="#70c24a" required> + </div> + </div> + <div class="item precolors"> + <a class="color" style="background-color:#e11d21" data-color-hex="#e11d21"></a> + <a class="color" style="background-color:#eb6420" data-color-hex="#eb6420"></a> + <a class="color" style="background-color:#fbca04" data-color-hex="#fbca04"></a> + <a class="color" style="background-color:#009800" data-color-hex="#009800"></a> + <a class="color" style="background-color:#006b75" data-color-hex="#006b75"></a> + <a class="color" style="background-color:#207de5" data-color-hex="#207de5"></a> + <a class="color" style="background-color:#0052cc" data-color-hex="#0052cc"></a> + <a class="color" style="background-color:#53e917" data-color-hex="#53e917"></a> + <a class="color" style="background-color:#f6c6c7" data-color-hex="#f6c6c7"></a> + <a class="color" style="background-color:#fad8c7" data-color-hex="#fad8c7"></a> + <a class="color" style="background-color:#fef2c0" data-color-hex="#fef2c0"></a> + <a class="color" style="background-color:#bfe5bf" data-color-hex="#bfe5bf"></a> + <a class="color" style="background-color:#bfdadc" data-color-hex="#bfdadc"></a> + <a class="color" style="background-color:#c7def8" data-color-hex="#c7def8"></a> + <a class="color" style="background-color:#bfd4f2" data-color-hex="#bfd4f2"></a> + <a class="color" style="background-color:#d4c5f9" data-color-hex="#d4c5f9"></a> + </div> + <button class="ui green button">{{.i18n.Tr "repo.issues.new_label"}}</button> + </div> + </form> + {{end}} + </div> + <div class="ui divider"></div> + {{template "repo/issue/alert" .}} + <div class="ui left"> + <div class="ui black label">{{.i18n.Tr "repo.issues.label_count" .NumLabels}}</div> + </div> + + <div class="label list"> + {{range .Labels}} + <li class="item"> + <div class="ui label" style="background-color: {{.Color}}"><i class="octicon octicon-tag"></i> {{.Name}}</div> + {{if $.IsRepositoryAdmin}} + <a class="ui right" href="#"><i class="octicon octicon-x"></i> {{$.i18n.Tr "repo.issues.label_delete"}}</a> + <a class="ui right" href="#"><i class="octicon octicon-pencil"></i> {{$.i18n.Tr "repo.issues.label_edit"}}</a> + {{end}} + <a class="ui right open-issues" href="{{$.RepoLink}}/issues?labels={{.ID}}"><i class="octicon octicon-issue-opened"></i> {{$.i18n.Tr "repo.issues.label_open_issues" .NumOpenIssues}}</a> + </li> + {{end}} + </div> + </div> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl index 5513ae4cd6..e62e9534e0 100644 --- a/templates/repo/issue/list.tmpl +++ b/templates/repo/issue/list.tmpl @@ -4,9 +4,11 @@ <div class="ui middle page grid body"> <div class="navbar"> {{template "repo/issue/navbar" .}} + {{if .IsRepositoryAdmin}} <div class="ui right floated secondary menu"> <a class="ui green button" href="{{$.RepoLink}}/issues/new">{{.i18n.Tr "repo.issues.new"}}</a> </div> + {{end}} </div> <div class="ui divider"></div> <div class="ui left"> @@ -29,7 +31,7 @@ </span> <div class="menu"> {{range .Labels}} - <a class="item" href="{{$.RepoLink}}/issues?type={{$.ViewType}}&state={{$.State}}&labels={{.Id}}"><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}</a> + <a class="item" href="{{$.RepoLink}}/issues?type={{$.ViewType}}&state={{$.State}}&labels={{.ID}}"><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}</a> {{end}} </div> </div> @@ -73,7 +75,7 @@ {{range .Issues}} {{ $timeStr:= TimeSince .Created $.Lang }} <li class="item"> - <div class="ui {{if .IsRead}}black{{else}}green{{end}} label">#{{.Id}}</div> + <div class="ui {{if .IsRead}}black{{else}}green{{end}} label">#{{.Index}}</div> <a class="title" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Name}}</a> {{if .NumComments}}<span class="comment ui right"><i class="octicon octicon-comment"></i> {{.NumComments}}</span>{{end}} <p class="desc">{{$.i18n.Tr "repo.issues.opened_by" $timeStr .Poster.Name|Str2html}}</p> diff --git a/templates/repo/issue/navbar.tmpl b/templates/repo/issue/navbar.tmpl index e4a58f7730..beff907d2f 100644 --- a/templates/repo/issue/navbar.tmpl +++ b/templates/repo/issue/navbar.tmpl @@ -1,7 +1,7 @@ <div class="ui left"> <div class="ui compact menu"> <a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues">{{.i18n.Tr "repo.issues"}}</a> - <a class="item" href="{{.RepoLink}}/labels">{{.i18n.Tr "repo.labels"}}</a> + <a class="{{if .PageIsLabels}}active{{end}} item" href="{{.RepoLink}}/labels">{{.i18n.Tr "repo.labels"}}</a> <a class="item" href="{{.RepoLink}}/milestones">{{.i18n.Tr "repo.milestones"}}</a> </div> </div>
\ No newline at end of file diff --git a/templates/repo/issue/view.tmpl b/templates/repo/issue/view.tmpl index b52ef5055d..fa505df7fe 100644 --- a/templates/repo/issue/view.tmpl +++ b/templates/repo/issue/view.tmpl @@ -3,15 +3,15 @@ {{template "repo/nav" .}} {{template "repo/toolbar" .}} <div id="body" class="container"> - <div id="issue" data-id="{{.Issue.Id}}"> - <div id="issue-{{.Issue.Id}}" class="issue-whole issue-is-opening"> + <div id="issue" data-id="{{.Issue.ID}}"> + <div id="issue-{{.Issue.ID}}" class="issue-whole issue-is-opening"> <div class="issue-wrap col-md-10"> <div class="issue-head clearfix"> <div class="number pull-right">#{{.Issue.Index}}</div> <a class="author pull-left" href="{{AppSubUrl}}/{{.Issue.Poster.Name}}"><img class="avatar" src="{{.Issue.Poster.AvatarLink}}" alt="" width="30"/></a> <h1 class="title pull-left">{{.Issue.Name}}</h1> <input id="issue-edit-title" class="form-control input-lg pull-left hidden" type="text" value="{{.Issue.Name}}" data-ajax-rel="issue-edit-save" data-ajax-val="val" data-ajax-field="title"/> - <input type="hidden" value="{{.Issue.Id}}" data-ajax-rel="issue-edit-save" data-ajax-val="val" data-ajax-field="issue_id"/> + <input type="hidden" value="{{.Issue.ID}}" data-ajax-rel="issue-edit-save" data-ajax-val="val" data-ajax-field="issue_id"/> <p class="info pull-left"> {{if .IsIssueOwner}}<a class="btn btn-default pull-right issue-edit" href="#" id="issue-edit-btn">Edit</a> <a class="btn btn-danger pull-right issue-edit-cancel hidden" href="#">Cancel</a> @@ -178,7 +178,7 @@ <div class="dropdown-menu dropdown-menu-right no"> <ul class="list-unstyled"> {{range .Labels}} - <li class="{{if not .IsChecked}}no-{{end}}checked" data-id="{{.Id}}"> + <li class="{{if not .IsChecked}}no-{{end}}checked" data-id="{{.ID}}"> {{if .IsChecked}}<span class="check pull-left"><i class="fa fa-check"></i></span>{{end}} <span class="color" style="background-color: {{.Color}}"></span> <span class="name">{{.Name}}</span> @@ -191,7 +191,7 @@ <h4>Labels</h4> {{if .Issue.Labels}} {{range .Issue.Labels}} - <p id="label-{{.Id}}" class="label-item label-white" style="background-color: {{.Color}}"><strong>{{.Name}}</strong></p> + <p id="label-{{.ID}}" class="label-item label-white" style="background-color: {{.Color}}"><strong>{{.Name}}</strong></p> {{end}} {{else}} <p>None yet</p> diff --git a/templates/repo/issue2/labels.tmpl b/templates/repo/issue2/labels.tmpl deleted file mode 100644 index 4044bdb3ee..0000000000 --- a/templates/repo/issue2/labels.tmpl +++ /dev/null @@ -1,74 +0,0 @@ -{{template "ng/base/head" .}} -{{template "ng/base/header" .}} -<div id="repo-wrapper"> - {{template "repo/header_old" .}} - <div class="issue-main container repo-wide-wrapper"> - <ul id="issue-list-nav" class="menu menu-line"> - <li><a href="#">Issue</a></li> - <li><a href="#">Pull Request</a></li> - <li class="current"><a href="#">Labels</a></li> - <li><a href="#">Milestones</a></li> - <li class="right" id="label-new"><a href="#"><button id="label-new-btn" class="btn btn-green text-bold">New Label</button></a></li> - </ul> - <form id="label-add-form" action="#" class="form clear hidden"> - <input type="text" class="ipt" name="name" placeholder="label name" id="label-add-name"/> - <div class="inline down drop label-color-drop"> - <label for="label-add-color"></label> - <input class="ipt" name="color" type="text" placeholder="color" id="label-add-color"/> - <div class="drop-down"> - <a href="#" class="color" style="background: red"></a> - <a href="#" class="color" style="background: green"></a> - </div> - </div> - <button class="btn btn-gray right" type="button" id="label-cancel-btn">Cancel</button> - <button class="btn btn-green right" id="label-add-btn">Create</button> - </form> - <div id="issue-list-container"> - <div id="issue-list-menu"> - <div class="left"><span class="label label-black" id="labels-num">6</span><strong>Labels</strong></div> - <div class="clear"></div> - </div> - <ul id="label-list" class="list-no-style"> - <li class="item" id="label-id"> - <a class="right delete" href="#"><i class="octicon octicon-x"></i>Delete</a> - <a class="right edit" href="#"><i class="octicon octicon-pencil"></i>Edit</a> - <a class="right issue-num" href="#"><i class="octicon octicon-issue-opened"></i><strong class="num">12</strong>Issues</a> - <a class="left label clear" href="#" style="background-color: #0052cc" data-color-hex="#0052cc"><i class="octicon octicon-tag"></i><strong>bug</strong></a> - </li> - <li class="item" id="label-id"> - <a class="right" href="#"><i class="octicon octicon-x"></i>Delete</a> - <a class="right" href="#"><i class="octicon octicon-pencil"></i>Edit</a> - <a class="right issue-num" href="#"><i class="octicon octicon-issue-opened"></i><strong class="num">12</strong>Issues</a> - <a class="left label clear" href="#" style="background-color: red"><i class="octicon octicon-tag"></i><strong>bug</strong></a> - </li> - </ul> - </div> - </div> -</div> -<div id="label-edit-form-tpl" class="hidden"> - <li class="item"><form id="label-edit-form" action="#" class="form clear"> - <input type="text" class="ipt" name="name" placeholder="label name" id="label-edit-name"/> - <input type="hidden" name="id" value="id"/> - <div class="inline down drop label-color-drop"> - <label for="label-add-color"></label> - <input class="ipt" name="color" type="text" placeholder="color" id="label-edit-color"/> - <div class="drop-down"> - <a href="#" class="color" style="background: red"></a> - <a href="#" class="color" style="background: green"></a> - </div> - </div> - <button class="btn btn-gray right" type="button" id="label-edit-cancel-btn">Cancel</button> - <button class="btn btn-green right" id="label-edit-btn">Save Changes</button> - </form></li> -</div> -<div id="label-delete-form-tpl" class="hidden"> - <li class="item"> - <form id="label-delete-form" action="#"> - <input type="hidden" name="id" value="id"/> - <span><strong class="text-red">Are you sure?</strong> Deleting a label will remove it from all issues and pull requests.</span> - <button class="btn btn-gray right" type="button" id="label-del-cancel-btn">Cancel</button> - <button class="btn btn-red right" id="label-del-btn">Delete</button> - </form> - </li> -</div> -{{template "ng/base/footer" .}}
\ No newline at end of file |