-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Even more repo rework #15005
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
Even more repo rework #15005
Changes from 3 commits
64e7404
04aa913
80f5df0
a57ad3b
7828478
ddd682b
74c9c4e
53f423e
a8e2c1b
e4bd476
d906f8d
369de45
e157b18
a214a2a
6696e22
273844b
2ea73dd
37babb5
26faaea
abf804e
4738cab
238b2c7
e35f158
43633cc
9ab3cd8
1c297f4
d8f78bc
80e48fd
59a2fdf
42302eb
db83962
00d5dbd
91f5d80
34ffae5
31ab7f0
b886f89
0a40ced
46c81ef
386e815
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,10 +9,10 @@ | |
</h4> | ||
|
||
<div class="ui attached table segment"> | ||
<table class="ui very basic striped fixed table single line"> | ||
<table class="ui very basic striped fixed table single line unstackable table"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are two |
||
<tbody> | ||
<tr> | ||
<td> | ||
<td class="six wide"> | ||
{{range .Branches}} | ||
{{if eq .Name $.DefaultBranch}} | ||
{{if .IsProtected}} | ||
|
@@ -23,7 +23,7 @@ | |
{{end}} | ||
{{end}} | ||
</td> | ||
<td class="right aligned overflow-visible"> | ||
<td class="two wide right aligned overflow-visible"> | ||
<div class="ui basic jump dropdown icon button poping up" data-content="{{$.i18n.Tr "repo.branch.download" ($.DefaultBranch)}}" data-variation="tiny inverted" data-position="top right"> | ||
<i class="download icon"></i> | ||
<div class="menu"> | ||
|
@@ -42,7 +42,7 @@ | |
{{.i18n.Tr "repo.branches"}} | ||
</h4> | ||
<div class="ui attached table segment"> | ||
<table class="ui very basic striped fixed table single line"> | ||
<table class="ui very basic striped fixed single line unstackable table"> | ||
<tbody> | ||
{{range .Branches}} | ||
{{if ne .Name $.DefaultBranch}} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,36 @@ | |
{{template "repo/header" .}} | ||
<div class="ui container {{if .IsBlame}}fluid padded{{end}}"> | ||
{{template "base/alert" .}} | ||
<div class="ui repo-description"> | ||
<div id="repo-desc"> | ||
{{if .Repository.DescriptionHTML}}<span class="description">{{.Repository.DescriptionHTML}}</span>{{else if .IsRepositoryAdmin}}<span class="no-description text-italic">{{.i18n.Tr "repo.no_desc"}}</span>{{end}} | ||
<a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a> | ||
<div class="ui stackable secondary menu repo-description mb-0"> | ||
<div class="fitted item repo-desc-wrapper"> | ||
<div id="repo-desc"> | ||
{{if .Repository.DescriptionHTML}}<span class="description">{{.Repository.DescriptionHTML}}</span>{{else if .IsRepositoryAdmin}}<span class="no-description text-italic">{{.i18n.Tr "repo.no_desc"}}</span>{{end}} | ||
<a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a> | ||
</div> | ||
<div id="repo-topics"> | ||
{{range .Topics}}<a class="ui repo-topic large label topic" href="{{AppSubUrl}}/explore/repos?q={{.Name}}&topic=1">{{.Name}}</a>{{end}} | ||
{{if and .Permission.IsAdmin (not .Repository.IsArchived)}}<a id="manage_topic" class="muted">{{.i18n.Tr "repo.topic.manage_topics"}}</a>{{end}} | ||
</div> | ||
{{if and .Permission.IsAdmin (not .Repository.IsArchived)}} | ||
<div class="ui repo-topic-edit form" id="topic_edit" style="display:none"> | ||
<div class="field"> | ||
<div class="ui action input"> | ||
<div class="ui fluid multiple search selection dropdown pr-3"> | ||
<input type="hidden" name="topics" value="{{range $i, $v := .Topics}}{{.Name}}{{if lt (Add $i 1) (len $.Topics)}},{{end}}{{end}}"> | ||
{{- range .Topics -}} | ||
<a class="ui small label topic transition visible" data-value="{{.Name}}" style="display: inline-block !important;">{{.Name}}{{svg "octicon-x" 16 "delete icon"}}</a> | ||
{{- end -}} | ||
<div class="text"></div> | ||
</div> | ||
<a class="ui button primary" href="javascript:;" id="save_topic" data-link="{{.RepoLink}}/topics">{{.i18n.Tr "repo.topic.done"}}</a> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this ugly |
||
</div> | ||
</div> | ||
</div> | ||
{{end}} | ||
<div class="mb-3"></div> | ||
</div> | ||
{{if .RepoSearchEnabled}} | ||
<div class="ui repo-search"> | ||
<div class="fitted item mb-4" id="repo-search"> | ||
<form class="ui form ignore-dirty" action="{{.RepoLink}}/search" method="get"> | ||
<div class="field"> | ||
<div class="ui action input"> | ||
|
@@ -23,29 +46,6 @@ | |
</div> | ||
{{end}} | ||
</div> | ||
<div class="mt-3" id="repo-topics"> | ||
{{range .Topics}}<a class="ui repo-topic large label topic" href="{{AppSubUrl}}/explore/repos?q={{.Name}}&topic=1">{{.Name}}</a>{{end}} | ||
{{if and .Permission.IsAdmin (not .Repository.IsArchived)}}<a id="manage_topic" class="muted">{{.i18n.Tr "repo.topic.manage_topics"}}</a>{{end}} | ||
</div> | ||
{{if and .Permission.IsAdmin (not .Repository.IsArchived)}} | ||
<div class="ui repo-topic-edit grid form" id="topic_edit" style="display:none"> | ||
<div class="fourteen wide column"> | ||
<div class="field"> | ||
<div class="ui fluid multiple search selection dropdown"> | ||
<input type="hidden" name="topics" value="{{range $i, $v := .Topics}}{{.Name}}{{if lt (Add $i 1) (len $.Topics)}},{{end}}{{end}}"> | ||
{{range .Topics}} | ||
<div class="ui small label topic transition visible" data-value="{{.Name}}" style="display: inline-block !important; cursor: default;">{{.Name}}{{svg "octicon-x" 16 "delete icon ml-3 mt-1"}}</div> | ||
{{end}} | ||
<div class="text"></div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="two wide column"> | ||
<a class="ui button primary" href="javascript:;" id="save_topic" | ||
data-link="{{.RepoLink}}/topics">{{.i18n.Tr "repo.topic.done"}}</a> | ||
</div> | ||
</div> | ||
{{end}} | ||
<div class="hide" id="validate_prompt"> | ||
<span id="count_prompt">{{.i18n.Tr "repo.topic.count_prompt"}}</span> | ||
<span id="format_prompt">{{.i18n.Tr "repo.topic.format_prompt"}}</span> | ||
|
@@ -56,14 +56,14 @@ | |
</div> | ||
{{end}} | ||
{{template "repo/sub_menu" .}} | ||
<div class="ui stackable secondary menu mobile--margin-between-items mobile--no-negative-margins"> | ||
<div class="ui secondary menu flex-wrappable fw"> | ||
{{template "repo/branch_dropdown" .}} | ||
{{ $n := len .TreeNames}} | ||
{{ $l := Subtract $n 1}} | ||
<!-- If home page, show new PR. If not, show breadcrumb --> | ||
{{if eq $n 0}} | ||
{{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}} | ||
<div class="fitted item mx-0"> | ||
<div class="fitted item"> | ||
<a href="{{.BaseRepo.Link}}/compare/{{.BaseRepo.DefaultBranch | EscapePound}}...{{if ne .Repository.Owner.Name .BaseRepo.Owner.Name}}{{.Repository.Owner.Name}}{{if .BaseRepo.IsFork}}/{{.Repository.Name}}{{end}}:{{end}}{{.BranchName | EscapePound}}"> | ||
<button id="new-pull-request" class="ui compact basic button">{{if .PullRequestCtx.Allowed}}{{.i18n.Tr "repo.pulls.compare_changes"}}{{else}}{{.i18n.Tr "action.compare_branch"}}{{end}}</button> | ||
</a> | ||
|
@@ -72,7 +72,7 @@ | |
{{else}} | ||
<div class="fitted item"><span class="ui breadcrumb repo-path"><a class="section" href="{{.RepoLink}}/src/{{EscapePound .BranchNameSubURL}}" title="{{.Repository.Name}}">{{EllipsisString .Repository.Name 30}}</a>{{range $i, $v := .TreeNames}}<span class="divider">/</span>{{if eq $i $l}}<span class="active section" title="{{$v}}">{{EllipsisString $v 30}}</span>{{else}}{{ $p := index $.Paths $i}}<span class="section"><a href="{{EscapePound $.BranchLink}}/{{EscapePound $p}}" title="{{$v}}">{{EllipsisString $v 30}}</a></span>{{end}}{{end}}</span></div> | ||
{{end}} | ||
<div class="right fitted item mr-0" id="file-buttons"> | ||
<div class="right fitted item" id="file-buttons"> | ||
<div class="ui tiny primary buttons"> | ||
{{if .Repository.CanEnableEditor}} | ||
{{if .CanAddFile}} | ||
|
@@ -94,18 +94,18 @@ | |
</div> | ||
|
||
</div> | ||
<div class="fitted item"> | ||
{{if eq $n 0}} | ||
{{if .Repository.IsTemplate}} | ||
{{if eq $n 0}} | ||
{{if .Repository.IsTemplate}} | ||
<div class="fitted item"> | ||
<div class="ui tiny blue buttons"> | ||
<a href="{{AppSubUrl}}/repo/create?template_id={{.Repository.ID}}" class="ui button"> | ||
{{.i18n.Tr "repo.use_template"}} | ||
</a> | ||
</div> | ||
{{end}} | ||
</div> | ||
{{end}} | ||
</div> | ||
<div class="fitted item"> | ||
{{end}} | ||
<div class="right fitted item"> | ||
<!-- Only show clone panel in repository home page --> | ||
{{if eq $n 0}} | ||
<div class="ui action tiny input" id="clone-panel"> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
<div class="ui detail icon button"> | ||
<div class="ui detail icon mini button"> | ||
{{if .verification.Verified}} | ||
<div title="{{if eq .verification.TrustStatus "trusted"}}{{else if eq .verification.TrustStatus "untrusted"}}{{$.root.i18n.Tr "repo.commits.signed_by_untrusted_user"}}: {{else}}{{$.root.i18n.Tr "repo.commits.signed_by_untrusted_user_unmatched"}}: {{end}}{{.verification.Reason}}"> | ||
{{if ne .verification.SigningUser.ID 0}} | ||
{{svg "gitea-lock"}} | ||
{{svg "gitea-lock" 12}} | ||
{{avatar .verification.SigningUser 28 "signature"}} | ||
{{else}} | ||
<span title="{{$.root.i18n.Tr "gpg.default_key"}}">{{svg "gitea-lock-cog"}}</span> | ||
<span title="{{$.root.i18n.Tr "gpg.default_key"}}">{{svg "gitea-lock-cog" 12}}</span> | ||
{{avatarByEmail .verification.SigningEmail "" 28 "signature"}} | ||
{{end}} | ||
</div> | ||
{{else}} | ||
<span title="{{$.root.i18n.Tr .verification.Reason}}">{{svg "gitea-unlock"}}</span> | ||
<span title="{{$.root.i18n.Tr .verification.Reason}}">{{svg "gitea-unlock" 12}}</span> | ||
{{end}} | ||
</div> |
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -3562,8 +3562,11 @@ function initTopicbar() { | |||||||||||||
blue: true, | ||||||||||||||
basic: true, | ||||||||||||||
}, | ||||||||||||||
templates: { | ||||||||||||||
label: (_, text, preserveHTML, __) => $.fn.dropdown.settings.templates.escape(text, preserveHTML) + svg('octicon-x', 16, 'delete icon'), | ||||||||||||||
}, | ||||||||||||||
className: { | ||||||||||||||
label: 'ui small label' | ||||||||||||||
label: 'ui small label topic' | ||||||||||||||
}, | ||||||||||||||
apiSettings: { | ||||||||||||||
url: `${AppSubUrl}/api/v1/topics/search?q={query}`, | ||||||||||||||
|
@@ -3630,7 +3633,12 @@ function initTopicbar() { | |||||||||||||
if (!status) { | ||||||||||||||
topics.last().removeClass('green').addClass('red'); | ||||||||||||||
} | ||||||||||||||
return status && topicDropdown.children('a.ui.label.red').length === 0; | ||||||||||||||
if (topicDropdown.children('a.ui.label.red').length > 0) { | ||||||||||||||
saveBtn.removeClass('primary').addClass('grey').addClass('disabled'); | ||||||||||||||
} else { | ||||||||||||||
saveBtn.addClass('primary').removeClass('grey').removeClass('disabled'); | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
} | ||||||||||||||
return status && !saveBtn.hasClass('disabled'); | ||||||||||||||
}; | ||||||||||||||
|
||||||||||||||
topicForm.form({ | ||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1390,6 +1390,23 @@ i.icon.centerlock { | |
color: var(--color-text-light); | ||
} | ||
|
||
.ui.active.label { | ||
background: var(--color-secondary); | ||
border-color: var(--color-secondary); | ||
color: var(--color-text-dark); | ||
} | ||
|
||
.ui.active.label:hover, | ||
a.ui.active.label:hover { | ||
background: var(--color-secondary-dark-1); | ||
color: var(--color-text-dark); | ||
} | ||
|
||
.ui.form .field.error .ui.multiple.selection.dropdown > .red.label { | ||
color: #e7b6b6 !important; | ||
background: #871717 !important; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should use some vars here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I invented these colors as I said in OP. I meant exactly this by "formalizing" - they have to fit into some scheme. I'd rather not use extra long names for this single use instance. I just didn't spot on cases where these colors could be shared... yet. Any suggestions? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That would mean we'd better go deeper and override more stuff from Fomantic UI, which was not the main goal of this PR. Of course, since we are on it, I'll see what I can do. I mean to put all colors used in Semantic Dropdown into |
||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we maybe not use nested syntax to override fomantic? I prefer plain selectors in this case because it's easiert to search exact selector strings in fomantic source and just copy from there. Nested syntax would break this searching. |
||
.ui.labels a.label:hover, | ||
a.ui.label:hover { | ||
background: var(--color-hover); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ | |
} | ||
|
||
.ui.tags { | ||
margin-top: -.5rem; | ||
margin-bottom: .5rem; | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is personal taste: I don't want to have
<svg>
elements generated bysvg.js
andhelper.go
to have different order of class names. I originally planned to deduplicate the class names (like insvg.js
) but that would add unnecessary costs with no added benefit.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should move
regexp.MustCompile
out of the function to not compile the regex every function call.