2012-06-17 03:15:46 +02:00
|
|
|
<%= error_messages_for f.object %>
|
|
|
|
|
|
|
|
<div class="box">
|
|
|
|
<div class="boxline">
|
2013-03-26 18:22:23 +01:00
|
|
|
<% if f.object.url_is_editable_by_user?(@user) %>
|
2012-06-30 18:18:36 +02:00
|
|
|
<%= f.label :url, "URL:", :class => "required" %>
|
2013-03-26 18:22:23 +01:00
|
|
|
<%= f.text_field :url, :autocomplete => "off" %>
|
2012-09-19 19:37:42 +02:00
|
|
|
<%= button_tag "Fetch Title", :id => "story_fetch_title",
|
|
|
|
:type => "button" %>
|
2013-03-26 18:22:23 +01:00
|
|
|
<% elsif !f.object.new_record? && !f.object.url.blank? %>
|
|
|
|
<%= f.label :url, "URL:", :class => "required" %>
|
|
|
|
<div class="d">
|
|
|
|
<a href="<%= f.object.url %>"><%= f.object.url %></a>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2012-06-17 03:15:46 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="boxline">
|
|
|
|
<%= f.label :title, "Title:", :class => "required" %>
|
2012-07-05 01:58:58 +02:00
|
|
|
<%= f.text_field :title, :maxlength => 100, :autocomplete => "off" %>
|
2013-03-26 18:22:23 +01:00
|
|
|
</div>
|
2012-06-17 03:15:46 +02:00
|
|
|
|
|
|
|
<div class="boxline" style="margin-bottom: 2px;">
|
2013-03-26 18:22:23 +01:00
|
|
|
<%= f.label :tags_a, "Tags:", :class => "required",
|
2012-06-30 18:18:36 +02:00
|
|
|
:style => "line-height: 2.3em;" %>
|
2012-09-19 19:25:11 +02:00
|
|
|
<%= f.select "tags_a", options_for_select(
|
2012-09-20 02:28:09 +02:00
|
|
|
Tag.all_with_filtered_counts_for(@user).map{|t|
|
2012-09-19 19:25:11 +02:00
|
|
|
[ "#{t.tag} - #{t.description}", t.tag, { "data-html" => raw("<strong>") +
|
|
|
|
t.tag + raw("</strong> - ") + t.description.to_s +
|
|
|
|
(t.filtered_count == 0 ? "" :
|
|
|
|
raw(" <em>") + "#{t.filtered_count} user" +
|
|
|
|
(t.filtered_count == 1 ? "" : "s") + " filtering" +
|
2012-09-20 17:48:52 +02:00
|
|
|
raw("</em>")) } ]}, f.object.tags_a), {}, { :multiple => true } %>
|
2012-06-17 03:15:46 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="boxline">
|
|
|
|
<%= f.label :description, "Text:", :class => "required" %>
|
2012-07-01 02:43:16 +02:00
|
|
|
<%= f.text_area :description, :rows => 15,
|
2012-08-17 21:15:04 +02:00
|
|
|
:placeholder => "Optional when submitting a URL; please see guidelines",
|
2012-07-05 01:58:58 +02:00
|
|
|
:autocomplete => "off" %>
|
2012-06-17 03:15:46 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2012-09-19 19:37:42 +02:00
|
|
|
|
|
|
|
<script>
|
|
|
|
$(document).ready(function() {
|
|
|
|
$("#story_fetch_title").click(function() {
|
|
|
|
Lobsters.fetchURLTitle($(this), $("#story_url"), $("#story_title"));
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|