about summary refs log tree commit diff
path: root/app/views
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-07-09 07:05:29 +0200
committerThibaut Girka <thib@sitedethib.com>2018-07-09 07:13:59 +0200
commitd392020da6ff4511a2925b327de23933f374bea3 (patch)
treee86a590276a96ef72d5ed49f79998e7680969cb6 /app/views
parentc699b2d141d7aa910bd81ae5fe881ecec7039395 (diff)
parent1ca4e51eb38de6de81cedf3ddcdaa626f1d1c569 (diff)
Merge branch 'master' into glitch-soc/tentative-merge
Conflicts:
	README.md
	app/controllers/statuses_controller.rb
	app/lib/feed_manager.rb
	config/navigation.rb
	spec/lib/feed_manager_spec.rb

Conflicts were resolved by taking both versions for each change.
This means the two filter systems (glitch-soc's keyword mutes and tootsuite's
custom filters) are in place, which will be changed in a follow-up commit.
Diffstat (limited to 'app/views')
-rw-r--r--app/views/admin/settings/edit.html.haml6
-rw-r--r--app/views/filters/_fields.html.haml14
-rw-r--r--app/views/filters/edit.html.haml8
-rw-r--r--app/views/filters/index.html.haml20
-rw-r--r--app/views/filters/new.html.haml8
-rw-r--r--app/views/remote_follow/new.html.haml6
-rw-r--r--app/views/settings/applications/_fields.html.haml17
-rw-r--r--app/views/shared/_landing_strip.html.haml4
-rw-r--r--app/views/stream_entries/_detailed_status.html.haml6
-rw-r--r--app/views/stream_entries/_og_image.html.haml2
-rw-r--r--app/views/stream_entries/_simple_status.html.haml2
11 files changed, 74 insertions, 19 deletions
diff --git a/app/views/admin/settings/edit.html.haml b/app/views/admin/settings/edit.html.haml
index 08d05d738..f5c5deca8 100644
--- a/app/views/admin/settings/edit.html.haml
+++ b/app/views/admin/settings/edit.html.haml
@@ -2,6 +2,9 @@
   = t('admin.settings.title')
 
 = simple_form_for @admin_settings, url: admin_settings_path, html: { method: :patch } do |f|
+  .actions.actions--top
+    = f.button :button, t('generic.save_changes'), type: :submit
+
   .fields-group
     = f.input :site_title, placeholder: t('admin.settings.site_title')
     = f.input :site_description, wrapper: :with_block_label, as: :text, label: t('admin.settings.site_description.title'), hint: t('admin.settings.site_description.desc_html'), input_html: { rows: 8 }
@@ -58,5 +61,8 @@
   .fields-group
     = f.input :peers_api_enabled, as: :boolean, wrapper: :with_label, label: t('admin.settings.peers_api_enabled.title'), hint: t('admin.settings.peers_api_enabled.desc_html')
 
+  .fields-group
+    = f.input :preview_sensitive_media, as: :boolean, wrapper: :with_label, label: t('admin.settings.preview_sensitive_media.title'), hint: t('admin.settings.preview_sensitive_media.desc_html')
+
   .actions
     = f.button :button, t('generic.save_changes'), type: :submit
diff --git a/app/views/filters/_fields.html.haml b/app/views/filters/_fields.html.haml
new file mode 100644
index 000000000..a5a3f0337
--- /dev/null
+++ b/app/views/filters/_fields.html.haml
@@ -0,0 +1,14 @@
+.fields-group
+  = f.input :phrase, as: :string, wrapper: :with_block_label
+
+.fields-group
+  = f.input :context, wrapper: :with_block_label, collection: CustomFilter::VALID_CONTEXTS, as: :check_boxes, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li', label_method: lambda { |context| I18n.t("filters.contexts.#{context}") }, include_blank: false
+
+.fields-group
+  = f.input :irreversible, wrapper: :with_label
+
+.fields-group
+  = f.input :whole_word, wrapper: :with_label
+
+.fields-group
+  = f.input :expires_in, wrapper: :with_label, collection: [30.minutes, 1.hour, 6.hours, 12.hours, 1.day, 1.week].map(&:to_i), label_method: lambda { |i| I18n.t("invites.expires_in.#{i}") }, prompt: I18n.t('invites.expires_in_prompt')
diff --git a/app/views/filters/edit.html.haml b/app/views/filters/edit.html.haml
new file mode 100644
index 000000000..e971215ac
--- /dev/null
+++ b/app/views/filters/edit.html.haml
@@ -0,0 +1,8 @@
+- content_for :page_title do
+  = t('filters.edit.title')
+
+= simple_form_for @filter, url: filter_path(@filter), method: :put do |f|
+  = render 'fields', f: f
+
+  .actions
+    = f.button :button, t('generic.save_changes'), type: :submit
diff --git a/app/views/filters/index.html.haml b/app/views/filters/index.html.haml
new file mode 100644
index 000000000..18ebee570
--- /dev/null
+++ b/app/views/filters/index.html.haml
@@ -0,0 +1,20 @@
+- content_for :page_title do
+  = t('filters.index.title')
+
+.table-wrapper
+  %table.table
+    %thead
+      %tr
+        %th= t('simple_form.labels.defaults.phrase')
+        %th= t('simple_form.labels.defaults.context')
+        %th
+    %tbody
+      - @filters.each do |filter|
+        %tr
+          %td= filter.phrase
+          %td= filter.context.map { |context| I18n.t("filters.contexts.#{context}") }.join(', ')
+          %td
+            = table_link_to 'pencil', t('filters.edit.title'), edit_filter_path(filter)
+            = table_link_to 'times', t('filters.index.delete'), filter_path(filter), method: :delete
+
+= link_to t('filters.new.title'), new_filter_path, class: 'button'
diff --git a/app/views/filters/new.html.haml b/app/views/filters/new.html.haml
new file mode 100644
index 000000000..05bec343f
--- /dev/null
+++ b/app/views/filters/new.html.haml
@@ -0,0 +1,8 @@
+- content_for :page_title do
+  = t('filters.new.title')
+
+= simple_form_for @filter, url: filters_path do |f|
+  = render 'fields', f: f
+
+  .actions
+    = f.button :button, t('filters.new.title'), type: :submit
diff --git a/app/views/remote_follow/new.html.haml b/app/views/remote_follow/new.html.haml
index fc5c4da20..9b22fda5f 100644
--- a/app/views/remote_follow/new.html.haml
+++ b/app/views/remote_follow/new.html.haml
@@ -1,3 +1,7 @@
+- content_for :header_tags do
+  - if @account.user&.setting_noindex
+    %meta{ name: 'robots', content: 'noindex' }/
+
 .form-container
   .follow-prompt
     %h2= t('remote_follow.prompt')
@@ -11,3 +15,5 @@
 
     .actions
       = f.button :button, t('remote_follow.proceed'), type: :submit
+
+    %p.hint.subtle-hint= t('remote_follow.no_account_html', sign_up_path: open_registrations? ? new_user_registration_path : 'https://joinmastodon.org/#getting-started')
diff --git a/app/views/settings/applications/_fields.html.haml b/app/views/settings/applications/_fields.html.haml
index b21f3cca6..db90df349 100644
--- a/app/views/settings/applications/_fields.html.haml
+++ b/app/views/settings/applications/_fields.html.haml
@@ -8,14 +8,9 @@
   %p.hint= t('doorkeeper.applications.help.native_redirect_uri', native_redirect_uri: Doorkeeper.configuration.native_redirect_uri)
 
 .field-group
-  = f.input :scopes,
-    label: t('activerecord.attributes.doorkeeper/application.scopes'),
-    collection: Doorkeeper.configuration.scopes,
-    wrapper: :with_label,
-    include_blank: false,
-    label_method: lambda { |scope| safe_join([scope, content_tag(:span, t("doorkeeper.scopes.#{scope}"), class: 'hint')]) },
-    selected: f.object.scopes.all,
-    required: false,
-    as: :check_boxes,
-    collection_wrapper_tag: 'ul',
-    item_wrapper_tag: 'li'
+  .input.with_block_label
+    %label= t('activerecord.attributes.doorkeeper/application.scopes')
+    %span.hint= t('simple_form.hints.defaults.scopes')
+
+  - Doorkeeper.configuration.scopes.group_by { |s| s.split(':').first }.each do |k, v|
+    = f.input :scopes, label: false, hint: false, collection: v.sort, wrapper: :with_block_label, include_blank: false, label_method: lambda { |scope| safe_join([content_tag(:samp, scope, class: class_for_scope(scope)), content_tag(:span, t("doorkeeper.scopes.#{scope}"), class: 'hint')]) }, selected: f.object.scopes.all, required: false, as: :check_boxes, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li'
diff --git a/app/views/shared/_landing_strip.html.haml b/app/views/shared/_landing_strip.html.haml
index 78f5ed4bc..9a4144723 100644
--- a/app/views/shared/_landing_strip.html.haml
+++ b/app/views/shared/_landing_strip.html.haml
@@ -3,6 +3,4 @@
 
   %div
     = t('landing_strip_html', name: content_tag(:span, display_name(account, custom_emojify: true), class: :emojify), link_to_root_path: link_to(content_tag(:strong, site_hostname), root_path))
-
-    - if open_registrations?
-      = t('landing_strip_signup_html', sign_up_path: new_user_registration_path)
+    = t('landing_strip_signup_html', sign_up_path: open_registrations? ? new_user_registration_path : 'https://joinmastodon.org/#getting-started')
diff --git a/app/views/stream_entries/_detailed_status.html.haml b/app/views/stream_entries/_detailed_status.html.haml
index c0f1e4f0f..85e90a237 100644
--- a/app/views/stream_entries/_detailed_status.html.haml
+++ b/app/views/stream_entries/_detailed_status.html.haml
@@ -7,12 +7,12 @@
       %strong.p-name.emojify= display_name(status.account, custom_emojify: true)
       %span= acct(status.account)
 
-  - if embedded_view?
-    = link_to "web+mastodon://follow?uri=#{status.account.local_username_and_domain}", class: 'button button-secondary logo-button', target: '_new' do
+  - if !user_signed_in? || embedded_view?
+    = link_to account_remote_follow_path(status.account), class: 'button button-secondary logo-button', target: '_new' do
       = render file: Rails.root.join('app', 'javascript', 'images', 'logo.svg')
       = t('accounts.follow')
 
-  .status__content.p-name.emojify<
+  .status__content.emojify<
     - if status.spoiler_text?
       %p{ style: 'margin-bottom: 0' }<
         %span.p-summary> #{Formatter.instance.format_spoiler(status)}&nbsp;
diff --git a/app/views/stream_entries/_og_image.html.haml b/app/views/stream_entries/_og_image.html.haml
index 40530f567..e1b977da3 100644
--- a/app/views/stream_entries/_og_image.html.haml
+++ b/app/views/stream_entries/_og_image.html.haml
@@ -1,4 +1,4 @@
-- if activity.is_a?(Status) && activity.non_sensitive_with_media?
+- if activity.is_a?(Status) && (activity.non_sensitive_with_media? || (activity.with_media? && Setting.preview_sensitive_media))
   - player_card = false
   - activity.media_attachments.each do |media|
     - if media.image?
diff --git a/app/views/stream_entries/_simple_status.html.haml b/app/views/stream_entries/_simple_status.html.haml
index 990e45094..397b8dca3 100644
--- a/app/views/stream_entries/_simple_status.html.haml
+++ b/app/views/stream_entries/_simple_status.html.haml
@@ -13,7 +13,7 @@
         %strong.p-name.emojify= display_name(status.account, custom_emojify: true)
         %span= acct(status.account)
 
-  .status__content.p-name.emojify<
+  .status__content.emojify<
     - if status.spoiler_text?
       %p{ style: 'margin-bottom: 0' }<
         %span.p-summary> #{Formatter.instance.format_spoiler(status)}&nbsp;