diff options
| author | Roger Braun <roger@rogerbraun.net> | 2016-10-28 18:08:03 +0200 |
|---|---|---|
| committer | Roger Braun <roger@rogerbraun.net> | 2016-10-28 18:08:03 +0200 |
| commit | 5f690145755c3972268e2750808ac98dcc17af90 (patch) | |
| tree | 3d733fd50366a96fb06fe4d9119f81119b807543 /src/components/status | |
| parent | 7b92ca6f9406fc93868273c7fd755f92443cb0be (diff) | |
Basic attachments, some retweet fixes.
Diffstat (limited to 'src/components/status')
| -rw-r--r-- | src/components/status/status.js | 21 | ||||
| -rw-r--r-- | src/components/status/status.vue | 20 |
2 files changed, 29 insertions, 12 deletions
diff --git a/src/components/status/status.js b/src/components/status/status.js index ad08d9b7..2842ef0f 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -1,5 +1,24 @@ +import Attachment from '../attachment/attachment.vue' + const Status = { - props: [ 'status' ] + props: [ 'statusoid' ], + data: () => ({ + nsfw: true + }), + computed: { + retweet () { return !!this.statusoid.retweeted_status }, + retweeter () { return this.statusoid.user.name }, + status () { + if (this.retweet) { + return this.statusoid.retweeted_status + } else { + return this.statusoid + } + } + }, + components: { + Attachment + } } export default Status diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 6ced1af5..04a55f67 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -1,11 +1,11 @@ <template> <div class="status-el"> - <div ng-if="retweet" class="media container retweet-info"> + <div v-if="retweet" class="media container retweet-info"> <div class="media-left"> <i class='fa fa-retweet'></i> </div> <div class="media-body"> - Retweeted by {{status.user.screen_name}} + Retweeted by {{retweeter}} </div> </div> <div class="media status container" ng-class="{compact: compact, notify: notify}"> @@ -15,24 +15,22 @@ </a> </div> <div class="media-body"> - <h4 ng-if="!compact" class="media-heading"> + <h4 class="media-heading"> <strong>{{status.user.name}}</strong> <small>{{status.user.screen_name}}</small> - <small ng-if="status.in_reply_to_screen_name"> > {{status.in_reply_to_screen_name}}</small> + <small v-if="status.in_reply_to_screen_name"> > {{status.in_reply_to_screen_name}}</small> - - <small ng-click="goToConversation(status.statusnet_conversation_id)">{{status.created_at_parsed | date:'medium'}}</small> + <small>{{status.created_at_parsed}}</small> </h4> - <p>{{status.text}}</p> + <div v-html="status.statusnet_html"></div> - <div ng-if='status.attachments' class='attachments'> - <attachment nsfw="nsfw" attachment="attachment" ng-repeat="attachment in status.attachments"> + <div v-if='status.attachments' class='attachments'> + <attachment :nsfw="nsfw" :attachment="attachment" v-for="attachment in status.attachments"> </attachment> </div> - <div ng-if="!compact"> - <p> - </p> + <div> <div class='status-actions'> <div ng-click="toggleReplying()"> <i class='fa fa-reply'></i> |
