CommunityGrows/communitygrows

View on GitHub
app/views/subcommittee/_subcommittee.html.haml

Summary

Maintainability
Test Coverage
#admin
  %h1 #{@committee_type.capitalize} Subcommittee

- if flash[:notice] and flash[:notice]!="Signed in successfully."
  #flashNotice
    = flash[:notice]

%h2 Announcements

#document_content
  %table.table.table-bordered.table-striped
    %thead
      %tr
        %th Title
        %th Content
        %th Created at
        %th Updated at
        %th Edit
        %th Delete
    %tbody
      -@announcements.each do |announcement|
        %tr
          %td= link_to "#{announcement.title}", comment_path(announcement.id)
          %td= announcement.content
          %td= announcement.created_at.strftime("%m/%d/%Y %l:%M %p")
          %td= announcement.updated_at.strftime("%m/%d/%Y %l:%M %p")
          %td
            = link_to edit_committee_announcement_path(:announcement_id => announcement.id), :class => "btn btn-info btn-xs hidden-xs" do
              %span.glyphicon.glyphicon-edit
              Edit Announcement
            = link_to edit_committee_announcement_path(:announcement_id => announcement.id), :class => "btn btn-info visible-xs" do
              %span.glyphicon.glyphicon-edit

          %td
            = link_to delete_committee_announcement_path(:announcement_id => announcement.id), :method => :delete, data: { confirm: 'Are you sure?' }, :class => "btn btn-danger btn-xs hidden-xs" do
              %span.glyphicon.glyphicon-remove
              Delete Announcement
            = link_to delete_committee_announcement_path(:announcement_id => announcement.id), :method => :delete, data: { confirm: 'Are you sure?' }, :class => "btn btn-danger visible-xs" do
              %span.glyphicon.glyphicon-remove

= link_to new_committee_announcement_path, class: 'btn btn-success' do
  Add new announcement

%h2 Documents

#document_content
  %table.table.table-bordered.table-striped
    %thead
      %tr
        %th Title
        %th Created at
        %th Updated at
        %th Edit
        %th Delete
    %tbody
      - @document_list.each do |document|
        %tr
          %td= link_to document.title, document.url, :target => "_blank"
          %td= document.created_at.strftime("%m/%d/%Y %l:%M %p")
          %td= document.updated_at.strftime("%m/%d/%Y %l:%M %p")
          %td
            = link_to edit_committee_document_path(:id => document.id), class: 'btn btn-info btn-xs hidden-xs' do
              %span.glyphicon.glyphicon-edit
              Edit Document
            = link_to edit_committee_document_path(:id => document.id), class: 'btn btn-info visible-xs' do
              %span.glyphicon.glyphicon-edit

          %td
            = link_to delete_committee_document_path(:document_id => document.id), :method => :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger btn-xs hidden-xs' do
              %span.glyphicon.glyphicon-remove
              Delete Document
            = link_to delete_committee_document_path(:document_id => document.id), :method => :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger visible-xs' do
              %span.glyphicon.glyphicon-remove

= link_to new_committee_document_path, class: 'btn btn-success' do
  Add new document