Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin settings #1573

Merged
merged 16 commits into from
Jul 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 30 additions & 6 deletions app/assets/stylesheets/admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ $sidebar-active: #f4fcd0;

.top-links {
background: #000;

a {
line-height: rem-calc($line-height * 1.5);
}
}

.admin-top-bar {
Expand Down Expand Up @@ -190,6 +194,11 @@ $sidebar-active: #f4fcd0;

&.with-button {
line-height: $line-height * 2;

.button {
background: #fff;
color: $brand;
}
}
}

Expand All @@ -208,6 +217,19 @@ $sidebar-active: #f4fcd0;

table {

thead {
color: #fff;
}

th {
background: $brand;
color: #fff;

label {
color: #fff;
}
}

.break {
word-break: break-word;
}
Expand All @@ -224,7 +246,6 @@ $sidebar-active: #f4fcd0;

@include breakpoint(medium) {
margin-left: $line-height / 2;
margin-right: $line-height / 2;
margin-top: 0;
}
}
Expand Down Expand Up @@ -339,6 +360,14 @@ $sidebar-active: #f4fcd0;
margin-bottom: 0 !important;
}

.enabled {
color: $color-success;
}

.disabled {
color: $text-medium;
}

// 02. Sidebar
// -----------

Expand Down Expand Up @@ -1159,11 +1188,6 @@ $sidebar-active: #f4fcd0;
}
}

.current-of-max-headings {
color: #000;
font-weight: bold;
}

// 11. Newsletters
// -----------------

Expand Down
36 changes: 22 additions & 14 deletions app/views/admin/admin_notifications/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<th><%= t("admin.admin_notifications.index.title") %></th>
<th><%= t("admin.admin_notifications.index.segment_recipient") %></th>
<th><%= t("admin.admin_notifications.index.sent") %></th>
<th class="small-5 text-right"><%= t("admin.admin_notifications.index.actions") %></th>
<th class="small-5"><%= t("admin.admin_notifications.index.actions") %></th>
</tr>
</thead>
<tbody>
Expand All @@ -28,21 +28,29 @@
<%= l admin_notification.sent_at.to_date %>
<% end %>
</td>
<td class="text-right">
<td>
<% if admin_notification.draft? %>
<%= link_to t("admin.admin_notifications.index.edit"),
edit_admin_admin_notification_path(admin_notification),
method: :get, class: "button hollow" %>
<%= link_to t("admin.admin_notifications.index.delete"),
admin_admin_notification_path(admin_notification),
method: :delete, class: "button hollow alert" %>
<%= link_to t("admin.admin_notifications.index.preview"),
admin_admin_notification_path(admin_notification),
class: "button" %>
<div class="small-4 column">
<%= link_to t("admin.admin_notifications.index.edit"),
edit_admin_admin_notification_path(admin_notification),
method: :get, class: "button expanded hollow" %>
</div>
<div class="small-4 column">
<%= link_to t("admin.admin_notifications.index.delete"),
admin_admin_notification_path(admin_notification),
method: :delete, class: "button expanded hollow alert" %>
</div>
<div class="small-4 column">
<%= link_to t("admin.admin_notifications.index.preview"),
admin_admin_notification_path(admin_notification),
class: "button expanded" %>
</div>
<% else %>
<%= link_to t("admin.admin_notifications.index.view"),
admin_admin_notification_path(admin_notification),
class: "button" %>
<div class="small-4 column">
<%= link_to t("admin.admin_notifications.index.view"),
admin_admin_notification_path(admin_notification),
class: "button expanded" %>
</div>
<% end %>
</td>
</tr>
Expand Down
124 changes: 61 additions & 63 deletions app/views/admin/admin_notifications/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,76 +2,74 @@

<h2><%= t("admin.admin_notifications.show.section_title") %></h2>

<div class="small-12 column">
<div class="callout highlight">
<div class="row">
<div class="small-12 medium-6 column">
<strong><%= t("admin.admin_notifications.show.sent_at") %></strong><br>
<% if @admin_notification.draft? %>
<%= t("admin.admin_notifications.index.draft") %>
<% else %>
<%= l(@admin_notification.sent_at.to_date) %>
<% end %>
</div>
<div class="small-12 medium-6 column">
<strong><%= t("admin.admin_notifications.show.title") %></strong><br>
<%= @admin_notification.title %>
</div>
</div>
<div class="row">
<div class="small-12 column callout highlight">
<div class="small-12 medium-6 column">
<strong><%= t("admin.admin_notifications.show.sent_at") %></strong><br>
<% if @admin_notification.draft? %>
<%= t("admin.admin_notifications.index.draft") %>
<% else %>
<%= l(@admin_notification.sent_at.to_date) %>
<% end %>
</div>

<div class="small-12 medium-6 column">
<strong><%= t("admin.admin_notifications.show.title") %></strong><br>
<%= @admin_notification.title %>
</div>

<div class="small-12 medium-6 column">
<strong><%= t("admin.admin_notifications.show.body") %></strong><br>
<%= @admin_notification.body %>
</div>
<div class="small-12 medium-6 column">
<strong><%= t("admin.admin_notifications.show.link") %></strong><br>
<%= @admin_notification.link %>
</div>
</div>
<div class="row">
<div class="small-12 column">
<strong><%= t("admin.admin_notifications.show.segment_recipient") %></strong><br>
<%= segment_name(@admin_notification.segment_recipient) %>
<% if @admin_notification.draft? %>
<%= t("admin.admin_notifications.show.will_get_notified",
n: @admin_notification.list_of_recipients_count) %>
<% else %>
<%= t("admin.admin_notifications.show.got_notified",
n: @admin_notification.recipients_count) %>
<% end %>
</div>
</div>
<div class="small-12 medium-6 column">
<strong><%= t("admin.admin_notifications.show.body") %></strong><br>
<%= @admin_notification.body %>
</div>

<p class="help-text" id="phase-description-help-text">
<div class="small-12 medium-6 column">
<strong><%= t("admin.admin_notifications.show.link") %></strong><br>
<%= @admin_notification.link %>
</div>

<div class="small-12 column">
<strong><%= t("admin.admin_notifications.show.segment_recipient") %></strong><br>
<%= segment_name(@admin_notification.segment_recipient) %>
<% if @admin_notification.draft? %>
<%= t("admin.admin_notifications.show.preview_guide") %>
<%= t("admin.admin_notifications.show.will_get_notified",
n: @admin_notification.list_of_recipients_count) %>
<% else %>
<%= t("admin.admin_notifications.show.sent_guide") %>
<%= t("admin.admin_notifications.show.got_notified",
n: @admin_notification.recipients_count) %>
<% end %>
</p>
<hr>
<div class="admin_notification-body-content">
<ul class="no-bullet clear notifications-list">
<li class="notification unread">
<% locals = { notification: nil,
title: @admin_notification.title,
body: @admin_notification.body,
timestamp: Time.current } %>
<% link_text = render partial: '/notifications/notification_body', locals: locals %>
<%= link_to_if @admin_notification.link.present?, link_text, @admin_notification.link %>
</li>
</ul>
</div>
<hr>
</div>

<p class="help-text" id="phase-description-help-text">
<% if @admin_notification.draft? %>
<%= t("admin.admin_notifications.show.preview_guide") %>
<% else %>
<%= t("admin.admin_notifications.show.sent_guide") %>
<% end %>
</p>
<hr>
<div class="admin_notification-body-content">
<ul class="no-bullet clear notifications-list">
<li class="notification unread">
<% locals = { notification: nil,
title: @admin_notification.title,
body: @admin_notification.body,
timestamp: Time.current } %>
<% link_text = render partial: '/notifications/notification_body', locals: locals %>
<%= link_to_if @admin_notification.link.present?, link_text, @admin_notification.link %>
</li>
</ul>
</div>
<hr>

<% if @admin_notification.draft? && @admin_notification.valid_segment_recipient? %>
<%= link_to t("admin.admin_notifications.show.send"),
deliver_admin_admin_notification_path(@admin_notification),
"data-alert": t("admin.admin_notifications.show.send_alert",
n: @admin_notification.list_of_recipients_count),
method: :post,
id: "js-send-admin_notification-alert",
class: "button success" %>
<div class="small-12 medium-6 large-3 column end">
<%= link_to t("admin.admin_notifications.show.send"),
deliver_admin_admin_notification_path(@admin_notification),
"data-alert": t("admin.admin_notifications.show.send_alert",
n: @admin_notification.list_of_recipients_count),
method: :post,
id: "js-send-admin_notification-alert",
class: "button success expanded" %>
</div>
<% end %>
10 changes: 4 additions & 6 deletions app/views/admin/banners/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= link_to t("admin.banners.index.create"),
new_admin_banner_path, class: "button success float-right" %>
new_admin_banner_path, class: "button float-right" %>

<h2 class="inline-block"><%= t("admin.banners.index.title") %></h2>

Expand All @@ -13,14 +13,14 @@
<tr id="<%= dom_id(banner) %>">
<th scope="col"><%= t("admin.banners.banner.post_started_at")%></th>
<th scope="col"><%= t("admin.banners.banner.post_ended_at")%></th>
<th scope="col" class="text-center"><%= t("admin.actions.actions")%></th>
<th scope="col" class="small-4"><%= t("admin.actions.actions")%></th>
</tr>
</thead>
<tbody>
<tr>
<td><%= banner.post_started_at %></td>
<td><%= banner.post_ended_at %></td>
<td class="text-right">
<td>
<div class="small-12 medium-6 column">
<%= link_to t("admin.banners.index.edit"), edit_admin_banner_path(banner),
class: 'button hollow expanded' %>
Expand All @@ -32,11 +32,9 @@
</div>
</td>
</tr>
<tr>
<th colspan="3" scope="col" class="text-center"><%= t("admin.banners.index.preview") %></th>
</tr>
<tr>
<td colspan="3">
<span class="help-text"><%= t("admin.banners.index.preview") %></span>
<div class="banner" style="background-color:<%= banner.background_color %>">
<%= link_to banner.target_url do %>
<h2 style="color:<%= banner.font_color %>"><%= banner.title %></h2>
Expand Down
Loading