about summary refs log tree commit diff
path: root/app/views/stream_entries
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/stream_entries')
-rw-r--r--app/views/stream_entries/_detailed_status.html.haml30
-rw-r--r--app/views/stream_entries/_favourite.html.haml2
-rw-r--r--app/views/stream_entries/_follow.html.haml2
-rw-r--r--app/views/stream_entries/_simple_status.html.haml20
-rw-r--r--app/views/stream_entries/show.html.haml8
5 files changed, 41 insertions, 21 deletions
diff --git a/app/views/stream_entries/_detailed_status.html.haml b/app/views/stream_entries/_detailed_status.html.haml
index 94451d3bd..6ee8c9e5b 100644
--- a/app/views/stream_entries/_detailed_status.html.haml
+++ b/app/views/stream_entries/_detailed_status.html.haml
@@ -1,36 +1,46 @@
 .detailed-status.light
-  = link_to TagManager.instance.url_for(status.account), class: 'detailed-status__display-name', target: @external_links ? '_blank' : nil, rel: 'noopener' do
+  = link_to TagManager.instance.url_for(status.account), class: 'detailed-status__display-name p-author h-card', target: @external_links ? '_blank' : nil, rel: 'noopener' do
     %div
       %div.avatar
-        = image_tag status.account.avatar.url(:original), width: 48, height: 48, alt: ''
+        = image_tag status.account.avatar.url(:original), width: 48, height: 48, alt: '', class: 'u-photo'
     %span.display-name
-      %strong= display_name(status.account)
-      %span= acct(status.account)
+      %strong.p-name.emojify= display_name(status.account)
+      %span.p-nickname= acct(status.account)
 
-  .status__content= Formatter.instance.format(status)
+  .status__content.e-content.p-name.emojify<
+    - unless status.spoiler_text.blank?
+      %p= status.spoiler_text
+    = Formatter.instance.format(status)
 
   - unless status.media_attachments.empty?
     - if status.media_attachments.first.video?
       .video-player
         - if status.sensitive?
           = render partial: 'stream_entries/content_spoiler'
-        %video{ src: status.media_attachments.first.file.url(:original), loop: true }
+        %video{ src: status.media_attachments.first.file.url(:original), loop: true, class: 'u-video' }
     - else
       .detailed-status__attachments
         - if status.sensitive?
           = render partial: 'stream_entries/content_spoiler'
         - status.media_attachments.each do |media|
           .media-item
-            = link_to '', (media.remote_url.blank? ? media.file.url(:original) : media.remote_url), style: "background-image: url(#{media.file.url(:original)})", target: '_blank', rel: 'noopener'
+            = link_to '', (media.remote_url.blank? ? media.file.url(:original) : media.remote_url), style: "background-image: url(#{media.file.url(:original)})", target: '_blank', rel: 'noopener', class: "u-#{media.video? ? 'video' : 'photo'}"
 
   %div.detailed-status__meta
-    = link_to TagManager.instance.url_for(status), class: 'detailed-status__datetime', target: @external_links ? '_blank' : nil, rel: 'noopener' do
+    %data.dt-published{ value: status.created_at.to_time.iso8601 }
+    = link_to TagManager.instance.url_for(status), class: 'detailed-status__datetime u-url u-uid', target: @external_links ? '_blank' : nil, rel: 'noopener' do
       %span= l(status.created_at)
     ·
-    %span
+    - if status.application
+      - if status.application.website.blank?
+        %strong.detailed-status__application= status.application.name
+      - else
+        = link_to status.application.name, status.application.website, class: 'detailed-status__application', target: '_blank', rel: 'noopener'
+      ·
+    %span<
       = fa_icon('retweet')
       %span= status.reblogs.count
     ·
-    %span
+    %span<
       = fa_icon('star')
       %span= status.favourites.count
diff --git a/app/views/stream_entries/_favourite.html.haml b/app/views/stream_entries/_favourite.html.haml
index aac90dcdf..ea4879328 100644
--- a/app/views/stream_entries/_favourite.html.haml
+++ b/app/views/stream_entries/_favourite.html.haml
@@ -1,5 +1,5 @@
 .entry.entry-favourite
-  .content
+  .content.emojify
     %strong= favourite.account.acct
     = t('stream_entries.favourited')
     %strong= favourite.status.account.acct
diff --git a/app/views/stream_entries/_follow.html.haml b/app/views/stream_entries/_follow.html.haml
index 1a2e2c554..da6d062f0 100644
--- a/app/views/stream_entries/_follow.html.haml
+++ b/app/views/stream_entries/_follow.html.haml
@@ -1,5 +1,5 @@
 .entry.entry-follow
-  .content
+  .content.emojify
     %strong= link_to follow.account.acct, account_path(follow.account)
     = t('stream_entries.is_now_following')
     %strong= link_to follow.target_account.acct, TagManager.instance.url_for(follow.target_account)
diff --git a/app/views/stream_entries/_simple_status.html.haml b/app/views/stream_entries/_simple_status.html.haml
index da3bc0ccb..95f90abd9 100644
--- a/app/views/stream_entries/_simple_status.html.haml
+++ b/app/views/stream_entries/_simple_status.html.haml
@@ -1,17 +1,21 @@
 .status.light
   .status__header
     .status__meta
-      = link_to time_ago_in_words(status.created_at), TagManager.instance.url_for(status), class: 'status__relative-time', title: l(status.created_at), target: @external_links ? '_blank' : nil, rel: 'noopener'
+      = link_to time_ago_in_words(status.created_at), TagManager.instance.url_for(status), class: 'status__relative-time u-url u-uid', title: l(status.created_at), target: @external_links ? '_blank' : nil, rel: 'noopener'
+      %data.dt-published{ value: status.created_at.to_time.iso8601 }
 
-    = link_to TagManager.instance.url_for(status.account), class: 'status__display-name', target: @external_links ? '_blank' : nil, rel: 'noopener' do
+    = link_to TagManager.instance.url_for(status.account), class: 'status__display-name p-author h-card', target: @external_links ? '_blank' : nil, rel: 'noopener' do
       .status__avatar
         %div
-          = image_tag status.account.avatar(:original), width: 48, height: 48, alt: ''
+          = image_tag status.account.avatar(:original), width: 48, height: 48, alt: '', class: 'u-photo'
       %span.display-name
-        %strong= display_name(status.account)
-        %span= acct(status.account)
+        %strong.p-name.emojify= display_name(status.account)
+        %span.p-nickname= acct(status.account)
 
-  .status__content= Formatter.instance.format(status)
+  .status__content.e-content.p-name.emojify<
+    - unless status.spoiler_text.blank?
+      %p= status.spoiler_text
+    = Formatter.instance.format(status)
 
   - unless status.media_attachments.empty?
     .status__attachments
@@ -19,10 +23,10 @@
         = render partial: 'stream_entries/content_spoiler'
       - if status.media_attachments.first.video?
         .video-item
-          = link_to (status.media_attachments.first.remote_url.blank? ? status.media_attachments.first.file.url(:original) : status.media_attachments.first.remote_url), style: "background-image: url(#{status.media_attachments.first.file.url(:small)})", target: '_blank', rel: 'noopener' do
+          = link_to (status.media_attachments.first.remote_url.blank? ? status.media_attachments.first.file.url(:original) : status.media_attachments.first.remote_url), style: "background-image: url(#{status.media_attachments.first.file.url(:small)})", target: '_blank', rel: 'noopener', class: 'u-video' do
             .video-item__play
               = fa_icon('play')
       - else
         - status.media_attachments.each do |media|
           .media-item
-            = link_to '', (media.remote_url.blank? ? media.file.url(:original) : media.remote_url), style: "background-image: url(#{media.file.url(:original)})", target: '_blank', rel: 'noopener'
+            = link_to '', (media.remote_url.blank? ? media.file.url(:original) : media.remote_url), style: "background-image: url(#{media.file.url(:original)})", target: '_blank', rel: 'noopener', class: "u-#{media.video? ? 'video' : 'photo'}"
diff --git a/app/views/stream_entries/show.html.haml b/app/views/stream_entries/show.html.haml
index 43935da60..6bad45705 100644
--- a/app/views/stream_entries/show.html.haml
+++ b/app/views/stream_entries/show.html.haml
@@ -5,7 +5,11 @@
   %meta{ property: 'og:site_name', content: 'Mastodon' }/
   %meta{ property: 'og:type', content: 'article' }/
   %meta{ property: 'og:title', content: "#{@account.username} on #{Rails.configuration.x.local_domain}" }/
-  %meta{ property: 'og:description', content: @stream_entry.activity.content }/
+
+  - if @stream_entry.activity.is_a?(Status) && !@stream_entry.activity.spoiler_text.blank?
+    %meta{ property: 'og:description', content: @stream_entry.activity.spoiler_text }/
+  - else
+    %meta{ property: 'og:description', content: @stream_entry.activity.content }/
 
   - if @stream_entry.activity.is_a?(Status) && @stream_entry.activity.media_attachments.size > 0
     %meta{ property: 'og:image', content: full_asset_url(@stream_entry.activity.media_attachments.first.file.url(:small)) }/
@@ -14,5 +18,7 @@
     %meta{ property: 'og:image:width', content: '120' }/
     %meta{ property: 'og:image:height', content: '120' }/
 
+  %meta{ property: 'twitter:card', content: 'summary' }/
+
 .activity-stream.activity-stream-headless
   = render partial: @type, locals: { @type.to_sym => @stream_entry.activity, include_threads: true }