diff --git a/src/views/status/Status.vue b/src/views/status/Status.vue index 74bb3881..e79b5a80 100644 --- a/src/views/status/Status.vue +++ b/src/views/status/Status.vue @@ -54,7 +54,40 @@
- +
+ {{ status.spoiler_text }} + Show more + Show less +
+ +
+
    +
  • + {{ option.title }} + +
  • +
+
+
+ +
+
+ +
+
+ +
+
    +
  • + {{ option.title }} + +
  • +
+
+
+ +
+
@@ -66,13 +99,18 @@ import moment from 'moment' export default { - name: 'Statuses', + name: 'Status', props: { status: { type: Object, required: true } }, + data() { + return { + showHiddenStatus: false + } + }, methods: { capitalizeFirstLetter(str) { return str.charAt(0).toUpperCase() + str.slice(1) @@ -98,6 +136,13 @@ export default { }) }) }, + optionPercent(poll, pollOption) { + const allVotes = poll.options.reduce((acc, option) => (acc + option.votes_count), 0) + if (allVotes === 0) { + return 0 + } + return +(pollOption.votes_count / allVotes * 100).toFixed(1) + }, parseTimestamp(timestamp) { return moment(timestamp).format('YYYY-MM-DD HH:mm') } @@ -106,66 +151,78 @@ export default { diff --git a/src/views/users/show.vue b/src/views/users/show.vue index 049ae02f..829f7ebd 100644 --- a/src/views/users/show.vue +++ b/src/views/users/show.vue @@ -70,22 +70,8 @@ - - - {{ status.spoiler_text }} -

-

-
    -
  • - {{ option.title }} - -
  • -
-
-
- -
-
+ +
@@ -94,8 +80,11 @@