mirror of
https://github.com/discourse/discourse.git
synced 2025-03-04 09:38:39 +08:00
UX: improve history modal layout (#23675)
This commit is contained in:
parent
db558dc3fc
commit
bbb4e19612
@ -1,7 +1,7 @@
|
|||||||
<div id="revisions" data-post-id={{@model.post_id}} class={{@hiddenClasses}}>
|
<div id="revisions" data-post-id={{@model.post_id}} class={{@hiddenClasses}}>
|
||||||
{{#if @model.title_changes}}
|
{{#if @model.title_changes}}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<h2>{{html-safe @titleDiff}}</h2>
|
<h2 class="revision__title">{{html-safe @titleDiff}}</h2>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if @mobileView}}
|
{{#if @mobileView}}
|
||||||
@ -39,15 +39,20 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if @model.tags_changes}}
|
{{#if @model.tags_changes}}
|
||||||
<div class="row">
|
<div class="row -tag-revisions">
|
||||||
{{i18n "tagging.changed"}}
|
<span class="discourse-tags">
|
||||||
{{#each @previousTagChanges as |t|}}
|
{{#each @previousTagChanges as |t|}}
|
||||||
{{discourse-tag t.name style=(if t.deleted "diff-del")}}
|
{{discourse-tag t.name extraClass=(if t.deleted "diff-del")}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
</span>
|
||||||
|
{{#if (and @mobileView @previousTagChanges @currentTagChanges)}}
|
||||||
→
|
→
|
||||||
|
{{/if}}
|
||||||
|
<span class="discourse-tags">
|
||||||
{{#each @currentTagChanges as |t|}}
|
{{#each @currentTagChanges as |t|}}
|
||||||
{{discourse-tag t.name style=(if t.inserted "diff-ins")}}
|
{{discourse-tag t.name extraClass=(if t.inserted "diff-ins")}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if @model.featured_link_changes}}
|
{{#if @model.featured_link_changes}}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<div id="revision-controls">
|
<div id="revision-controls">
|
||||||
|
<div class="revision-controls--back">
|
||||||
<DButton
|
<DButton
|
||||||
class="btn-default first-revision"
|
class="btn-default first-revision"
|
||||||
@action={{@loadFirstVersion}}
|
@action={{@loadFirstVersion}}
|
||||||
@ -13,11 +14,13 @@
|
|||||||
@title="post.revisions.controls.previous"
|
@title="post.revisions.controls.previous"
|
||||||
@disabled={{@loadPreviousDisabled}}
|
@disabled={{@loadPreviousDisabled}}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
<div id="revision-numbers" class={{unless @displayRevisions "invisible"}}>
|
<div id="revision-numbers" class={{unless @displayRevisions "invisible"}}>
|
||||||
<ConditionalLoadingSpinner @condition={{@loading}} @size="small">
|
<ConditionalLoadingSpinner @condition={{@loading}} @size="small">
|
||||||
{{html-safe @revisionsText}}
|
{{html-safe @revisionsText}}
|
||||||
</ConditionalLoadingSpinner>
|
</ConditionalLoadingSpinner>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="revision-controls--forward">
|
||||||
<DButton
|
<DButton
|
||||||
class="btn-default next-revision"
|
class="btn-default next-revision"
|
||||||
@action={{@loadNextVersion}}
|
@action={{@loadNextVersion}}
|
||||||
@ -33,6 +36,7 @@
|
|||||||
@disabled={{@loadLastDisabled}}
|
@disabled={{@loadLastDisabled}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="revision-footer-buttons">
|
<div id="revision-footer-buttons">
|
||||||
{{#if @displayEdit}}
|
{{#if @displayEdit}}
|
||||||
|
@ -35,6 +35,9 @@ export function defaultRenderTag(tag, params) {
|
|||||||
if (siteSettings.tag_style || params.style) {
|
if (siteSettings.tag_style || params.style) {
|
||||||
classes.push(params.style || siteSettings.tag_style);
|
classes.push(params.style || siteSettings.tag_style);
|
||||||
}
|
}
|
||||||
|
if (params.extraClass) {
|
||||||
|
classes.push(params.extraClass);
|
||||||
|
}
|
||||||
if (params.size) {
|
if (params.size) {
|
||||||
classes.push(params.size);
|
classes.push(params.size);
|
||||||
}
|
}
|
||||||
|
@ -12,23 +12,59 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#revision {
|
#revision {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding-bottom: 0.5em;
|
||||||
|
align-items: center;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
border-bottom: 3px solid var(--primary-low);
|
border-bottom: 3px solid var(--primary-low);
|
||||||
}
|
}
|
||||||
|
|
||||||
table.markdown > tbody > tr > td,
|
|
||||||
.revision-content {
|
|
||||||
width: 47.5%;
|
|
||||||
float: left;
|
|
||||||
min-height: 1px;
|
|
||||||
|
|
||||||
&:nth-of-type(2) {
|
|
||||||
margin-left: 5%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#revision-details {
|
#revision-details {
|
||||||
padding: 5px;
|
display: flex;
|
||||||
|
align-items: baseline;
|
||||||
|
gap: 0.5em;
|
||||||
|
.d-icon {
|
||||||
|
align-self: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.revision__title,
|
||||||
|
.body-diff,
|
||||||
|
table.markdown > tbody > tr,
|
||||||
|
.-tag-revisions {
|
||||||
|
--gap-width: 1rem;
|
||||||
|
display: flex;
|
||||||
|
gap: 0 var(--gap-width);
|
||||||
|
}
|
||||||
|
|
||||||
|
.revision__title {
|
||||||
|
margin: 0;
|
||||||
|
line-height: var(--line-height-medium);
|
||||||
|
}
|
||||||
|
|
||||||
|
.-tag-revisions span,
|
||||||
|
.revision-content {
|
||||||
|
flex: 0 0 calc(50% - (var(--gap-width) / 2));
|
||||||
|
}
|
||||||
|
|
||||||
|
table.markdown {
|
||||||
|
tbody {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#revision-controls {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
.btn {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[class^="revision-controls--"] {
|
||||||
|
display: flex;
|
||||||
|
gap: 0 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#revisions {
|
#revisions {
|
||||||
@ -53,6 +89,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#revision-footer-buttons {
|
||||||
|
display: flex;
|
||||||
|
gap: 0.5em;
|
||||||
|
button {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ins,
|
ins,
|
||||||
.diff-ins {
|
.diff-ins {
|
||||||
code,
|
code,
|
||||||
@ -126,7 +170,7 @@
|
|||||||
padding: 3px 5px 5px 5px;
|
padding: 3px 5px 5px 5px;
|
||||||
}
|
}
|
||||||
.d-icon-ban {
|
.d-icon-ban {
|
||||||
color: #f00;
|
color: var(--danger);
|
||||||
}
|
}
|
||||||
.hidden-revision-either {
|
.hidden-revision-either {
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
|
@ -7,21 +7,6 @@
|
|||||||
.modal-body {
|
.modal-body {
|
||||||
height: 70vh;
|
height: 70vh;
|
||||||
}
|
}
|
||||||
#revision-controls {
|
|
||||||
.btn[disabled] {
|
|
||||||
cursor: not-allowed;
|
|
||||||
background-color: var(--primary-low);
|
|
||||||
}
|
|
||||||
.btn-danger[disabled] {
|
|
||||||
background-color: var(--danger-medium);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#revision {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding-bottom: 0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
#revisions {
|
#revisions {
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
@ -46,14 +31,10 @@
|
|||||||
}
|
}
|
||||||
.markdown {
|
.markdown {
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
font-size: var(--font-down-1);
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
border-spacing: 0;
|
border-spacing: 0;
|
||||||
td {
|
td {
|
||||||
width: 50%;
|
|
||||||
vertical-align: top;
|
|
||||||
max-width: 440px;
|
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
}
|
}
|
||||||
@ -65,12 +46,8 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.modal-header {
|
|
||||||
height: 42px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.modal-footer {
|
.modal-footer {
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,14 @@
|
|||||||
.modal.history-modal {
|
.modal.history-modal {
|
||||||
button {
|
|
||||||
float: none;
|
|
||||||
}
|
|
||||||
.modal-body {
|
.modal-body {
|
||||||
height: 62vh;
|
height: 62vh;
|
||||||
}
|
}
|
||||||
.modal-inner-container {
|
.modal-inner-container {
|
||||||
min-height: 400px;
|
min-height: 400px;
|
||||||
}
|
}
|
||||||
#revision-numbers {
|
|
||||||
line-height: var(--line-height-large);
|
|
||||||
}
|
|
||||||
img {
|
img {
|
||||||
max-width: 95%;
|
box-sizing: border-box;
|
||||||
|
max-width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
.revision-content {
|
.revision-content {
|
||||||
@ -23,12 +19,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal-footer {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
#revision-controls {
|
#revision-controls {
|
||||||
margin-bottom: 5px;
|
width: 100%;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#revision-footer-buttons {
|
#revision-footer-buttons {
|
||||||
@ -36,4 +30,8 @@
|
|||||||
@extend .btn-small;
|
@extend .btn-small;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.-tag-revisions {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -4229,7 +4229,6 @@ en:
|
|||||||
other_tags: "Other Tags"
|
other_tags: "Other Tags"
|
||||||
selector_all_tags: "all tags"
|
selector_all_tags: "all tags"
|
||||||
selector_no_tags: "no tags"
|
selector_no_tags: "no tags"
|
||||||
changed: "tags changed:"
|
|
||||||
tags: "Tags"
|
tags: "Tags"
|
||||||
choose_for_topic: "optional tags"
|
choose_for_topic: "optional tags"
|
||||||
choose_for_topic_required:
|
choose_for_topic_required:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user