Skip to content

Commit 2ea0e8b

Browse files
committed
Merge remote-tracking branch 'origin/main' into twgap
* origin/main: Respect DEFAULT_ORG_MEMBER_VISIBLE setting when adding creator to org (go-gitea#30013) Remove jQuery `.attr` from the common global functions (go-gitea#30023) Migrate font-size helpers to tailwind (go-gitea#30029)
2 parents d551be0 + e3e08dc commit 2ea0e8b

File tree

10 files changed

+35
-25
lines changed

10 files changed

+35
-25
lines changed

models/organization/org.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,9 @@ func CreateOrganization(ctx context.Context, org *Organization, owner *user_mode
319319

320320
// Add initial creator to organization and owner team.
321321
if err = db.Insert(ctx, &OrgUser{
322-
UID: owner.ID,
323-
OrgID: org.ID,
322+
UID: owner.ID,
323+
OrgID: org.ID,
324+
IsPublic: setting.Service.DefaultOrgMemberVisible,
324325
}); err != nil {
325326
return fmt.Errorf("insert org-user relation: %w", err)
326327
}

tailwind.config.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,23 @@ export default {
7373
semibold: 'var(--font-weight-semibold)',
7474
bold: 'var(--font-weight-bold)',
7575
},
76+
fontSize: { // not using `rem` units because our root is currently 14px
77+
'xs': '12px',
78+
'sm': '14px',
79+
'base': '16px',
80+
'lg': '18px',
81+
'xl': '20px',
82+
'2xl': '24px',
83+
'3xl': '30px',
84+
'4xl': '36px',
85+
'5xl': '48px',
86+
'6xl': '60px',
87+
'7xl': '72px',
88+
'8xl': '96px',
89+
'9xl': '128px',
90+
...Object.fromEntries(Array.from({length: 100}, (_, i) => {
91+
return [`${i}`, `${i === 0 ? '0' : `${i}px`}`];
92+
})),
93+
},
7694
},
7795
};

templates/org/header.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{{if .Org.Visibility.IsLimited}}<span class="ui large basic horizontal label">{{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}}</span>{{end}}
88
{{if .Org.Visibility.IsPrivate}}<span class="ui large basic horizontal label">{{ctx.Locale.Tr "org.settings.visibility.private_shortname"}}</span>{{end}}
99
</span>
10-
<span class="tw-flex tw-items-center tw-gap-1 tw-ml-auto gt-font-16 tw-whitespace-nowrap">
10+
<span class="tw-flex tw-items-center tw-gap-1 tw-ml-auto tw-text-16 tw-whitespace-nowrap">
1111
{{if .EnableFeed}}
1212
<a class="ui basic label button gt-mr-0" href="{{.Org.HomeLink}}.rss" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">
1313
{{svg "octicon-rss" 24}}

templates/repo/header.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{{template "repo/icon" .}}
88
</div>
99
<div class="flex-item-main">
10-
<div class="flex-item-title gt-font-18">
10+
<div class="flex-item-title tw-text-18">
1111
<a class="muted tw-font-normal" href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a>/<a class="muted" href="{{$.RepoLink}}">{{.Name}}</a>
1212
</div>
1313
</div>

templates/repo/home.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{{template "repo/code/recently_pushed_new_branches" .}}
77
{{if and (not .HideRepoInfo) (not .IsBlame)}}
88
<div class="ui repo-description gt-word-break">
9-
<div id="repo-desc" class="gt-font-16">
9+
<div id="repo-desc" class="tw-text-16">
1010
{{$description := .Repository.DescriptionHTML $.Context}}
1111
{{if $description}}<span class="description">{{$description | RenderCodeBlock}}</span>{{else if .IsRepositoryAdmin}}<span class="no-description text-italic">{{ctx.Locale.Tr "repo.no_desc"}}</span>{{end}}
1212
<a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a>
@@ -29,7 +29,7 @@
2929
</div>
3030
<div class="tw-flex tw-items-center tw-flex-wrap tw-gap-1" id="repo-topics">
3131
{{range .Topics}}<a class="ui repo-topic large label topic gt-m-0" href="{{AppSubUrl}}/explore/repos?q={{.Name}}&topic=1">{{.Name}}</a>{{end}}
32-
{{if and .Permission.IsAdmin (not .Repository.IsArchived)}}<button id="manage_topic" class="btn interact-fg gt-font-12">{{ctx.Locale.Tr "repo.topic.manage_topics"}}</button>{{end}}
32+
{{if and .Permission.IsAdmin (not .Repository.IsArchived)}}<button id="manage_topic" class="btn interact-fg tw-text-12">{{ctx.Locale.Tr "repo.topic.manage_topics"}}</button>{{end}}
3333
</div>
3434
{{end}}
3535
{{if and .Permission.IsAdmin (not .Repository.IsArchived)}}

templates/user/dashboard/feeds.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
<a href="{{.GetCommentLink ctx}}" class="text truncate issue title">{{(.GetIssueTitle ctx) | RenderEmoji $.Context | RenderCodeBlock}}</a>
108108
{{$comment := index .GetIssueInfos 1}}
109109
{{if $comment}}
110-
<div class="markup gt-font-14">{{RenderMarkdownToHtml ctx $comment}}</div>
110+
<div class="markup tw-text-14">{{RenderMarkdownToHtml ctx $comment}}</div>
111111
{{end}}
112112
{{else if .GetOpType.InActions "merge_pull_request"}}
113113
<div class="flex-item-body text black">{{index .GetIssueInfos 1}}</div>

templates/user/notification/notification_div.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@
4444
{{end}}
4545
</div>
4646
<a class="notifications-link tw-flex tw-flex-1 tw-flex-col silenced" href="{{.Link ctx}}">
47-
<div class="notifications-top-row gt-font-13">
47+
<div class="notifications-top-row tw-text-13">
4848
{{.Repository.FullName}} {{if .Issue}}<span class="text light-3">#{{.Issue.Index}}</span>{{end}}
4949
{{if eq .Status 3}}
5050
{{svg "octicon-pin" 13 "text blue gt-mt-1 gt-ml-2"}}
5151
{{end}}
5252
</div>
53-
<div class="notifications-bottom-row gt-font-16 gt-py-1">
53+
<div class="notifications-bottom-row tw-text-16 gt-py-1">
5454
<span class="issue-title">
5555
{{if .Issue}}
5656
{{.Issue.Title | RenderEmoji $.Context | RenderCodeBlock}}

web_src/css/helpers.css

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,6 @@ Gitea's private styles use `g-` prefix.
142142
.gt-py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
143143
.gt-py-5 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
144144

145-
.gt-font-12 { font-size: 12px !important }
146-
.gt-font-13 { font-size: 13px !important }
147-
.gt-font-14 { font-size: 14px !important }
148-
.gt-font-15 { font-size: 15px !important }
149-
.gt-font-16 { font-size: 16px !important }
150-
.gt-font-17 { font-size: 17px !important }
151-
.gt-font-18 { font-size: 18px !important }
152-
153145
/*
154146
gt-hidden must win all other "display: xxx !important" classes to get the chance to "hide" an element.
155147
do not use:

web_src/js/components/RepoContributors.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ export default {
384384
<h4 v-else class="contributor-name">
385385
{{ contributor.name }}
386386
</h4>
387-
<p class="gt-font-12 tw-flex tw-gap-1">
387+
<p class="tw-text-12 tw-flex tw-gap-1">
388388
<strong v-if="contributor.total_commits">{{ contributor.total_commits.toLocaleString() }} {{ locale.contributionType.commits }}</strong>
389389
<strong v-if="contributor.total_additions" class="text green">{{ contributor.total_additions.toLocaleString() }}++ </strong>
390390
<strong v-if="contributor.total_deletions" class="text red">

web_src/js/features/common-global.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ export function initGlobalLinkActions() {
301301
const $this = $(this);
302302
const dataArray = $this.data();
303303
let filter = '';
304-
if ($this.attr('data-modal-id')) {
305-
filter += `#${$this.attr('data-modal-id')}`;
304+
if (this.getAttribute('data-modal-id')) {
305+
filter += `#${this.getAttribute('data-modal-id')}`;
306306
}
307307

308308
const $dialog = $(`.delete.modal${filter}`);
@@ -352,8 +352,7 @@ function initGlobalShowModal() {
352352
// If there is a ".{attr}" part like "data-modal-form.action", then the form's "action" attribute will be set.
353353
$('.show-modal').on('click', function (e) {
354354
e.preventDefault();
355-
const $el = $(this);
356-
const modalSelector = $el.attr('data-modal');
355+
const modalSelector = this.getAttribute('data-modal');
357356
const $modal = $(modalSelector);
358357
if (!$modal.length) {
359358
throw new Error('no modal for this action');
@@ -406,7 +405,7 @@ export function initGlobalButtons() {
406405
// a '.show-panel' element can show a panel, by `data-panel="selector"`
407406
// if it has "toggle" class, it toggles the panel
408407
e.preventDefault();
409-
const sel = $(this).attr('data-panel');
408+
const sel = this.getAttribute('data-panel');
410409
if (this.classList.contains('toggle')) {
411410
toggleElem(sel);
412411
} else {
@@ -417,12 +416,12 @@ export function initGlobalButtons() {
417416
$('.hide-panel').on('click', function (e) {
418417
// a `.hide-panel` element can hide a panel, by `data-panel="selector"` or `data-panel-closest="selector"`
419418
e.preventDefault();
420-
let sel = $(this).attr('data-panel');
419+
let sel = this.getAttribute('data-panel');
421420
if (sel) {
422421
hideElem($(sel));
423422
return;
424423
}
425-
sel = $(this).attr('data-panel-closest');
424+
sel = this.getAttribute('data-panel-closest');
426425
if (sel) {
427426
hideElem($(this).closest(sel));
428427
return;

0 commit comments

Comments
 (0)