about summary refs log tree commit diff
path: root/app/views
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2020-01-27 15:46:50 +0100
committerThibaut Girka <thib@sitedethib.com>2020-01-27 15:46:50 +0100
commitc56a504d116d62fe669d15a270133d7c78dd61f1 (patch)
tree7400f3182f2a4ebd1606c37a1a5cad4cc95e443b /app/views
parent8924743349ec5ce37cd949445e071c14968ec2ec (diff)
parentc2dfd5e4e24a70fbfa02678fde4cfc6f6750deb4 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
- `app/serializers/rest/account_serializer.rb`:
  Upstream added code too close to glitch-soc-specific followers-hiding code.
  Ported upstream changes.
Diffstat (limited to 'app/views')
-rw-r--r--app/views/admin/announcements/_announcement.html.haml9
-rw-r--r--app/views/admin/announcements/edit.html.haml2
-rw-r--r--app/views/directories/index.html.haml2
-rw-r--r--app/views/relationships/_account.html.haml2
4 files changed, 11 insertions, 4 deletions
diff --git a/app/views/admin/announcements/_announcement.html.haml b/app/views/admin/announcements/_announcement.html.haml
index 75768c7ba..f8a6c66de 100644
--- a/app/views/admin/announcements/_announcement.html.haml
+++ b/app/views/admin/announcements/_announcement.html.haml
@@ -10,5 +10,12 @@
     - else
       = l(announcement.created_at)
   %td
-    = table_link_to 'pencil', t('generic.edit'), edit_admin_announcement_path(announcement) if can?(:update, announcement)
+    - if can?(:update, announcement)
+      - if announcement.published?
+        = table_link_to 'pause', t('admin.announcements.unpublish'), unpublish_admin_announcement_path(announcement), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }
+      - else
+        = table_link_to 'play', t('admin.announcements.publish'), publish_admin_announcement_path(announcement), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }
+
+      = table_link_to 'pencil', t('generic.edit'), edit_admin_announcement_path(announcement)
+
     = table_link_to 'trash', t('generic.delete'), admin_announcement_path(announcement), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') } if can?(:destroy, announcement)
diff --git a/app/views/admin/announcements/edit.html.haml b/app/views/admin/announcements/edit.html.haml
index c5c605e93..5f56db5e7 100644
--- a/app/views/admin/announcements/edit.html.haml
+++ b/app/views/admin/announcements/edit.html.haml
@@ -14,7 +14,7 @@
   .fields-group
     = f.input :text, wrapper: :with_block_label
 
-  - if @announcement.scheduled_at.present? && !@announcement.published?
+  - unless @announcement.published?
     .fields-group
       = f.input :scheduled_at, include_blank: true, wrapper: :with_block_label
 
diff --git a/app/views/directories/index.html.haml b/app/views/directories/index.html.haml
index dee99475a..ecf12b649 100644
--- a/app/views/directories/index.html.haml
+++ b/app/views/directories/index.html.haml
@@ -47,7 +47,7 @@
             %small= t('accounts.followers', count: account.followers_count).downcase
           .accounts-table__count
             - if account.last_status_at.present?
-              %time.time-ago{ datetime: account.last_status_at.iso8601, title: l(account.last_status_at) }= l account.last_status_at
+              %time.time-ago{ datetime: account.last_status_at.to_date.iso8601, title: l(account.last_status_at.to_date) }= l account.last_status_at.to_date
             - else
               = t('accounts.never_active')
 
diff --git a/app/views/relationships/_account.html.haml b/app/views/relationships/_account.html.haml
index 6c22deb51..af5a4aaf7 100644
--- a/app/views/relationships/_account.html.haml
+++ b/app/views/relationships/_account.html.haml
@@ -14,7 +14,7 @@
             %small= t('accounts.followers', count: account.followers_count).downcase
           %td.accounts-table__count
             - if account.last_status_at.present?
-              %time.time-ago{ datetime: account.last_status_at.iso8601, title: l(account.last_status_at) }= l account.last_status_at
+              %time.time-ago{ datetime: account.last_status_at.to_date.iso8601, title: l(account.last_status_at.to_date) }= l account.last_status_at
             - else
               \-
             %small= t('accounts.last_active')