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 LATER_THIS_WEEK = 'later_this_week';
|
||||||
const THIS_WEEKEND = 'this_weekend';
|
const THIS_WEEKEND = 'this_weekend';
|
||||||
const NEXT_WEEK = 'next_week';
|
const NEXT_WEEK = 'next_week';
|
||||||
|
const TWO_WEEKS = 'two_weeks';
|
||||||
const NEXT_MONTH = 'next_month';
|
const NEXT_MONTH = 'next_month';
|
||||||
const FOREVER = 'forever';
|
const FOREVER = 'forever';
|
||||||
|
|
||||||
|
@ -46,14 +47,13 @@ export default Combobox.extend({
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (day < 5) {
|
if (day < 5 && this.get('includeWeekend')) {
|
||||||
selections.push({
|
selections.push({
|
||||||
id: THIS_WEEKEND,
|
id: THIS_WEEKEND,
|
||||||
name: I18n.t('topic.auto_update_input.this_weekend')
|
name: I18n.t('topic.auto_update_input.this_weekend')
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (day !== 7) {
|
if (day !== 7) {
|
||||||
selections.push({
|
selections.push({
|
||||||
id: NEXT_WEEK,
|
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()) {
|
if (moment().endOf('month').date() !== now.date()) {
|
||||||
selections.push({
|
selections.push({
|
||||||
id: NEXT_MONTH,
|
id: NEXT_MONTH,
|
||||||
|
@ -127,7 +132,7 @@ export default Combobox.extend({
|
||||||
if (time) {
|
if (time) {
|
||||||
if (state.id === LATER_TODAY) {
|
if (state.id === LATER_TODAY) {
|
||||||
time = time.format('h a');
|
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');
|
time = time.format('MMM D');
|
||||||
} else {
|
} else {
|
||||||
time = time.format('ddd, h a');
|
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);
|
time = time.add(1, 'week').day(1).hour(timeOfDay).minute(0);
|
||||||
icon = 'briefcase';
|
icon = 'briefcase';
|
||||||
break;
|
break;
|
||||||
|
case TWO_WEEKS:
|
||||||
|
time = time.add(2, 'week').hour(timeOfDay).minute(0);
|
||||||
|
icon = 'briefcase';
|
||||||
|
break;
|
||||||
case NEXT_MONTH:
|
case NEXT_MONTH:
|
||||||
time = time.add(1, 'month').startOf('month').hour(timeOfDay).minute(0);
|
time = time.add(1, 'month').startOf('month').hour(timeOfDay).minute(0);
|
||||||
icon = 'briefcase';
|
icon = 'briefcase';
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
statusType=statusType
|
statusType=statusType
|
||||||
value=selection
|
value=selection
|
||||||
input=input
|
input=input
|
||||||
|
includeWeekend=includeWeekend
|
||||||
includeForever=includeForever
|
includeForever=includeForever
|
||||||
width="50%"
|
width="50%"
|
||||||
none="topic.auto_update_input.none"}}
|
none="topic.auto_update_input.none"}}
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
{{future-date-input
|
{{future-date-input
|
||||||
input=updateTime
|
input=updateTime
|
||||||
statusType=selection
|
statusType=selection
|
||||||
|
includeWeekend=true
|
||||||
basedOnLastPost=false}}
|
basedOnLastPost=false}}
|
||||||
{{else if publishToCategory}}
|
{{else if publishToCategory}}
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
|
@ -21,12 +22,14 @@
|
||||||
{{future-date-input
|
{{future-date-input
|
||||||
input=updateTime
|
input=updateTime
|
||||||
statusType=selection
|
statusType=selection
|
||||||
|
includeWeekend=true
|
||||||
categoryId=topicTimer.category_id
|
categoryId=topicTimer.category_id
|
||||||
basedOnLastPost=false}}
|
basedOnLastPost=false}}
|
||||||
{{else if autoClose}}
|
{{else if autoClose}}
|
||||||
{{future-date-input
|
{{future-date-input
|
||||||
input=updateTime
|
input=updateTime
|
||||||
statusType=selection
|
statusType=selection
|
||||||
|
includeWeekend=true
|
||||||
basedOnLastPost=topicTimer.based_on_last_post
|
basedOnLastPost=topicTimer.based_on_last_post
|
||||||
lastPostedAt=model.last_posted_at}}
|
lastPostedAt=model.last_posted_at}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
@ -1568,6 +1568,7 @@ en:
|
||||||
later_this_week: "Later this week"
|
later_this_week: "Later this week"
|
||||||
this_weekend: "This weekend"
|
this_weekend: "This weekend"
|
||||||
next_week: "Next week"
|
next_week: "Next week"
|
||||||
|
two_weeks: "Two Weeks"
|
||||||
next_month: "Next month"
|
next_month: "Next month"
|
||||||
forever: "Forever"
|
forever: "Forever"
|
||||||
pick_date_and_time: "Pick date and time"
|
pick_date_and_time: "Pick date and time"
|
||||||
|
|
Loading…
Reference in New Issue