Commit 79d4c893 authored by Juan Manuel Solaro's avatar Juan Manuel Solaro

(feat) add custom time when posting, creating and editing blog and when editing activity

1 merge request!494WIP: epic/post-scheduler
Pipeline #76358592 pending with stages
......@@ -112,7 +112,7 @@
(validThreshold)="validThreshold = $event"
#thresholdInput
></m-wire-threshold-input>
<m-poster-date-selector [date]="publishDate" (dateChange)="onPublishDateChange($event)"></m-poster-date-selector>
<m-poster-date-selector [date]="publication_date" (dateChange)="onPublicationDateChange($event)"></m-poster-date-selector>
</div>
<div class="mdl-cell mdl-cell--12-col m-blog-edit--metadata mdl-color-text--blue-grey-200" *ngIf="blog.custom_meta">
......
......@@ -68,7 +68,7 @@ export class BlogEdit {
@ViewChild('thresholdInput', { static: false }) thresholdInput: WireThresholdInputComponent;
@ViewChild('hashtagsSelector', { static: false }) hashtagsSelector: HashtagsSelectorComponent;
protected publishDate: any;
protected publication_date: any;
constructor(
public session: Session,
......@@ -201,6 +201,8 @@ export class BlogEdit {
if (!this.blog.license)
this.blog.license = '';
this.publication_date = response.blog.publication_date || null;
}
});
}
......@@ -246,6 +248,8 @@ export class BlogEdit {
blog.mature = blog.mature ? 1: 0;
blog.monetization = blog.monetization ? 1: 0;
blog.monetized = blog.monetized ? 1: 0;
blog.publication_date = this.publication_date || null;
this.editing = false;
this.inProgress = true;
this.canSave = false;
......@@ -254,6 +258,7 @@ export class BlogEdit {
.then((response: any) => {
this.inProgress = false;
this.canSave = true;
this.publication_date = null;
if (response.status !== 'success') {
this.error = response.message;
......@@ -326,7 +331,7 @@ export class BlogEdit {
}
}
onPublishDateChange(newDate){
this.publishDate = newDate;
onPublicationDateChange(newDate){
this.publication_date = newDate;
}
}
......@@ -119,7 +119,7 @@
</ng-container>
<m-wire-threshold-input [(threshold)]="activity.wire_threshold" [(enabled)]="activity.paywall"></m-wire-threshold-input>
<m-poster-date-selector [date]="publishDate" (dateChange)="onPublishDateChange($event)"></m-poster-date-selector>
<m-poster-date-selector [date]="publication_date" (dateChange)="onPublicationDateChange($event)"></m-poster-date-selector>
<button class="mdl-button mdl-button--raised mdl-color--blue-grey-100" (click)="messageEdit.value = activity.message; editing=false;" i18n="@@M__ACTION__CANCEL">Cancel</button>
<button class="mdl-button mdl-button--colored mdl-button--raised" (click)="activity.message = messageEdit.value; save();" i18n="@@M__ACTION__SAVE">Save</button>
</div>
......
......@@ -101,7 +101,7 @@ export class Activity implements OnInit {
@ViewChild('player', { static: false }) player: MindsVideoComponent;
protected publishDate: any;
protected publication_date: any;
constructor(
public session: Session,
......@@ -172,6 +172,8 @@ export class Activity implements OnInit {
this.translationService.isTranslatable(this.activity) ||
(this.activity.remind_object && this.translationService.isTranslatable(this.activity.remind_object))
);
this.publication_date = this.activity.publication_date || null;
}
getOwnerIconTime() {
......@@ -193,6 +195,7 @@ export class Activity implements OnInit {
console.log('trying to save your changes to the server', this.activity);
this.editing = false;
this.activity.edited = true;
this.activity.publication_date = this.publication_date || null;
let data = this.activity;
if (this.attachment.has()) {
......@@ -439,7 +442,7 @@ export class Activity implements OnInit {
this.cd.detectChanges();
}
onPublishDateChange(newDate){
this.publishDate = newDate;
onPublicationDateChange(newDate){
this.publication_date = newDate;
}
}
......@@ -84,7 +84,7 @@
(validThreshold)="validThreshold = $event"
></m-wire-threshold-input>
<m-poster-date-selector [date]="publishDate" (dateChange)="onPublishDateChange($event)"></m-poster-date-selector>
<m-poster-date-selector [date]="publication_date" (dateChange)="onPublicationDateChange($event)"></m-poster-date-selector>
<button
type="submit"
......
......@@ -50,7 +50,7 @@ export class PosterComponent {
protected resizeSubject: Subject<number> = new Subject<number>();
protected publishDate: any;
protected publication_date: any;
constructor(
public session: Session,
......@@ -171,6 +171,8 @@ export class PosterComponent {
return;
}
this.meta.publication_date = this.publication_date || null;
this.errorMessage = "";
let data = Object.assign(this.meta, this.attachment.exportMeta());
......@@ -185,6 +187,7 @@ export class PosterComponent {
this.attachment.reset();
this.meta = { wire_threshold: null };
this.inProgress = false;
this.publication_date = null;
})
.catch((e) => {
this.inProgress = false;
......@@ -275,7 +278,7 @@ export class PosterComponent {
this.attachment.setNSFW(reasons);
}
onPublishDateChange(newDate){
this.publishDate = newDate;
onPublicationDateChange(newDate){
this.publication_date = newDate;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment