<% if f.object.url_is_editable_by_user?(@user) %>
<%= f.label :url, "URL:", :class => "required" %>
<%= f.text_field :url, :autocomplete => "off" %>
<%= button_tag "Fetch Title", :id => "story_fetch_title",
:type => "button" %>
<% elsif !f.object.new_record? && !f.object.url.blank? %>
<%= f.label :url, "URL:", :class => "required" %>
<% end %>
<%= f.label :title, "Title:", :class => "required" %>
<%= f.text_field :title, :maxlength => 100, :autocomplete => "off" %>
<%= f.label :tags_a, "Tags:", :class => "required",
:style => "line-height: 2.3em;" %>
<%= f.select "tags_a", options_for_select(
Tag.all_with_filtered_counts_for(@user).map{|t|
[ "#{t.tag} - #{t.description}", t.tag, { "data-html" => raw("") +
t.tag + raw(" - ") + t.description.to_s +
(t.filtered_count == 0 ? "" :
raw(" ") + "#{t.filtered_count} user" +
(t.filtered_count == 1 ? "" : "s") + " filtering" +
raw("")) } ]}, f.object.tags_a), {}, { :multiple => true } %>
<%= f.label :description, "Text:", :class => "required" %>
<%= f.text_area :description, :rows => 15,
:placeholder => "Optional when submitting a URL; please see guidelines",
:autocomplete => "off" %>