18F/dolores-landingham-slack-bot

View on GitHub
app/views/onboarding_messages/_onboarding_message.html.erb

Summary

Maintainability
Test Coverage
<h1><%= message.title %></h1>
<h2>
  Day <%= message.days_after_start %> -
  <%= message.time_of_day.strftime('%l:%M %p') %>
</h2>
<p><%= message.body %></p>
<% if message.end_date.present? %>
  <p>
    <strong>End date:</strong>
    <%= message.end_date %>
  </p>
<% end %>
<p>
  <strong>Tags:</strong>
  <% message.tag_list.each do |tag| %>
    <%= link_to tag, onboarding_messages_path(tag: tag, title: '', body: '') %>
  <% end %>
</p>
<% if current_user.admin? %>
  <%= link_to edit_onboarding_message_path(message), class: 'button button-edit' do %>
    <icon class="icon-edit"></icon>
    <span>Edit</span>
  <% end %>
  <%= link_to new_onboarding_message_test_message_path(message), class: 'button button-test' do %>
    <icon class="icon-send"></icon>
    <span>Test</span>
  <% end %>
  <%= link_to 'Delete', message,
    method: :delete,
    class: 'button button-delete icon-circle-x',
    data: { confirm: 'Are you sure you want to delete this message?' }
  %>
<% end %>
<hr>