Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor UI tweaks #5980

Merged
merged 34 commits into from
Feb 19, 2019
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
5bbf068
Remove all CommitStatus when a repo is deleted
jolheiser Feb 3, 2019
718f5fb
Merge branch 'master' into master
lunny Feb 3, 2019
92b186b
Merge branch 'master' of https://github.com/jolheiser/gitea
Feb 5, 2019
c13cd91
Minor UI tweaks (#5782)
jolheiser Feb 6, 2019
82aa5b5
More UI tweaks
jolheiser Feb 9, 2019
c552a64
Generate stylesheet for arc-green
jolheiser Feb 9, 2019
66cee36
Make gofmt work
jolheiser Feb 9, 2019
c04af27
Change PR integration since the button is changed
jolheiser Feb 9, 2019
619fb11
Rebase
jolheiser Feb 9, 2019
c6e708f
Generate stylesheet
jolheiser Feb 9, 2019
477d07b
UI updates
jolheiser Feb 10, 2019
1e7efd3
Commit to reference related issues
jolheiser Feb 10, 2019
9a60751
Change the comment wording since PR button is no longer little and gr…
jolheiser Feb 10, 2019
b45c05d
Merge branch 'master' of https://github.com/jolheiser/gitea
jolheiser Feb 11, 2019
355d675
Merge remote-tracking branch 'remotes/upstream/master'
jolheiser Feb 11, 2019
afb3b68
Revert changes that made Windows work
jolheiser Feb 12, 2019
84f4de3
Regenerate stylesheet
jolheiser Feb 12, 2019
b340a48
Regenerate stylesheets
jolheiser Feb 12, 2019
eb09a45
make generate-stylesheets
techknowlogick Feb 12, 2019
ca59ae6
Update integration again, changed button style
jolheiser Feb 12, 2019
29ef124
Merge branch 'master' of https://github.com/go-gitea/gitea
jolheiser Feb 12, 2019
4ca9582
Merge branch 'master' of https://github.com/jolheiser/gitea
jolheiser Feb 12, 2019
cec464f
Added ID to PR button
jolheiser Feb 12, 2019
5b8ed96
Added missing semi-colons
jolheiser Feb 12, 2019
e3d566d
Added back distinction between issue actions and filters (overlooked …
jolheiser Feb 12, 2019
3442909
Remove extra tab formatting in list.tmpl
jolheiser Feb 12, 2019
ca0de80
Remove more formatting from GoLand
jolheiser Feb 12, 2019
b803676
Merge branch 'master' of https://github.com/go-gitea/gitea
jolheiser Feb 13, 2019
45f74b4
Replace hardcoded "No License" with i18n license helper.
jolheiser Feb 13, 2019
5dde637
Merge branch 'master' into master
jolheiser Feb 14, 2019
e662c04
Merge branch 'master' of https://github.com/go-gitea/gitea
jolheiser Feb 15, 2019
f9e26bf
Merge branch 'master' of https://github.com/jolheiser/gitea
jolheiser Feb 15, 2019
8355ef8
Merge branch 'master' of https://github.com/go-gitea/gitea
jolheiser Feb 19, 2019
e32153c
Merge branch 'master' into master
lafriks Feb 19, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions integrations/pull_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ func testPullCreate(t *testing.T, session *TestSession, user, repo, branch, titl
req := NewRequest(t, "GET", path.Join(user, repo))
resp := session.MakeRequest(t, req, http.StatusOK)

// Click the little green button to create a pull
// Click the PR button to create a pull
htmlDoc := NewHTMLParser(t, resp.Body)
link, exists := htmlDoc.doc.Find("button.ui.green.tiny.compact.button").Parent().Attr("href")
link, exists := htmlDoc.doc.Find("#new-pull-request").Parent().Attr("href")
assert.True(t, exists, "The template has changed")
if branch != "master" {
link = strings.Replace(link, ":master", ":"+branch, 1)
Expand Down
1 change: 1 addition & 0 deletions modules/context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ func (ctx *Context) NotFound(title string, err error) {
}
}

ctx.Data["IsRepo"] = ctx.Repo.Repository != nil
ctx.Data["Title"] = "Page Not Found"
ctx.HTML(http.StatusNotFound, base.TplName("status/404"))
}
Expand Down
5 changes: 5 additions & 0 deletions modules/context/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,11 @@ func RepoAssignment() macaron.Handler {
ctx.Data["RepoLink"] = ctx.Repo.RepoLink
ctx.Data["RepoRelPath"] = ctx.Repo.Owner.Name + "/" + ctx.Repo.Repository.Name

unit, err := ctx.Repo.Repository.GetUnit(models.UnitTypeExternalTracker)
if err == nil {
ctx.Data["RepoExternalIssuesLink"] = unit.ExternalTrackerConfig().ExternalTrackerURL
}

tags, err := ctx.Repo.GitRepo.GetTags()
if err != nil {
ctx.ServerError("GetTags", err)
Expand Down
2 changes: 1 addition & 1 deletion public/css/index.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/css/theme-arc-green.css

Large diffs are not rendered by default.

50 changes: 34 additions & 16 deletions public/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,22 @@ function initCommentForm() {
var $noSelect = $list.find('.no-select');
var $listMenu = $('.' + selector + ' .menu');
var hasLabelUpdateAction = $listMenu.data('action') == 'update';
var labels = {};

$('.' + selector).dropdown('setting', 'onHide', function(){
hasLabelUpdateAction = $listMenu.data('action') == 'update'; // Update the var
if (hasLabelUpdateAction) {
for (var elementId in labels) {
if (labels.hasOwnProperty(elementId)) {
var label = labels[elementId];
updateIssuesMeta(
label["update-url"],
label["action"],
label["issue-id"],
elementId
);
}
}
location.reload();
}
});
Expand Down Expand Up @@ -308,23 +320,29 @@ function initCommentForm() {
$(this).removeClass('checked');
$(this).find('.octicon').removeClass('octicon-check');
if (hasLabelUpdateAction) {
updateIssuesMeta(
$listMenu.data('update-url'),
"detach",
$listMenu.data('issue-id'),
$(this).data('id')
);
if (!($(this).data('id') in labels)) {
labels[$(this).data('id')] = {
"update-url": $listMenu.data('update-url'),
"action": "detach",
"issue-id": $listMenu.data('issue-id'),
};
} else {
delete labels[$(this).data('id')];
}
}
} else {
$(this).addClass('checked');
$(this).find('.octicon').addClass('octicon-check');
if (hasLabelUpdateAction) {
updateIssuesMeta(
$listMenu.data('update-url'),
"attach",
$listMenu.data('issue-id'),
$(this).data('id')
);
if (!($(this).data('id') in labels)) {
labels[$(this).data('id')] = {
"update-url": $listMenu.data('update-url'),
"action": "attach",
"issue-id": $listMenu.data('issue-id'),
};
} else {
delete labels[$(this).data('id')];
}
}
}

Expand Down Expand Up @@ -1931,11 +1949,11 @@ $(document).ready(function () {
$('.issue-checkbox').click(function() {
var numChecked = $('.issue-checkbox').children('input:checked').length;
if (numChecked > 0) {
$('#issue-filters').hide();
$('#issue-actions').show();
$('#issue-filters').addClass("hide");
$('#issue-actions').removeClass("hide");
} else {
$('#issue-filters').show();
$('#issue-actions').hide();
$('#issue-filters').removeClass("hide");
$('#issue-actions').addClass("hide");
}
});

Expand Down
10 changes: 9 additions & 1 deletion public/less/_repository.less
Original file line number Diff line number Diff line change
Expand Up @@ -1580,10 +1580,18 @@
}
}

#issue-actions {
#issue-filters.hide {
display: none;
}

#issue-actions.hide {
display: none;
}

.ui.checkbox.issue-checkbox {
vertical-align: middle;
}

.issue.list {
list-style: none;
padding-top: 15px;
Expand Down
28 changes: 14 additions & 14 deletions public/less/themes/arc-green.less
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
}
.ui.pagination.menu .active.item {
color: #dbdbdb;
background-color: #609926;
background-color: #87ab63;
}
.repository .header-wrapper {
background-color: #2a2e3a;
Expand Down Expand Up @@ -259,10 +259,10 @@
background: #565454;
}
.ui.blue.button, .ui.blue.buttons .button {
background-color: #609926;
background-color: #87ab63;
}
.ui.blue.button:hover, .ui.blue.buttons .button:hover {
background-color: #73ad36;
background-color: #a0cc75;
}
.ui.form input:not([type]), .ui.form input[type=text], .ui.form input[type=email], .ui.form input[type=search], .ui.form input[type=password], .ui.form input[type=date], .ui.form input[type=datetime-local], .ui.form input[type=tel], .ui.form input[type=time], .ui.form input[type=url], .ui.form input[type=number] {
background: #404552;
Expand All @@ -277,10 +277,10 @@
border-right-color: #4b505f!important;
}
.ui.green.button, .ui.green.buttons .button {
background-color: #609926;
background-color: #87ab63;
}
.ui.green.button:hover, .ui.green.buttons .button:hover {
background-color: #73ad36;
background-color: #a0cc75;
}
.ui.button {
background: #383c4a;
Expand Down Expand Up @@ -476,7 +476,7 @@
border-top: 1px solid #4c505c;
}
.ui .text.blue {
color: #609926 !important;
color: #87ab63 !important;
}
.ui.selection.active.dropdown, .ui.selection.active.dropdown .menu {
border-color: #4e5361;
Expand Down Expand Up @@ -517,7 +517,7 @@
background: #353945;
}
.ui.secondary.pointing.menu .active.item {
border-color: #609926;
border-color: #87ab63;
color: #dbdbdb;
background: #404552;
}
Expand Down Expand Up @@ -693,15 +693,15 @@
color: #7c9b5e;
}
.ui.blue.button:focus, .ui.blue.buttons .button:focus {
background-color: #609926;
background-color: #87ab63;
}
.ui.basic.blue.button:hover, .ui.basic.blue.buttons .button:hover {
box-shadow: 0 0 0 1px #609926 inset!important;
color: #609926!important;
box-shadow: 0 0 0 1px #87ab63 inset!important;
color: #87ab63!important;
}
.ui.basic.blue.button:focus, .ui.basic.blue.buttons .button:focus {
box-shadow: 0 0 0 1px #609926 inset!important;
color: #609926!important;
box-shadow: 0 0 0 1px #87ab63 inset!important;
color: #87ab63!important;
}
.repository.file.list #file-content .code-view .lines-num pre, .repository.file.list #file-content .code-view .lines-code pre, .repository.file.list #file-content .code-view .lines-num ol, .repository.file.list #file-content .code-view .lines-code ol, .repository.file.list #file-content .code-view .lines-num .hljs, .repository.file.list #file-content .code-view .lines-code .hljs {
background-color: #2a2e3a;
Expand Down Expand Up @@ -771,8 +771,8 @@
background: #383c4a;
}
.ui.basic.blue.button, .ui.basic.blue.buttons .button {
box-shadow: 0 0 0 1px #609926 inset!important;
color: #609926!important;
box-shadow: 0 0 0 1px #87ab63 inset!important;
color: #87ab63!important;
}
.editor-toolbar {
background-color: #404552;
Expand Down
7 changes: 7 additions & 0 deletions routers/repo/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,13 @@ func Issues(ctx *context.Context) {
return
}

perm, err := models.GetUserRepoPermission(ctx.Repo.Repository, ctx.User)
if err != nil {
ctx.ServerError("GetUserRepoPermission", err)
return
}
ctx.Data["CanWriteIssuesOrPulls"] = perm.CanWriteIssuesOrPulls(isPullList)

ctx.HTML(200, tplIssues)
}

Expand Down
6 changes: 5 additions & 1 deletion routers/user/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,11 @@ func ResetPasswd(ctx *context.Context) {
return
}
ctx.Data["Code"] = code
ctx.Data["IsResetForm"] = true

if u := models.VerifyUserActiveCode(code); u != nil {
ctx.Data["IsResetForm"] = true
}

ctx.HTML(200, tplResetPassword)
}

Expand Down
1 change: 1 addition & 0 deletions templates/repo/create.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
<input type="hidden" name="license" value="{{.license}}">
<div class="default text">{{.i18n.Tr "repo.license_helper"}}</div>
<div class="menu">
<div class="item" data-value="">{{.i18n.Tr "repo.license_helper"}}</div>
{{range .Licenses}}
<div class="item" data-value="{{.}}">{{.}}</div>
{{end}}
Expand Down
6 changes: 3 additions & 3 deletions templates/repo/header.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</a>
</div>
{{if and (not .IsEmpty) ($.Permission.CanRead $.UnitTypeCode)}}
<div class="ui labeled button" tabindex="0">
<div class="ui labeled button {{if and (not $.CanSignedUserFork) ($.IsSigned)}}disabled{{end}}" tabindex="0">
<a class="ui compact basic button {{if or (not $.IsSigned) (not $.CanSignedUserFork)}}poping up{{end}}" {{if $.CanSignedUserFork}}href="{{AppSubUrl}}/repo/fork/{{.ID}}"{{else if $.IsSigned}} data-content="{{$.i18n.Tr "repo.fork_from_self"}}" {{ else }} data-content="{{$.i18n.Tr "repo.fork_guest_user" }}" href="{{AppSubUrl}}/user/login?redirect_to={{AppSubUrl}}/repo/fork/{{.ID}}" {{end}} data-position="top center" data-variation="tiny">
<i class="octicon octicon-repo-forked"></i>{{$.i18n.Tr "repo.fork"}}
</a>
Expand Down Expand Up @@ -58,8 +58,8 @@
{{end}}

{{if .Permission.CanRead $.UnitTypeExternalTracker}}
<a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues" target="_blank" rel="noopener noreferrer">
<i class="octicon octicon-issue-opened"></i> {{.i18n.Tr "repo.issues"}} </span>
<a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoExternalIssuesLink}}" target="_blank" rel="noopener noreferrer">
<i class="octicon octicon-link-external"></i> {{.i18n.Tr "repo.issues"}} </span>
</a>
{{end}}

Expand Down
20 changes: 12 additions & 8 deletions templates/repo/home.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,21 @@
{{end}}
{{template "repo/sub_menu" .}}
<div class="ui stackable secondary menu mobile--margin-between-items mobile--no-negative-margins">
{{if and .PullRequestCtx.Allowed .IsViewBranch (not .Repository.IsArchived)}}
<div class="fitted item">
<a href="{{.BaseRepo.Link}}/compare/{{.BaseRepo.DefaultBranch | EscapePound}}...{{if ne .Repository.Owner.Name .BaseRepo.Owner.Name}}{{.Repository.Owner.Name}}:{{end}}{{.BranchName | EscapePound}}">
<button class="ui green tiny compact button"><i class="octicon octicon-git-compare"></i></button>
</a>
</div>
{{end}}
{{template "repo/branch_dropdown" .}}
{{ $n := len .TreeNames}}
{{ $l := Subtract $n 1}}
<div class="fitted item"><span class="ui breadcrumb repo-path"><a class="section" href="{{.RepoLink}}/src/{{EscapePound .BranchNameSubURL}}">{{EllipsisString .Repository.Name 30}}</a>{{range $i, $v := .TreeNames}}<span class="divider">/</span>{{if eq $i $l}}<span class="active section">{{EllipsisString $v 30}}</span>{{else}}{{ $p := index $.Paths $i}}<span class="section"><a href="{{EscapePound $.BranchLink}}/{{EscapePound $p}}">{{EllipsisString $v 30}}</a></span>{{end}}{{end}}</span></div>
<!-- If home page, show new PR. If not, show breadcrumb -->
{{if eq $n 0}}
{{if and .PullRequestCtx.Allowed .IsViewBranch (not .Repository.IsArchived)}}
<div class="fitted item">
<a href="{{.BaseRepo.Link}}/compare/{{.BaseRepo.DefaultBranch | EscapePound}}...{{if ne .Repository.Owner.Name .BaseRepo.Owner.Name}}{{.Repository.Owner.Name}}:{{end}}{{.BranchName | EscapePound}}">
<button id="new-pull-request" class="ui compact basic button">{{.i18n.Tr "repo.pulls.compare_changes"}}</button>
</a>
</div>
{{end}}
{{else}}
<div class="fitted item"><span class="ui breadcrumb repo-path"><a class="section" href="{{.RepoLink}}/src/{{EscapePound .BranchNameSubURL}}">{{EllipsisString .Repository.Name 30}}</a>{{range $i, $v := .TreeNames}}<span class="divider">/</span>{{if eq $i $l}}<span class="active section">{{EllipsisString $v 30}}</span>{{else}}{{ $p := index $.Paths $i}}<span class="section"><a href="{{EscapePound $.BranchLink}}/{{EscapePound $p}}">{{EllipsisString $v 30}}</a></span>{{end}}{{end}}</span></div>
{{end}}
<div class="right fitted item" id="file-buttons">
<div class="ui tiny blue buttons">
{{if .Repository.CanEnableEditor}}
Expand Down
25 changes: 19 additions & 6 deletions templates/repo/issue/list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,33 @@
</div>
</div>
</div>
<div id="issue-actions" class="ui stackable grid">
jolheiser marked this conversation as resolved.
Show resolved Hide resolved
<div id="issue-actions" class="ui stackable grid hide">
<div class="six wide column">
<div class="ui basic status buttons">
<div class="ui green active basic button issue-action" data-action="open" data-url="{{$.RepoLink}}/issues/status">{{.i18n.Tr "repo.issues.action_open"}}</div>
<div class="ui red active basic button issue-action" data-action="close" data-url="{{$.RepoLink}}/issues/status">{{.i18n.Tr "repo.issues.action_close"}}</div>
<div class="ui tiny basic status buttons">
<a class="ui {{if not .IsShowClosed}}green active{{end}} basic button" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state=open&labels={{.SelectLabels}}&milestone={{.MilestoneID}}&assignee={{.AssigneeID}}">
<i class="octicon octicon-issue-opened"></i>
{{.i18n.Tr "repo.issues.open_tab" .IssueStats.OpenCount}}
</a>
<a class="ui {{if .IsShowClosed}}red active{{end}} basic button" href="{{$.Link}}?q={{$.Keyword}}&type={{.ViewType}}&sort={{$.SortType}}&state=closed&labels={{.SelectLabels}}&milestone={{.MilestoneID}}&assignee={{.AssigneeID}}">
<i class="octicon octicon-issue-closed"></i>
{{.i18n.Tr "repo.issues.close_tab" .IssueStats.ClosedCount}}
</a>
</div>
</div>

{{/* Ten wide does not cope well and makes the columns stack.
This seems to be related to jQuery's hide/show: in fact, switching
issue-actions and issue-filters and having this ten wide will show
this one correctly, but not the other one. */}}
<div class="nine wide right aligned right floated column">
<div class="ui secondary filter stackable menu">
<!-- Action Button -->
{{if .IsShowClosed}}
<div class="ui green active basic button issue-action" data-action="open" data-url="{{$.RepoLink}}/issues/status" style="margin-left: auto">{{.i18n.Tr "repo.issues.action_open"}}</div>
{{else}}
<div class="ui red active basic button issue-action" data-action="close" data-url="{{$.RepoLink}}/issues/status" style="margin-left: auto">{{.i18n.Tr "repo.issues.action_close"}}</div>
{{end}}
<!-- Labels -->
<div class="ui {{if not .Labels}}disabled{{end}} dropdown jump item" style="margin-left: auto">
<div class="ui {{if not .Labels}}disabled{{end}} dropdown jump item">
<span class="text">
{{.i18n.Tr "repo.issues.action_label"}}
<i class="dropdown icon"></i>
Expand Down Expand Up @@ -182,9 +193,11 @@
<div class="issue list">
{{range .Issues}}
<li class="item">
{{if $.CanWriteIssuesOrPulls}}
<div class="ui checkbox issue-checkbox">
<input type="checkbox" data-issue-id={{.ID}}></input>
</div>
{{end}}
<div class="ui {{if .IsRead}}black{{else}}green{{end}} label">#{{.Index}}</div>
<a class="title has-emoji" href="{{$.Link}}/{{.Index}}">{{.Title}}</a>

Expand Down
1 change: 1 addition & 0 deletions templates/status/404.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{template "base/head" .}}
{{if .IsRepo}}<div class="repository">{{template "repo/header" .}}</div>{{end}}
<div class="ui container center">
<p style="margin-top: 100px"><img src="{{AppSubUrl}}/img/404.png" alt="404"/></p>
<div class="ui divider"></div>
Expand Down