18F/dolores-landingham-slack-bot

View on GitHub
app/views/quarterly_messages/index.html.erb

Summary

Maintainability
Test Coverage
<%= render :layout => '/application/header', :locals => {:title => 'Filter', :subtitle => '(Please separate tags with a comma)'} do %>
  <%= form_tag(quarterly_messages_path, method: "get", class: "navbar-form", slack_username: "search-form") do %>
    <div class="input-append">
      <%= text_field_tag :title, params[:title], class: "filter-input", placeholder: "title" %>
      <%= text_field_tag :body, params[:body], class: "filter-input", placeholder: "body" %>
      <%= text_field_tag :tag, params[:tag], class: "filter-input", placeholder: "tag, tag" %>

      <button class="button filter-button" type="submit"><i class="icon-search"></i>Filter</button>
    </div>
  <% end %>
<% end %>

<section class="main-content">
  <%= render "flashes" -%>
  <%= render "disabled_alert" %>
  <% @quarterly_messages.each do |message| %>
    <%= render 'quarterly_message', message: message %>
  <% end %>
  <% if @quarterly_messages.empty? %>
    <label>No matches found.</label>
  <% end %>

  <%= paginate(@quarterly_messages) %>
</section>