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/api/v1/statuses/_media.rabl1
-rw-r--r--app/views/api/v1/statuses/_mention.rabl7
-rw-r--r--app/views/api/v1/statuses/_show.rabl2
-rw-r--r--app/views/api/v1/statuses/show.rabl10
-rw-r--r--app/views/home/index.html.haml1
-rw-r--r--app/views/home/initial_state.json.rabl14
-rw-r--r--app/views/settings/preferences/show.html.haml2
7 files changed, 21 insertions, 16 deletions
diff --git a/app/views/api/v1/statuses/_media.rabl b/app/views/api/v1/statuses/_media.rabl
index 5c6be1ce7..2f56c6d07 100644
--- a/app/views/api/v1/statuses/_media.rabl
+++ b/app/views/api/v1/statuses/_media.rabl
@@ -2,3 +2,4 @@ attributes :id, :remote_url, :type
 
 node(:url)         { |media| full_asset_url(media.file.url(:original)) }
 node(:preview_url) { |media| full_asset_url(media.file.url(:small)) }
+node(:text_url)    { |media| media.local? ? medium_url(media) : nil }
diff --git a/app/views/api/v1/statuses/_mention.rabl b/app/views/api/v1/statuses/_mention.rabl
index 07b3d1f61..498cca275 100644
--- a/app/views/api/v1/statuses/_mention.rabl
+++ b/app/views/api/v1/statuses/_mention.rabl
@@ -1,3 +1,4 @@
-node(:url)  { |mention| TagManager.instance.url_for(mention.account) }
-node(:acct) { |mention| mention.account.acct }
-node(:id)   { |mention| mention.account_id }
+node(:url)      { |mention| TagManager.instance.url_for(mention.account) }
+node(:acct)     { |mention| mention.account.acct }
+node(:id)       { |mention| mention.account_id }
+node(:username) { |mention| mention.account.username }
diff --git a/app/views/api/v1/statuses/_show.rabl b/app/views/api/v1/statuses/_show.rabl
index 7309a78b8..059e0d13f 100644
--- a/app/views/api/v1/statuses/_show.rabl
+++ b/app/views/api/v1/statuses/_show.rabl
@@ -1,4 +1,4 @@
-attributes :id, :created_at, :in_reply_to_id, :sensitive, :spoiler_text, :visibility
+attributes :id, :created_at, :in_reply_to_id, :in_reply_to_account_id, :sensitive, :spoiler_text, :visibility
 
 node(:uri)              { |status| TagManager.instance.uri_for(status) }
 node(:content)          { |status| Formatter.instance.format(status) }
diff --git a/app/views/api/v1/statuses/show.rabl b/app/views/api/v1/statuses/show.rabl
index 1b4651cdd..41e8983ef 100644
--- a/app/views/api/v1/statuses/show.rabl
+++ b/app/views/api/v1/statuses/show.rabl
@@ -2,12 +2,12 @@ object @status
 
 extends 'api/v1/statuses/_show'
 
-node(:favourited, if: proc { !current_account.nil? }) { |status| defined?(@favourites_map) ? !!@favourites_map[status.id] : current_account.favourited?(status) }
-node(:reblogged,  if: proc { !current_account.nil? }) { |status| defined?(@reblogs_map)    ? !!@reblogs_map[status.id]    : current_account.reblogged?(status) }
+node(:favourited, if: proc { !current_account.nil? }) { |status| defined?(@favourites_map) ? @favourites_map[status.id] : current_account.favourited?(status) }
+node(:reblogged,  if: proc { !current_account.nil? }) { |status| defined?(@reblogs_map)    ? @reblogs_map[status.id]    : current_account.reblogged?(status) }
 
-child :reblog => :reblog do
+child reblog: :reblog do
   extends 'api/v1/statuses/_show'
 
-  node(:favourited, if: proc { !current_account.nil? }) { |status| defined?(@favourites_map) ? !!@favourites_map[status.id] : current_account.favourited?(status) }
-  node(:reblogged,  if: proc { !current_account.nil? }) { |status| defined?(@reblogs_map)    ? !!@reblogs_map[status.id]    : current_account.reblogged?(status) }
+  node(:favourited, if: proc { !current_account.nil? }) { |status| defined?(@favourites_map) ? @favourites_map[status.id] : current_account.favourited?(status) }
+  node(:reblogged,  if: proc { !current_account.nil? }) { |status| defined?(@reblogs_map)    ? @reblogs_map[status.id]    : current_account.reblogged?(status) }
 end
diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml
index 0147f4064..9e3b94463 100644
--- a/app/views/home/index.html.haml
+++ b/app/views/home/index.html.haml
@@ -1,5 +1,6 @@
 - content_for :header_tags do
   :javascript
+    window.STREAMING_API_BASE_URL = '#{Rails.configuration.x.streaming_api_base_url}';
     window.INITIAL_STATE = #{json_escape(render(file: 'home/initial_state', formats: :json))}
 
   = javascript_include_tag 'application'
diff --git a/app/views/home/initial_state.json.rabl b/app/views/home/initial_state.json.rabl
index 0e9736f5f..71949ab0e 100644
--- a/app/views/home/initial_state.json.rabl
+++ b/app/views/home/initial_state.json.rabl
@@ -1,24 +1,24 @@
 object false
 
-node(:meta) {
+node(:meta) do
   {
     access_token: @token,
     locale: I18n.locale,
     me: current_account.id,
   }
-}
+end
 
-node(:compose) {
+node(:compose) do
   {
     me: current_account.id,
-    private: current_account.locked?,
+    default_privacy: current_account.user.setting_default_privacy,
   }
-}
+end
 
-node(:accounts) {
+node(:accounts) do
   {
     current_account.id => partial('api/v1/accounts/show', object: current_account),
   }
-}
+end
 
 node(:settings) { @web_settings }
diff --git a/app/views/settings/preferences/show.html.haml b/app/views/settings/preferences/show.html.haml
index 747977f9c..aee0540d2 100644
--- a/app/views/settings/preferences/show.html.haml
+++ b/app/views/settings/preferences/show.html.haml
@@ -7,6 +7,8 @@
   .fields-group
     = f.input :locale, collection: I18n.available_locales, wrapper: :with_label, include_blank: false, label_method: lambda { |locale| human_locale(locale) }
 
+    = f.input :setting_default_privacy, collection: Status.visibilities.keys, wrapper: :with_label, include_blank: false, label_method: lambda { |visibility| I18n.t("statuses.visibilities.#{visibility}") }, required: false
+
   .fields-group
     = f.simple_fields_for :notification_emails, hash_to_object(current_user.settings.notification_emails) do |ff|
       = ff.input :follow, as: :boolean, wrapper: :with_label