Skip to content

Style and template tweaks #13828

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

Merged
merged 7 commits into from
Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 1 addition & 9 deletions templates/explore/code.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,7 @@
</table>
</div>
</div>
<div class="ui bottom attached table segment">
{{if $result.Language}}
<i class="color-icon" style="background-color: {{$result.Color}}"></i>{{$result.Language}}
{{end}}
&nbsp;
{{if not $result.UpdatedUnix.IsZero}}
<span class="ui small grey text pull right">{{$.i18n.Tr "explore.code_last_indexed_at" (TimeSinceUnix $result.UpdatedUnix $.i18n.Lang) | Safe}} &nbsp;</span>
{{end}}
</div>
{{template "shared/searchbottom" dict "root" $ "result" .}}
</div>
{{end}}
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/issue/new_form.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</a>
<div class="ui segment content">
<div class="field">
<input name="title" id="issue_title" placeholder="{{.i18n.Tr "repo.milestones.title"}}" value="{{if .TitleQuery}}{{.TitleQuery}}{{else if .IssueTemplateTitle}}{{.IssueTemplateTitle}}{{else}}{{.title}}{{end}}" tabindex="3" autofocus required maxlength="255">
<input name="title" id="issue_title" placeholder="{{.i18n.Tr "repo.milestones.title"}}" value="{{if .TitleQuery}}{{.TitleQuery}}{{else if .IssueTemplateTitle}}{{.IssueTemplateTitle}}{{else}}{{.title}}{{end}}" tabindex="3" autofocus required maxlength="255" autocomplete="off">
{{if .PageIsComparePull}}
<div class="title_wip_desc" data-wip-prefixes="{{Json .PullRequestWorkInProgressPrefixes}}">{{.i18n.Tr "repo.pulls.title_wip_desc" (index .PullRequestWorkInProgressPrefixes 0| Escape) | Safe}}</div>
{{end}}
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/issue/view_content/add_reaction.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{if .ctx.IsSigned}}
<div class="item action ui pointing top right select-reaction dropdown" data-action-url="{{ .ActionURL }}">
<div class="item action ui pointing select-reaction dropdown" data-action-url="{{ .ActionURL }}">
<a class="add-reaction">
{{svg "octicon-smiley"}}
</a>
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/issue/view_content/context_menu.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{if .ctx.IsSigned}}
<div class="item action ui pointing top right custom dropdown context-dropdown">
<div class="item action ui pointing custom dropdown context-dropdown">
<a class="context-menu">
{{svg "octicon-kebab-horizontal"}}
</a>
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/issue/view_title.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<span id="issue-title">{{RenderIssueTitle .Issue.Title $.RepoLink $.Repository.ComposeMetas}}</span>
<span class="index">#{{.Issue.Index}}</span>
<div id="edit-title-input" class="ui input" style="display: none">
<input value="{{.Issue.Title}}" maxlength="255">
<input value="{{.Issue.Title}}" maxlength="255" autocomplete="off">
</div>
</h1>
{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .Repository.IsArchived)}}
Expand Down
10 changes: 1 addition & 9 deletions templates/repo/search.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,7 @@
</table>
</div>
</div>
<div class="ui bottom attached table segment">
{{if $result.Language}}
<i class="color-icon" style="background-color: {{$result.Color}}"></i>{{$result.Language}}
{{end}}
&nbsp;
{{if not $result.UpdatedUnix.IsZero}}
<span class="ui small grey text pull right">{{$.i18n.Tr "explore.code_last_indexed_at" (TimeSinceUnix $result.UpdatedUnix $.i18n.Lang) | Safe}} &nbsp;</span>
{{end}}
</div>
{{template "shared/searchbottom" dict "root" $ "result" .}}
</div>
{{end}}
</div>
Expand Down
6 changes: 3 additions & 3 deletions templates/repo/settings/lfs.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<h4 class="ui top attached header">
{{.i18n.Tr "repo.settings.lfs_filelist"}} ({{.i18n.Tr "admin.total" .Total}})
<div class="ui right">
<a class="ui black tiny show-panel button" href="{{.Link}}/locks"><span class="octicon-tiny">{{svg "octicon-lock"}}</span>{{.i18n.Tr "repo.settings.lfs_locks"}}</a>
<a class="ui blue tiny show-panel button" href="{{.Link}}/pointers"><span class="octicon-tiny">{{svg "octicon-search"}}</span>&nbsp;{{.i18n.Tr "repo.settings.lfs_findpointerfiles"}}</a>
<a class="ui tiny show-panel button" href="{{.Link}}/locks"><span class="octicon-tiny">{{svg "octicon-lock"}}</span>{{.i18n.Tr "repo.settings.lfs_locks"}}</a>
<a class="ui primary tiny show-panel button" href="{{.Link}}/pointers"><span class="octicon-tiny">{{svg "octicon-search"}}</span>&nbsp;{{.i18n.Tr "repo.settings.lfs_findpointerfiles"}}</a>
</div>
</h4>
<table id="lfs-files-table" class="ui attached segment single line table">
Expand All @@ -25,7 +25,7 @@
<td>{{FileSize .Size}}</td>
<td>{{TimeSince .CreatedUnix.AsTime $.Lang}}</td>
<td class="right aligned">
<a class="ui blue show-panel button" href="{{$.Link}}/find?oid={{.Oid}}&size={{.Size}}">{{$.i18n.Tr "repo.settings.lfs_findcommits"}}</a>
<a class="ui primary show-panel button" href="{{$.Link}}/find?oid={{.Oid}}&size={{.Size}}">{{$.i18n.Tr "repo.settings.lfs_findcommits"}}</a>
<button class="ui basic show-modal icon button" data-modal="#delete-{{.Oid}}">
<span class="btn-octicon btn-octicon-danger poping up" data-content="{{$.i18n.Tr "repo.editor.delete_this_file"}}" data-position="bottom center" data-variation="tiny inverted">{{svg "octicon-trashcan"}}</span>
</button>
Expand Down
12 changes: 12 additions & 0 deletions templates/shared/searchbottom.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div class="ui bottom attached table segment df ac sb">
<div class="ml-3">
{{if .result.Language}}
<i class="color-icon" style="background-color: {{.result.Color}}"></i>{{.result.Language}}
{{end}}
</div>
<div class="mr-3">
{{if not .result.UpdatedUnix.IsZero}}
<span class="ui grey text">{{.root.i18n.Tr "explore.code_last_indexed_at" (TimeSinceUnix .result.UpdatedUnix .root.i18n.Lang) | Safe}}</span>
{{end}}
</div>
</div>
2 changes: 1 addition & 1 deletion templates/status/404.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content ui container center {{if .IsRepo}}repository{{end}}">
<div class="page-content ui container center full-screen-width {{if .IsRepo}}repository{{end}}">
{{if .IsRepo}}{{template "repo/header" .}}{{end}}
<div class="ui container center">
<p style="margin-top: 100px"><img class="ui centered image" src="{{StaticUrlPrefix}}/img/404.png" alt="404"/></p>
Expand Down
2 changes: 1 addition & 1 deletion templates/status/500.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content ui container center">
<div class="page-content ui container full-screen-width center">
<p style="margin-top: 100px"><img class="ui centered image" src="{{StaticUrlPrefix}}/img/500.png" alt="500"/></p>
<div class="ui divider"></div>
<br>
Expand Down
2 changes: 1 addition & 1 deletion templates/user/dashboard/issues.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
</div>
</form>
</div>
<div class="column right aligned">
<div class="column right aligned df ac je">
<!-- Sort -->
<div class="ui dropdown type jump item">
<span class="text">
Expand Down
60 changes: 37 additions & 23 deletions templates/user/dashboard/repolist.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,15 @@
<a :class="{item: true, active: tab === 'organizations'}" @click="changeTab('organizations')">{{.i18n.Tr "organization"}}</a>
</div>
<div v-show="tab === 'repos'" class="ui tab active list dashboard-repos">
<h4 class="ui top attached header">
{{.i18n.Tr "home.my_repos"}} <span class="ui grey label">${reposTotalCount}</span>
<h4 class="ui top attached header df ac">
<div class="f1 df ac">
{{.i18n.Tr "home.my_repos"}}
<span class="ui grey label ml-3">${reposTotalCount}</span>
</div>
<a class="poping up" :href="suburl + '/repo/create'" data-content="{{.i18n.Tr "new_repo"}}" data-variation="tiny inverted" data-position="left center">
{{svg "octicon-plus"}}
<span class="sr-only">{{.i18n.Tr "new_repo"}}</span>
</a>
</h4>
<div class="ui attached secondary segment repos-search">
<div class="ui fluid right action left icon input" :class="{loading: isLoading}">
Expand Down Expand Up @@ -94,13 +101,16 @@
<div v-if="repos.length" class="ui attached table segment rounded-bottom">
<ul class="repo-owner-name-list">
<li v-for="repo in repos" :class="{'private': repo.private || repo.internal}">
<a :href="suburl + '/' + repo.full_name">
<component v-bind:is="repoIcon(repo)" size="16"></component>
<strong class="text truncate item-name">${repo.full_name}</strong>
<i v-if="repo.archived" class="archive icon archived-icon"></i>
<span class="ui right text light grey">
${repo.stars_count} <span class="rear">{{svg "octicon-star"}}</span>
</span>
<a class="df ac sb" :href="suburl + '/' + repo.full_name">
<div class="f1 df ac">
<component v-bind:is="repoIcon(repo)" size="16"></component>
<strong class="text truncate item-name">${repo.full_name}</strong>
<i v-if="repo.archived" class="archive icon archived-icon"></i>
</div>
<div class="text light grey df ac">
${repo.stars_count}
{{svg "octicon-star" 16 "rear ml-2"}}
</div>
</a>
</li>
<li v-if="showMoreReposLink">
Expand Down Expand Up @@ -129,25 +139,29 @@
</ul>
</div>
</div>
<div v-if="!isOrganization" v-show="tab === 'organizations'" class="ui tab active list">
<h4 class="ui top attached header">
{{.i18n.Tr "home.my_orgs"}} <span class="ui grey label">${organizationsTotalCount}</span>
<div v-if="canCreateOrganization" class="ui right">
<a class="poping up" :href="suburl + '/org/create'" data-content="{{.i18n.Tr "new_org"}}" data-variation="tiny inverted" data-position="left center">
<i class="plus icon"></i>
<span class="sr-only">{{.i18n.Tr "new_org"}}</span>
</a>
<div v-if="!isOrganization" v-show="tab === 'organizations'" class="ui tab active list dashboard-orgs">
<h4 class="ui top attached header df ac">
<div class="f1 df ac">
{{.i18n.Tr "home.my_orgs"}}
<span class="ui grey label ml-3">${organizationsTotalCount}</span>
</div>
<a v-if="canCreateOrganization" class="poping up" :href="suburl + '/org/create'" data-content="{{.i18n.Tr "new_org"}}" data-variation="tiny inverted" data-position="left center">
{{svg "octicon-plus"}}
<span class="sr-only">{{.i18n.Tr "new_org"}}</span>
</a>
</h4>
<div v-if="organizations.length" class="ui attached table segment rounded-bottom">
<ul class="repo-owner-name-list">
<li v-for="org in organizations">
<a :href="suburl + '/' + org.name">
{{svg "octicon-organization"}}
<strong class="text truncate item-name">${org.name}</strong>
<span class="ui right text light grey">
${org.num_repos} <span class="rear">{{svg "octicon-repo"}}</span>
</span>
<a class="df ac sb" :href="suburl + '/' + org.name">
<div class="f1">
{{svg "octicon-organization" 16 "mr-2"}}
<strong class="text truncate item-name">${org.name}</strong>
</div>
<div class="text light grey df ac">
${org.num_repos}
{{svg "octicon-repo" 16 "rear ml-2 mt-1"}}
</div>
</a>
</li>
</ul>
Expand Down
39 changes: 31 additions & 8 deletions web_src/less/_base.less
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
--color-purple: #a333c8;
--color-pink: #e03997;
--color-brown: #a5673f;
--color-grey: #767676;
--color-grey: #888888;
--color-black: #1b1c1d;
--color-gold: #a1882b;
--color-white: #ffffff;
Expand Down Expand Up @@ -97,6 +97,7 @@
--color-markdown-table-row: #00000008;
--color-markdown-code-block: #00000010;
--color-button: #ffffff;
--color-code-bg: #ffffff;
}

:root:lang(ja) {
Expand Down Expand Up @@ -253,6 +254,10 @@ a.muted:hover,
border-color: var(--color-primary);
}

.CodeMirror-focused {
border-color: var(--color-primary) !important;
}

.ui.action.input:not([class*="left action"]) > input:focus {
border-right-color: var(--color-primary);
}
Expand Down Expand Up @@ -288,6 +293,10 @@ a.muted:hover,
background: none;
}

.ui.ui.menu .item.disabled {
color: var(--color-text-light-2);
}

.ui.dropdown .menu {
background: var(--color-menu);
border-color: var(--color-secondary);
Expand All @@ -307,6 +316,8 @@ a.muted:hover,
}

.ui.dropdown .menu .active.item {
color: var(--color-text);
background: var(--color-active);
font-weight: normal;
}

Expand Down Expand Up @@ -523,17 +534,15 @@ a.muted:hover,
flex-direction: inherit;
}

.ui.dropdown:not(.labeled) > .dropdown.icon {
height: 14px;
vertical-align: bottom;
margin-bottom: -2px;
margin-left: .5rem;
}

.ui.dropdown .menu {
border-color: var(--color-secondary);
}

.ui.pagination.menu .active.item {
color: var(--color-text);
background: var(--color-active);
}

.ui.form .field > .selection.dropdown > .dropdown.icon {
height: auto;
}
Expand Down Expand Up @@ -1266,6 +1275,11 @@ a.ui.label:hover {
color: var(--color-text);
}

.ui.basic.labels a.label:hover,
a.ui.basic.label:hover {
background: var(--color-label-hover);
}

.ui.label > .detail .icons {
margin-right: .25em;
}
Expand Down Expand Up @@ -1597,6 +1611,7 @@ a.ui.label:hover {
}

.ui.attached.header {
position: relative;
background: var(--color-box-header);
border-color: var(--color-secondary);

Expand All @@ -1606,6 +1621,14 @@ a.ui.label:hover {
}
}

/* fix misaligned right buttons on box headers */
.ui.attached.header .right {
position: absolute;
right: .78571429rem;
top: 50%;
transform: translateY(-50%);
}

/* https://github.com/go-gitea/gitea/issues/10210 */
.ui.attached.segment ~ .ui.top.attached.header {
margin-top: 1rem;
Expand Down
7 changes: 3 additions & 4 deletions web_src/less/_chroma.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* Background */

.chroma {
background-color: #ffffff;
.chroma,
.lines-code {
background-color: var(--color-code-bg);
}
/* LineTableTD */

Expand Down
3 changes: 2 additions & 1 deletion web_src/less/_dashboard.less
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
}
}

.dashboard-repos {
.dashboard-repos,
.dashboard-orgs {
margin: 0 1px; /* Accomodate for Semantic's 1px hacks on .attached elements */
}

Expand Down
14 changes: 14 additions & 0 deletions web_src/less/_editor.less
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,26 @@
border-color: var(--color-secondary);
}

.editor-toolbar button {
border: none !important;
color: var(--color-text-light);
}

.editor-toolbar button:not(:hover) {
background-color: transparent !important;
}

.editor-toolbar i.separator {
border-left: none;
border-right-color: var(--color-secondary);
}

.editor-toolbar button:hover {
background: var(--color-hover);
}

.editor-toolbar button.active {
background: var(--color-active);
}

.editor-loading {
Expand Down
3 changes: 3 additions & 0 deletions web_src/less/helpers.less
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
word-break: break-all !important;
}

.full-screen-width { width: 100vw !important; }
.full-screen-height { height: 100vw !important; }

.rounded { border-radius: var(--border-radius) !important; }
.rounded-top { border-radius: var(--border-radius) var(--border-radius) 0 0 !important; }
.rounded-bottom { border-radius: 0 0 var(--border-radius) var(--border-radius) !important; }
Expand Down
Loading