0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Added post revision sidebar list (#16666)

no issue

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
copilot:summary
This commit is contained in:
Ronald Langeveld 2023-04-18 16:10:41 +01:00 committed by GitHub
parent 540de8eafd
commit 30535eb8f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 70 deletions

View file

@ -33,72 +33,22 @@
</div>
<div class="settings-menu-content">
<ul class="nav-list">
{{#each this.post.postRevisions as |revision|}}
<li class="nav-list-item">
<button type="button">
<div class="flex items-center">
<span class="gh-post-history-version">17 April 2023, 10:34</span>
<span class="gh-post-history-version-current">Current</span>
<span class="gh-post-history-version-wordcount">
<span class="added">+275</span>
<span class="subtracted">-73</span>
</span>
</div>
<span class="gh-post-history-version-meta">Jamie Larson</span>
</button>
</li>
<li class="nav-list-item">
<button type="button">
<div class="flex items-center">
<span class="gh-post-history-version">17 April 2023, 10:34</span>
<span class="gh-post-history-version-wordcount">
<span class="added">+275</span>
<span class="subtracted">-73</span>
</span>
</div>
<span class="gh-post-history-version-meta">Jamie Larson</span>
</button>
</li>
<li class="nav-list-item">
<button type="button">
<div class="flex items-center">
<span class="gh-post-history-version">17 April 2023, 10:34</span>
<span class="gh-post-history-version-wordcount">
<span class="added">+275</span>
<span class="subtracted">-73</span>
</span>
</div>
<span class="gh-post-history-version-meta">Jamie Larson</span>
</button>
</li>
<li class="nav-list-item">
<button type="button">
<div class="flex items-center">
<span class="gh-post-history-version">17 April 2023, 10:34</span>
<span class="gh-post-history-version-wordcount">
<span class="added">+275</span>
<span class="subtracted">-73</span>
</span>
</div>
<span class="gh-post-history-version-meta">Jamie Larson</span>
</button>
</li>
<li class="nav-list-item">
<button type="button">
<div class="flex items-center">
<span class="gh-post-history-version">17 April 2023, 10:34</span>
<span class="gh-post-history-version">{{moment-from-now revision.createdAt}}</span>
<span class="gh-post-history-version-wordcount">
<span class="added">+275</span>
<span class="subtracted">-73</span>
</span>
</div>
<span class="gh-post-history-version-meta">Jamie Larson</span>
<span class="gh-post-history-version-meta">{{revision.author.name}}</span>
</button>
</li>
{{/each}}
</ul>
</div>
{{!-- {{#each this.post.postRevisions as |revision|}}
<div>{{revision.lexical}}</div>
{{/each}} --}}
</div>
</div>
</div>

View file

@ -84,4 +84,7 @@ export default ModalComponent.extend({
post: this.model
};
}
// get reversedPosts() {
// return this.post.toArray().reverse();
// }
});

View file

@ -1,17 +1,9 @@
import Ember from 'ember';
import Model, {attr} from '@ember-data/model';
import ValidationEngine from 'ghost-admin/mixins/validation-engine';
import {inject} from 'ghost-admin/decorators/inject';
import Model, {attr, belongsTo} from '@ember-data/model';
// ember-cli-shims doesn't export these so we must get them manually
const {Comparable} = Ember;
export default Model.extend(Comparable, ValidationEngine, {
config: inject(),
displayName: 'post_revision',
validationType: 'post_revision',
lexical: attr('string'),
title: attr('string')
});
export default class PostRevisionModel extends Model {
@belongsTo('post') post;
@attr('string') lexical;
@attr('string') title;
@attr('moment-utc') createdAt;
@belongsTo('user') author;
}