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