about summary refs log tree commit diff
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/about/more.html.haml27
-rw-r--r--app/views/api/v1/apps/show.rabl3
-rw-r--r--app/views/api/v1/statuses/_show.rabl4
-rw-r--r--app/views/api/v1/statuses/card.rabl5
-rw-r--r--app/views/settings/shared/_links.html.haml1
-rw-r--r--app/views/stream_entries/_detailed_status.html.haml10
6 files changed, 37 insertions, 13 deletions
diff --git a/app/views/about/more.html.haml b/app/views/about/more.html.haml
index 8b0925f00..2de3bf986 100644
--- a/app/views/about/more.html.haml
+++ b/app/views/about/more.html.haml
@@ -31,21 +31,26 @@
       .panel
         .panel-header= t 'about.contact'
         .panel-body
-          .owner
-            .avatar= image_tag @contact_account.avatar.url
-            .name
-              = link_to TagManager.instance.url_for(@contact_account) do
-                %span.display_name.emojify= display_name(@contact_account)
-                %span.username= "@#{@contact_account.acct}"
+          - if @contact_account
+            .owner
+              .avatar= image_tag @contact_account.avatar.url
+              .name
+                = link_to TagManager.instance.url_for(@contact_account) do
+                  %span.display_name.emojify= display_name(@contact_account)
+                  %span.username= "@#{@contact_account.acct}"
 
-          .contact-email
-            = t 'about.business_email'
-            %strong= @contact_email
+          - unless @contact_email.blank?
+            .contact-email
+              = t 'about.business_email'
+              %strong= @contact_email
       .panel
         .panel-header= t 'about.links'
         .panel-list
           %ul
-            %li= link_to t('about.get_started'), new_user_registration_path
-            %li= link_to t('auth.login'), new_user_session_path
+            - if user_signed_in?
+              %li= link_to t('about.get_started'), root_path
+            - else
+              %li= link_to t('about.get_started'), new_user_registration_path
+              %li= link_to t('auth.login'), new_user_session_path
             %li= link_to t('about.terms'), terms_path
             %li= link_to t('about.source_code'), 'https://github.com/tootsuite/mastodon'
diff --git a/app/views/api/v1/apps/show.rabl b/app/views/api/v1/apps/show.rabl
new file mode 100644
index 000000000..6d9e607db
--- /dev/null
+++ b/app/views/api/v1/apps/show.rabl
@@ -0,0 +1,3 @@
+object @application
+
+attributes :name, :website
diff --git a/app/views/api/v1/statuses/_show.rabl b/app/views/api/v1/statuses/_show.rabl
index a3391a67e..a3fc78763 100644
--- a/app/views/api/v1/statuses/_show.rabl
+++ b/app/views/api/v1/statuses/_show.rabl
@@ -6,6 +6,10 @@ node(:url)              { |status| TagManager.instance.url_for(status) }
 node(:reblogs_count)    { |status| defined?(@reblogs_counts_map)    ? (@reblogs_counts_map[status.id]    || 0) : status.reblogs.count }
 node(:favourites_count) { |status| defined?(@favourites_counts_map) ? (@favourites_counts_map[status.id] || 0) : status.favourites.count }
 
+child :application do
+  extends 'api/v1/apps/show'
+end
+
 child :account do
   extends 'api/v1/accounts/show'
 end
diff --git a/app/views/api/v1/statuses/card.rabl b/app/views/api/v1/statuses/card.rabl
new file mode 100644
index 000000000..8ba8dcbb1
--- /dev/null
+++ b/app/views/api/v1/statuses/card.rabl
@@ -0,0 +1,5 @@
+object @card
+
+attributes :url, :title, :description
+
+node(:image) { |card| card.image? ? full_asset_url(card.image.url(:original)) : nil }
diff --git a/app/views/settings/shared/_links.html.haml b/app/views/settings/shared/_links.html.haml
index 44f097950..a6e90f457 100644
--- a/app/views/settings/shared/_links.html.haml
+++ b/app/views/settings/shared/_links.html.haml
@@ -5,3 +5,4 @@
     %li= link_to t('settings.preferences'), settings_preferences_path
   - if controller_name != 'registrations'
     %li= link_to t('auth.change_password'), edit_user_registration_path
+  %li= link_to t('settings.back'), root_path
\ No newline at end of file
diff --git a/app/views/stream_entries/_detailed_status.html.haml b/app/views/stream_entries/_detailed_status.html.haml
index 32f7c2e40..bc09d3597 100644
--- a/app/views/stream_entries/_detailed_status.html.haml
+++ b/app/views/stream_entries/_detailed_status.html.haml
@@ -28,10 +28,16 @@
     = 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