2012-06-17 03:15:46 +02:00
|
|
|
<%= error_messages_for f.object %>
|
|
|
|
|
2014-01-13 07:10:31 +01:00
|
|
|
<% if !f.object.errors.any? && f.object.already_posted_story %>
|
|
|
|
<div class="flash-notice">
|
|
|
|
<h2>Note: This story was already submitted <%=
|
|
|
|
time_ago_in_words(f.object.already_posted_story.created_at) %> ago, but may
|
|
|
|
be submitted again.</h2>
|
|
|
|
<p>
|
|
|
|
Please view the <a href="<%= f.object.already_posted_story.comments_url %>"
|
|
|
|
target="_blank">previous discussion</a> for this story first. If the content
|
|
|
|
has changed or warrants new discussion, you may submit it again.
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<%= f.hidden_field :seen_previous %>
|
|
|
|
<% end %>
|
|
|
|
|
2012-06-17 03:15:46 +02:00
|
|
|
<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>
|
2013-07-18 15:49:36 +02:00
|
|
|
|
|
|
|
<div class="boxline markdown_help_toggler">
|
|
|
|
<a href="#" id="story_guidelines_toggler">
|
|
|
|
Story submission guidelines
|
|
|
|
</a>
|
|
|
|
<div id="story_guidelines" style="<%= @user &&
|
2014-02-21 17:51:30 +01:00
|
|
|
@user.stories_submitted_count > 5 ? "display: none;" : "" %>">
|
2013-07-18 15:49:36 +02:00
|
|
|
<div style="float: right;">
|
|
|
|
<a href="javascript:window.location=%22<%= root_url %>stories/new?url=%22+encodeURIComponent(document.location)+%22&title=%22+encodeURIComponent(document.title)"
|
|
|
|
style="border: 1px solid #ddd; padding: 0.5em; background-color:
|
|
|
|
#f8f8f8; line-height: 1.5em; margin-left: 1em;">Submit to
|
|
|
|
<%= Rails.application.name %></a>
|
|
|
|
</div>
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
<li><p>
|
|
|
|
To be able to easily submit a page you're viewing in your browser
|
|
|
|
to <%= Rails.application.name %>, drag the bookmarklet to the right
|
|
|
|
to your bookmark bar. You'll be taken to this page with the viewed
|
|
|
|
page's URL and title.
|
|
|
|
</p></li>
|
|
|
|
|
|
|
|
<li><p>
|
|
|
|
When submitting a URL, the text field is optional and should only
|
|
|
|
be used when additional context or explanation of the URL is
|
|
|
|
needed. Commentary or opinion should be reserved for a comment,
|
|
|
|
so that it can be voted on separately from the story.
|
|
|
|
</p></li>
|
|
|
|
|
|
|
|
<li><p>
|
|
|
|
Do not editorialize story titles, but when the original story's
|
2014-02-21 17:51:30 +01:00
|
|
|
title has no context or is unclear, please change it. <strong>Please
|
2013-07-18 15:49:36 +02:00
|
|
|
remove extraneous components from titles such as the name of the
|
2014-02-21 17:51:30 +01:00
|
|
|
site or section.</strong>
|
2013-07-18 15:49:36 +02:00
|
|
|
</p></li>
|
|
|
|
|
|
|
|
<li><p>
|
|
|
|
If no tags clearly apply to the story you are submitting, chances
|
|
|
|
are it does not belong here. Do not overreach with tags if they
|
|
|
|
are not the primary focus of the story.
|
|
|
|
</p></li>
|
|
|
|
|
|
|
|
<li><p>
|
|
|
|
When the story being submitted is more than a year or so old,
|
|
|
|
please add the year the story was written to the post title in
|
|
|
|
parentheses.
|
|
|
|
</p></li>
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
2012-06-17 03:15:46 +02:00
|
|
|
</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>
|