mirror of
https://github.com/discourse/discourse.git
synced 2025-06-18 03:12:32 +08:00
UX: more compact local-dates preview (#7305)
This commit is contained in:
@ -22,7 +22,7 @@ $d-popover-border: $primary-medium;
|
|||||||
#d-popover {
|
#d-popover {
|
||||||
background-color: $d-popover-background;
|
background-color: $d-popover-background;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: z("tooltip");
|
z-index: z("modal", "tooltip");
|
||||||
border-color: $d-popover-border;
|
border-color: $d-popover-border;
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
border-width: 1px;
|
border-width: 1px;
|
||||||
|
@ -43,7 +43,6 @@ export default Ember.Component.extend({
|
|||||||
if (markup) {
|
if (markup) {
|
||||||
cookAsync(markup).then(result => {
|
cookAsync(markup).then(result => {
|
||||||
this.set("currentPreview", result);
|
this.set("currentPreview", result);
|
||||||
|
|
||||||
Ember.run.schedule("afterRender", () =>
|
Ember.run.schedule("afterRender", () =>
|
||||||
this.$(".preview .discourse-local-date").applyLocalDates()
|
this.$(".preview .discourse-local-date").applyLocalDates()
|
||||||
);
|
);
|
||||||
|
@ -1,18 +1,17 @@
|
|||||||
{{#d-modal-body
|
{{#d-modal-body
|
||||||
title="discourse_local_dates.create.modal_title"
|
title="discourse_local_dates.create.modal_title"
|
||||||
subtitle="discourse_local_dates.create.modal_subtitle"
|
|
||||||
class="discourse-local-dates-create-modal"
|
class="discourse-local-dates-create-modal"
|
||||||
style="overflow: auto"}}
|
style="overflow: auto"}}
|
||||||
|
|
||||||
<div class="form">
|
<div class="form">
|
||||||
{{#unless isValid}}
|
{{#unless isValid}}
|
||||||
<div class="alert alert-error">
|
<div class="validation-error alert alert-error">
|
||||||
{{i18n "discourse_local_dates.create.form.invalid_date"}}
|
{{i18n "discourse_local_dates.create.form.invalid_date"}}
|
||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
<div class="preview alert alert-info">
|
<div class="preview alert alert-info">
|
||||||
<b>{{i18n "discourse_local_dates.create.form.preview_for" timezone=currentUserTimezone}}</b>
|
<b>{{i18n "discourse_local_dates.create.form.preview_for" timezone=currentUserTimezone}}</b>
|
||||||
<span>{{currentPreview}}</span>
|
{{currentPreview}}
|
||||||
</div>
|
</div>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
|
|
||||||
@ -87,7 +86,6 @@
|
|||||||
onSelect=(action (mut timezone))}}
|
onSelect=(action (mut timezone))}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -57,9 +57,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.discourse-local-dates-create-modal {
|
.discourse-local-dates-create-modal {
|
||||||
min-height: 200px;
|
min-height: 250px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
padding: 0.5em;
|
||||||
|
|
||||||
.form {
|
.form {
|
||||||
flex: 1 0 0px;
|
flex: 1 0 0px;
|
||||||
@ -94,7 +95,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
padding-top: 0.5em;
|
padding-top: 0.5em;
|
||||||
margin: 0 1em;
|
margin: 0 0.5em;
|
||||||
font-size: $font-up-2;
|
font-size: $font-up-2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -115,13 +116,13 @@
|
|||||||
.timezone {
|
.timezone {
|
||||||
margin-left: 1em;
|
margin-left: 1em;
|
||||||
.timezone-input {
|
.timezone-input {
|
||||||
width: 180px;
|
width: 160px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.time {
|
.time {
|
||||||
.time-input {
|
.time-input {
|
||||||
width: 80px;
|
width: auto;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@ -132,11 +133,20 @@
|
|||||||
.preview {
|
.preview {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
margin-bottom: 1em;
|
margin-bottom: 0.5em;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0.5em;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
b {
|
||||||
|
margin-right: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.validation-error {
|
b + p {
|
||||||
color: $danger;
|
margin: 0;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.recurrence {
|
.recurrence {
|
||||||
@ -146,6 +156,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.validation-error {
|
||||||
|
margin-bottom: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
.format {
|
.format {
|
||||||
.format-input {
|
.format-input {
|
||||||
width: 280px;
|
width: 280px;
|
||||||
@ -176,6 +190,11 @@
|
|||||||
|
|
||||||
@media (max-width: 700px) {
|
@media (max-width: 700px) {
|
||||||
.discourse-local-dates-create-modal {
|
.discourse-local-dates-create-modal {
|
||||||
|
.from,
|
||||||
|
.to {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.form {
|
.form {
|
||||||
.date-time-configuration {
|
.date-time-configuration {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@ -191,7 +210,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.to-indicator {
|
.to-indicator {
|
||||||
margin: 0.5em 1em;
|
margin: 0 0.5em;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.date {
|
||||||
|
.date-input {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.time {
|
||||||
|
.time-input {
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ en:
|
|||||||
title: Insert date
|
title: Insert date
|
||||||
create:
|
create:
|
||||||
modal_title: Insert date
|
modal_title: Insert date
|
||||||
modal_subtitle: "We will automatically convert the date and time to the viewer’s local time zone."
|
|
||||||
form:
|
form:
|
||||||
insert: Insert
|
insert: Insert
|
||||||
advanced_mode: Advanced mode
|
advanced_mode: Advanced mode
|
||||||
|
Reference in New Issue
Block a user