mirror of https://github.com/go-gitea/gitea.git
Compare commits
7 Commits
2cdda417ce
...
6247864aaf
Author | SHA1 | Date |
---|---|---|
silverwind | 6247864aaf | |
silverwind | f4a743dff0 | |
silverwind | 7c31f74849 | |
silverwind | 3de13aa93f | |
silverwind | 2bd28a7f73 | |
silverwind | f18ad0efa9 | |
wxiaoguang | 7a832ef248 |
|
@ -11,7 +11,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
<div class="tw-p-6">
|
<div class="tw-p-6 tw-text-center">
|
||||||
{{ctx.Locale.Tr "repo.editor.no_changes_to_show"}}
|
{{ctx.Locale.Tr "repo.editor.no_changes_to_show"}}
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<div class="ui compact small menu small-menu-items repo-editor-menu" data-write="write" data-preview="preview" data-diff="diff">
|
<div class="ui compact small menu small-menu-items repo-editor-menu">
|
||||||
<a class="active item" data-tab="write">{{svg "octicon-code"}} {{if .IsNewFile}}{{ctx.Locale.Tr "repo.editor.new_file"}}{{else}}{{ctx.Locale.Tr "repo.editor.edit_file"}}{{end}}</a>
|
<a class="active item" data-tab="write">{{svg "octicon-code"}} {{if .IsNewFile}}{{ctx.Locale.Tr "repo.editor.new_file"}}{{else}}{{ctx.Locale.Tr "repo.editor.edit_file"}}{{end}}</a>
|
||||||
<a class="item" data-tab="preview" data-url="{{.Repository.Link}}/markup" data-context="{{.RepoLink}}/src/{{.BranchNameSubURL}}" data-markup-mode="file">{{svg "octicon-eye"}} {{ctx.Locale.Tr "preview"}}</a>
|
<a class="item" data-tab="preview" data-url="{{.Repository.Link}}/markup" data-context="{{.RepoLink}}/src/{{.BranchNameSubURL}}" data-markup-mode="file">{{svg "octicon-eye"}} {{ctx.Locale.Tr "preview"}}</a>
|
||||||
{{if not .IsNewFile}}
|
{{if not .IsNewFile}}
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
<div class="ui tab segment markup tw-rounded" data-tab="preview">
|
<div class="ui tab segment markup tw-rounded" data-tab="preview">
|
||||||
{{ctx.Locale.Tr "loading"}}
|
{{ctx.Locale.Tr "loading"}}
|
||||||
</div>
|
</div>
|
||||||
<div class="ui tab segment diff edit-diff tw-text-center" data-tab="diff">
|
<div class="ui tab segment diff edit-diff" data-tab="diff">
|
||||||
<div class="tw-p-16"></div>
|
<div class="tw-p-16"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -19,10 +19,10 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<div class="ui top attached tabular menu" data-write="write">
|
<div class="ui compact small menu small-menu-items repo-editor-menu">
|
||||||
<a class="active item" data-tab="write">{{svg "octicon-code" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.editor.new_patch"}}</a>
|
<a class="active item" data-tab="write">{{svg "octicon-code" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.editor.new_patch"}}</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="ui bottom attached active tab segment" data-tab="write">
|
<div class="ui active tab segment tw-rounded tw-p-0" data-tab="write">
|
||||||
<textarea id="edit_area" name="content" class="tw-hidden" data-id="repo-{{.Repository.Name}}-patch"
|
<textarea id="edit_area" name="content" class="tw-hidden" data-id="repo-{{.Repository.Name}}-patch"
|
||||||
data-context="{{.RepoLink}}"
|
data-context="{{.RepoLink}}"
|
||||||
data-line-wrap-extensions="{{.LineWrapExtensions}}">
|
data-line-wrap-extensions="{{.LineWrapExtensions}}">
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
{{template "repo/migrate/helper" .}}
|
{{template "repo/migrate/helper" .}}
|
||||||
<div class="ui cards migrate-entries">
|
<div class="ui cards migrate-entries">
|
||||||
{{range .Services}}
|
{{range .Services}}
|
||||||
<a class="ui card migrate-entry tw-flex tw-items-center tw-rounded" href="{{AppSubUrl}}/repo/migrate?service_type={{.}}&org={{$.Org}}&mirror={{$.Mirror}}">
|
<a class="ui card migrate-entry tw-flex tw-items-center" href="{{AppSubUrl}}/repo/migrate?service_type={{.}}&org={{$.Org}}&mirror={{$.Mirror}}">
|
||||||
{{if eq .Name "github"}}
|
{{if eq .Name "github"}}
|
||||||
{{svg "octicon-mark-github" 184 "tw-p-4"}}
|
{{svg "octicon-mark-github" 184 "tw-p-4"}}
|
||||||
{{else if eq .Name "gitlab"}}
|
{{else if eq .Name "gitlab"}}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<div id="profile-avatar-card" class="ui card tw-rounded">
|
<div id="profile-avatar-card" class="ui card">
|
||||||
<div id="profile-avatar" class="content tw-flex">
|
<div id="profile-avatar" class="content tw-flex">
|
||||||
{{if eq .SignedUserID .ContextUser.ID}}
|
{{if eq .SignedUserID .ContextUser.ID}}
|
||||||
<a class="image" href="{{AppSubUrl}}/user/settings" data-tooltip-content="{{ctx.Locale.Tr "user.change_avatar"}}">
|
<a class="image" href="{{AppSubUrl}}/user/settings" data-tooltip-content="{{ctx.Locale.Tr "user.change_avatar"}}">
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
{{ctx.Locale.Tr "notification.watching"}}
|
{{ctx.Locale.Tr "notification.watching"}}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="ui top attached active tab segment">
|
<div class="ui top attached segment">
|
||||||
{{if eq .Status 1}}
|
{{if eq .Status 1}}
|
||||||
<div class="tw-flex tw-justify-between">
|
<div class="tw-flex tw-justify-between">
|
||||||
<div class="tw-flex">
|
<div class="tw-flex">
|
||||||
|
|
|
@ -435,10 +435,6 @@ a.label,
|
||||||
box-shadow: 1px 1px 0 0 var(--color-secondary);
|
box-shadow: 1px 1px 0 0 var(--color-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.ui.modal .actions {
|
|
||||||
border-radius: 0 0 var(--border-radius) var(--border-radius);
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui.comments .comment .text {
|
.ui.comments .comment .text {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
border: 1px solid var(--color-secondary);
|
border: 1px solid var(--color-secondary);
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
|
border-radius: var(--border-radius);
|
||||||
}
|
}
|
||||||
|
|
||||||
.ui.card {
|
.ui.card {
|
||||||
|
|
|
@ -799,3 +799,23 @@
|
||||||
.ui.segment .ui.tabular.menu .active.item:hover {
|
.ui.segment .ui.tabular.menu .active.item:hover {
|
||||||
background: var(--color-box-body);
|
background: var(--color-box-body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.small-menu-items {
|
||||||
|
min-height: 35.4px !important; /* match .small.button in height */
|
||||||
|
background: none !important; /* fomantic sets a color here which does not play well with active transparent color on the item, so unset and set the colors on the item */
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.small-menu-items .item {
|
||||||
|
background: var(--color-menu) !important;
|
||||||
|
padding-top: 6px !important;
|
||||||
|
padding-bottom: 6px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.small-menu-items .item:hover {
|
||||||
|
background: var(--color-hover) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.small-menu-items .item.active {
|
||||||
|
background: var(--color-active) !important;
|
||||||
|
}
|
||||||
|
|
|
@ -54,6 +54,7 @@ These inconsistent layouts should be refactored to simple ones.
|
||||||
.ui.modal form > .content {
|
.ui.modal form > .content {
|
||||||
padding: 1.5em;
|
padding: 1.5em;
|
||||||
background: var(--color-body);
|
background: var(--color-body);
|
||||||
|
border-radius: 0 0 var(--border-radius) var(--border-radius);
|
||||||
}
|
}
|
||||||
|
|
||||||
.ui.modal > .actions,
|
.ui.modal > .actions,
|
||||||
|
@ -63,6 +64,7 @@ These inconsistent layouts should be refactored to simple ones.
|
||||||
border-color: var(--color-secondary);
|
border-color: var(--color-secondary);
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
|
border-radius: 0 0 var(--border-radius) var(--border-radius);
|
||||||
}
|
}
|
||||||
|
|
||||||
.ui.modal .content > .actions {
|
.ui.modal .content > .actions {
|
||||||
|
|
|
@ -25,25 +25,6 @@
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.small-menu-items {
|
|
||||||
min-height: 35.4px !important; /* match .small.button in height */
|
|
||||||
background: none !important; /* fomantic sets a color here which does not play well with active transparent color on the item, so unset and set the colors on the item */
|
|
||||||
}
|
|
||||||
|
|
||||||
.small-menu-items .item {
|
|
||||||
background: var(--color-menu) !important;
|
|
||||||
padding-top: 6px !important;
|
|
||||||
padding-bottom: 6px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.small-menu-items .item:hover {
|
|
||||||
background: var(--color-hover) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.small-menu-items .item.active {
|
|
||||||
background: var(--color-active) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 767.98px) {
|
@media (max-width: 767.98px) {
|
||||||
.list-header-search {
|
.list-header-search {
|
||||||
order: 0;
|
order: 0;
|
||||||
|
|
|
@ -9,7 +9,7 @@ import {POST} from '../modules/fetch.js';
|
||||||
function initEditPreviewTab($form) {
|
function initEditPreviewTab($form) {
|
||||||
const $tabMenu = $form.find('.repo-editor-menu');
|
const $tabMenu = $form.find('.repo-editor-menu');
|
||||||
$tabMenu.find('.item').tab();
|
$tabMenu.find('.item').tab();
|
||||||
const $previewTab = $tabMenu.find(`.item[data-tab="${$tabMenu.data('preview')}"]`);
|
const $previewTab = $tabMenu.find('a[data-tab="preview"]');
|
||||||
if ($previewTab.length) {
|
if ($previewTab.length) {
|
||||||
$previewTab.on('click', async function () {
|
$previewTab.on('click', async function () {
|
||||||
const $this = $(this);
|
const $this = $(this);
|
||||||
|
@ -24,13 +24,15 @@ function initEditPreviewTab($form) {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append('mode', mode);
|
formData.append('mode', mode);
|
||||||
formData.append('context', context);
|
formData.append('context', context);
|
||||||
formData.append('text', $form.find(`.tab[data-tab="${$tabMenu.data('write')}"] textarea`).val());
|
formData.append('text', $form.find('.tab[data-tab="write"] textarea').val());
|
||||||
formData.append('file_path', $treePathEl.val());
|
formData.append('file_path', $treePathEl.val());
|
||||||
try {
|
try {
|
||||||
const response = await POST($this.data('url'), {data: formData});
|
const response = await POST($this.data('url'), {data: formData});
|
||||||
const data = await response.text();
|
const data = await response.text();
|
||||||
const $previewPanel = $form.find(`.tab[data-tab="${$tabMenu.data('preview')}"]`);
|
const $previewPanel = $form.find('.tab[data-tab="preview"]');
|
||||||
renderPreviewPanelContent($previewPanel, data);
|
if ($previewPanel.length) {
|
||||||
|
renderPreviewPanelContent($previewPanel, data);
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error:', error);
|
console.error('Error:', error);
|
||||||
}
|
}
|
||||||
|
@ -175,10 +177,10 @@ export function initRepoEditor() {
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
|
|
||||||
export function renderPreviewPanelContent($panelPreviewer, data) {
|
export function renderPreviewPanelContent($previewPanel, data) {
|
||||||
$panelPreviewer.html(data);
|
$previewPanel.html(data);
|
||||||
initMarkupContent();
|
initMarkupContent();
|
||||||
|
|
||||||
const $refIssues = $panelPreviewer.find('p .ref-issue');
|
const $refIssues = $previewPanel.find('p .ref-issue');
|
||||||
attachRefIssueContextPopup($refIssues);
|
attachRefIssueContextPopup($refIssues);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue