From e621be1428f844a39fdb0bf44ff6d0f2af7ff253 Mon Sep 17 00:00:00 2001
From: Shpuld Shpuldson <shpuld@gmail.com>
Date: Tue, 30 May 2017 00:24:08 +0300
Subject: Cut notification header length from 3 lines to 1.

---
 src/components/notifications/notifications.vue | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

(limited to 'src/components/notifications/notifications.vue')

diff --git a/src/components/notifications/notifications.vue b/src/components/notifications/notifications.vue
index a326e9cd..9d9028ad 100644
--- a/src/components/notifications/notifications.vue
+++ b/src/components/notifications/notifications.vue
@@ -12,17 +12,28 @@
             <img class='avatar' :src="notification.action.user.profile_image_url_original">
           </a>
           <div class='text'>
-            <timeago :since="notification.action.created_at" :auto-update="240"></timeago>
             <div v-if="notification.type === 'favorite'">
-              <h1>{{ notification.action.user.name }}<br><i class="fa icon-star"></i> favorited your <router-link :to="{ name: 'conversation', params: { id: notification.status.id } }">status</router-link></h1>
-              <p>{{ notification.status.text }}</p>
+              <h1>
+                {{ notification.action.user.name }}
+                <i class="fa icon-star"></i>
+                <small><router-link :to="{ name: 'conversation', params: { id: notification.status.id } }"><timeago :since="notification.action.created_at" :auto-update="240"></timeago></router-link></small>
+              </h1>
+            <p>{{ notification.status.text }}</p>
             </div>
             <div v-if="notification.type === 'repeat'">
-              <h1>{{ notification.action.user.name }}<br><i class="fa icon-retweet"></i> repeated your <router-link :to="{ name: 'conversation', params: { id: notification.status.id } }">status</router-link></h1>
-              <p>{{ notification.status.text }}</p>
+              <h1>
+                {{ notification.action.user.name }}
+                <i class="fa icon-retweet"></i>
+                <small><router-link :to="{ name: 'conversation', params: { id: notification.status.id } }"><timeago :since="notification.action.created_at" :auto-update="240"></timeago></router-link></small>
+              </h1>
+            <p>{{ notification.status.text }}</p>
             </div>
             <div v-if="notification.type === 'mention'">
-              <h1>{{ notification.action.user.name }}<br><i class="fa icon-reply"></i> <router-link :to="{ name: 'conversation', params: { id: notification.status.id } }">mentioned</router-link> you</h1>
+                <h1>
+                  {{ notification.action.user.name }}
+                  <i class="fa icon-reply"></i>
+                  <small><router-link :to="{ name: 'conversation', params: { id: notification.status.id } }"><timeago :since="notification.action.created_at" :auto-update="240"></timeago></router-link></small>
+                </h1>
               <p>{{ notification.status.text }}</p>
             </div>
           </div>
-- 
cgit v1.2.3-70-g09d2


From 5ad4d043e7514a26a395cf72215a74362c4ca2e0 Mon Sep 17 00:00:00 2001
From: Shpuld Shpuldson <shpuld@gmail.com>
Date: Wed, 31 May 2017 11:47:18 +0300
Subject: Enable reply/rt/fav for mention notifications by using a barebones
 status in place of plain notification content.

---
 src/components/notifications/notifications.js   |  5 +++++
 src/components/notifications/notifications.scss |  4 ++--
 src/components/notifications/notifications.vue  | 20 ++++++++++----------
 src/components/status/status.js                 |  3 ++-
 src/components/status/status.vue                | 17 ++++++++++++++++-
 5 files changed, 35 insertions(+), 14 deletions(-)

(limited to 'src/components/notifications/notifications.vue')

diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js
index c8d5e212..c0c86c68 100644
--- a/src/components/notifications/notifications.js
+++ b/src/components/notifications/notifications.js
@@ -1,3 +1,5 @@
+import Status from '../status/status.vue'
+
 import { sortBy, take, filter } from 'lodash'
 
 const Notifications = {
@@ -23,6 +25,9 @@ const Notifications = {
       return this.unseenNotifications.length
     }
   },
+  components: {
+    Status
+  },
   watch: {
     unseenCount (count) {
       if (count > 0) {
diff --git a/src/components/notifications/notifications.scss b/src/components/notifications/notifications.scss
index 5619c2d8..f02ced8d 100644
--- a/src/components/notifications/notifications.scss
+++ b/src/components/notifications/notifications.scss
@@ -45,11 +45,11 @@
       word-wrap: break-word;
       line-height:18px;
 
-      .icon-retweet {
+      .icon-retweet.lit {
         color: $green;
       }
 
-      .icon-reply {
+      .icon-reply.lit {
         color: $blue;
       }
 
diff --git a/src/components/notifications/notifications.vue b/src/components/notifications/notifications.vue
index 9d9028ad..256d6f7a 100644
--- a/src/components/notifications/notifications.vue
+++ b/src/components/notifications/notifications.vue
@@ -11,30 +11,30 @@
           <a :href="notification.action.user.statusnet_profile_url">
             <img class='avatar' :src="notification.action.user.profile_image_url_original">
           </a>
-          <div class='text'>
+          <div class='text' style="width: 100%;">
             <div v-if="notification.type === 'favorite'">
               <h1>
                 {{ notification.action.user.name }}
                 <i class="fa icon-star"></i>
                 <small><router-link :to="{ name: 'conversation', params: { id: notification.status.id } }"><timeago :since="notification.action.created_at" :auto-update="240"></timeago></router-link></small>
               </h1>
-            <p>{{ notification.status.text }}</p>
+            <div v-html="notification.status.statusnet_html"></div>
             </div>
             <div v-if="notification.type === 'repeat'">
               <h1>
                 {{ notification.action.user.name }}
-                <i class="fa icon-retweet"></i>
+                <i class="fa icon-retweet lit"></i>
                 <small><router-link :to="{ name: 'conversation', params: { id: notification.status.id } }"><timeago :since="notification.action.created_at" :auto-update="240"></timeago></router-link></small>
               </h1>
-            <p>{{ notification.status.text }}</p>
+            <div v-html="notification.status.statusnet_html"></div>
             </div>
             <div v-if="notification.type === 'mention'">
-                <h1>
-                  {{ notification.action.user.name }}
-                  <i class="fa icon-reply"></i>
-                  <small><router-link :to="{ name: 'conversation', params: { id: notification.status.id } }"><timeago :since="notification.action.created_at" :auto-update="240"></timeago></router-link></small>
-                </h1>
-              <p>{{ notification.status.text }}</p>
+              <h1>
+                {{ notification.action.user.name }}
+                <i class="fa icon-reply lit"></i>
+                <small><router-link :to="{ name: 'conversation', params: { id: notification.status.id } }"><timeago :since="notification.action.created_at" :auto-update="240"></timeago></router-link></small>
+              </h1>
+              <status :compact="true" :statusoid="notification.status"></status>
             </div>
           </div>
         </div>
diff --git a/src/components/status/status.js b/src/components/status/status.js
index 5e7bde53..183838a8 100644
--- a/src/components/status/status.js
+++ b/src/components/status/status.js
@@ -12,7 +12,8 @@ const Status = {
     'expandable',
     'inConversation',
     'focused',
-    'highlight'
+    'highlight',
+    'compact'
   ],
   data: () => ({
     replying: false,
diff --git a/src/components/status/status.vue b/src/components/status/status.vue
index db33a200..e06fc29a 100644
--- a/src/components/status/status.vue
+++ b/src/components/status/status.vue
@@ -1,5 +1,20 @@
 <template>
-  <div class="status-el base00-background base03-border" v-if="!status.deleted" v-bind:class="[{ 'base01-background': isFocused }, { 'status-conversation': inConversation }]" >
+  <div class="status-el base00-background" v-if="compact">
+    <div @click.prevent="linkClicked" class="status-content" v-html="status.statusnet_html"></div>
+    <div v-if="loggedIn">
+      <div class='status-actions'>
+        <div>
+          <a href="#" v-on:click.prevent="toggleReplying">
+            <i class="fa icon-reply" :class="{'icon-reply-active': replying}"></i>
+          </a>
+        </div>
+        <retweet-button :status=status></retweet-button>
+        <favorite-button :status=status></favorite-button>
+      </div>
+    </div>
+    <post-status-form class="reply-body" :reply-to="status.id" :attentions="status.attentions" :repliedUser="status.user" v-on:posted="toggleReplying" v-if="replying"/>
+  </div>
+  <div class="status-el base00-background base03-border" v-else-if="!status.deleted" v-bind:class="[{ 'base01-background': isFocused }, { 'status-conversation': inConversation }]" >
     <template v-if="muted">
       <div class="media status container muted">
         <small><router-link :to="{ name: 'user-profile', params: { id: status.user.id } }">{{status.user.screen_name}}</router-link></small>
-- 
cgit v1.2.3-70-g09d2

