<%= form_tag(m_posts_path, :method => "get") do %>
  <%= text_field_tag("tags", params[:tags], :size => 20) %>
  <%= submit_tag "Go", :name => nil %>
<% end %>

<%= @post.presenter.image_html(self) %>

<div id="options">
  <% if @post.favorited_by?(CurrentUser.user.id) %>
    <%= link_to "Unfavorite", favorite_path(@post), :method => :delete %> |
  <% else %>
    <%= link_to "Favorite", favorites_path(:post_id => @post.id), :method => :post %> |
  <% end %>
</div>

<div id="tags">
  <%= @post.presenter.tag_list_html(self, :name_only => true, :path_prefix => "/m/posts") %>
</div>

<%= content_for(:html_header) do %>
  <meta name="viewport" content="width=device-width,initial-scale=<%= @post.device_scale %>">
  <script type="text/javascript">
    $(function() {
      $(document).on("swipeleft", function(e) {
        if (e.gesture.distance > 150) {
          var href = $(".paginator a[rel=next]").attr("href");
          if (href) {
            window.location = href;
          }
        }
      });

      $(document).on("swiperight", function(e) {
        if (e.gesture.distance > 150) {
          window.history.back();
        }
      })
    });
  </script>
<% end %>

<% content_for(:page_title) do %>
  <%= @post.presenter.humanized_essential_tag_string %> - <%= Danbooru.config.app_name %>
<% end %>
