app/views/archive/index.html.haml
.top-left
= link_to "Write", root_path, class: "write-button"
= link_to "Profile", profile_path, class: "archive-profile-link"
.top-right
= link_to "Log out", logout_path, class: "logout", method: :post
%h1.col-sm-6.col-sm-offset-3.title
Archive
%section.col-sm-6.col-sm-offset-3.search
= form_tag archive_index_path, method: "GET" do
= text_field_tag :search
= submit_tag "Search"
%section.articles.col-sm-6.col-sm-offset-3
- @posts.each do |post|
%article
.date
= post.date
%br
= markdown_format(post)
= link_to "Download", download_path(id: post.id), class: "link__small"
- if post.published
= link_to "Unpublish", unpublish_path(post.id), method: :post, class: "link__small pull-right"
- else
= link_to "Publish", publish_path(post.id), method: :post, class: "link__small pull-right"
%hr
= will_paginate @posts