mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 15:32:26 +08:00
UX: Add a two week suspension timeframe
This commit is contained in:
parent
56793d6853
commit
1022535c2b
|
@ -8,6 +8,7 @@ const TOMORROW = 'tomorrow';
|
|||
const LATER_THIS_WEEK = 'later_this_week';
|
||||
const THIS_WEEKEND = 'this_weekend';
|
||||
const NEXT_WEEK = 'next_week';
|
||||
const TWO_WEEKS = 'two_weeks';
|
||||
const NEXT_MONTH = 'next_month';
|
||||
const FOREVER = 'forever';
|
||||
|
||||
|
@ -46,14 +47,13 @@ export default Combobox.extend({
|
|||
});
|
||||
}
|
||||
|
||||
if (day < 5) {
|
||||
if (day < 5 && this.get('includeWeekend')) {
|
||||
selections.push({
|
||||
id: THIS_WEEKEND,
|
||||
name: I18n.t('topic.auto_update_input.this_weekend')
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (day !== 7) {
|
||||
selections.push({
|
||||
id: NEXT_WEEK,
|
||||
|
@ -61,6 +61,11 @@ export default Combobox.extend({
|
|||
});
|
||||
}
|
||||
|
||||
selections.push({
|
||||
id: TWO_WEEKS,
|
||||
name: I18n.t('topic.auto_update_input.two_weeks')
|
||||
});
|
||||
|
||||
if (moment().endOf('month').date() !== now.date()) {
|
||||
selections.push({
|
||||
id: NEXT_MONTH,
|
||||
|
@ -127,7 +132,7 @@ export default Combobox.extend({
|
|||
if (time) {
|
||||
if (state.id === LATER_TODAY) {
|
||||
time = time.format('h a');
|
||||
} else if (state.id === NEXT_MONTH) {
|
||||
} else if (state.id === NEXT_MONTH || state.id === TWO_WEEKS) {
|
||||
time = time.format('MMM D');
|
||||
} else {
|
||||
time = time.format('ddd, h a');
|
||||
|
@ -175,6 +180,10 @@ export default Combobox.extend({
|
|||
time = time.add(1, 'week').day(1).hour(timeOfDay).minute(0);
|
||||
icon = 'briefcase';
|
||||
break;
|
||||
case TWO_WEEKS:
|
||||
time = time.add(2, 'week').hour(timeOfDay).minute(0);
|
||||
icon = 'briefcase';
|
||||
break;
|
||||
case NEXT_MONTH:
|
||||
time = time.add(1, 'month').startOf('month').hour(timeOfDay).minute(0);
|
||||
icon = 'briefcase';
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
statusType=statusType
|
||||
value=selection
|
||||
input=input
|
||||
includeWeekend=includeWeekend
|
||||
includeForever=includeForever
|
||||
width="50%"
|
||||
none="topic.auto_update_input.none"}}
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
{{future-date-input
|
||||
input=updateTime
|
||||
statusType=selection
|
||||
includeWeekend=true
|
||||
basedOnLastPost=false}}
|
||||
{{else if publishToCategory}}
|
||||
<div class="control-group">
|
||||
|
@ -21,12 +22,14 @@
|
|||
{{future-date-input
|
||||
input=updateTime
|
||||
statusType=selection
|
||||
includeWeekend=true
|
||||
categoryId=topicTimer.category_id
|
||||
basedOnLastPost=false}}
|
||||
{{else if autoClose}}
|
||||
{{future-date-input
|
||||
input=updateTime
|
||||
statusType=selection
|
||||
includeWeekend=true
|
||||
basedOnLastPost=topicTimer.based_on_last_post
|
||||
lastPostedAt=model.last_posted_at}}
|
||||
{{/if}}
|
||||
|
|
|
@ -1568,6 +1568,7 @@ en:
|
|||
later_this_week: "Later this week"
|
||||
this_weekend: "This weekend"
|
||||
next_week: "Next week"
|
||||
two_weeks: "Two Weeks"
|
||||
next_month: "Next month"
|
||||
forever: "Forever"
|
||||
pick_date_and_time: "Pick date and time"
|
||||
|
|
Loading…
Reference in New Issue
Block a user