when not logged in, show comment box but disabled

This commit is contained in:
joshua stein 2014-04-14 23:12:50 -05:00
parent e152574003
commit 993e1e84ae
3 changed files with 21 additions and 15 deletions

View file

@ -422,7 +422,7 @@ div.voters .downvoter.downvoter_stub {
li.story {
clear: both;
}
li.story div.story_liner {
ol.stories.list li.story div.story_liner {
padding-top: 0.4em;
padding-bottom: 0.4em;
}

View file

@ -5,8 +5,7 @@
<%= errors_for comment %>
<% end %>
<%= hidden_field_tag "story_id",
comment.story.short_id %>
<%= hidden_field_tag "story_id", comment.story.short_id %>
<% if comment.parent_comment %>
<%= hidden_field_tag "parent_comment_short_id",
@ -15,24 +14,29 @@
<div style="width: 100%;">
<%= text_area_tag "comment", comment.comment, :rows => 5,
:style => "width: 100%;", :autocomplete => "off" %>
:style => "width: 100%;", :autocomplete => "off", :disabled => !@user,
:placeholder => (@user ? "" : "You must be logged in to leave a comment.")
%>
<p></p>
<div class="markdown_help_toggler">
<div class="markdown_help_label">
Markdown formatting available
</div>
<div class="markdown_help_label markdown_help_label_mobile"
style="display: none;">
[M&darr;]
</div>
<% if @user %>
<div class="markdown_help_label">
Markdown formatting available
</div>
<div class="markdown_help_label markdown_help_label_mobile"
style="display: none;">
[M&darr;]
</div>
<% end %>
<%= button_tag "#{comment.new_record?? "Post" : "Update"}",
:class => "comment-post", :type => "button" %>
:class => "comment-post", :type => "button",
:disabled => !@user %>
&nbsp;
<%= button_tag "Preview", :class => "comment-preview",
:type => "button" %>
:type => "button", :disabled => !@user %>
<% if local_assigns[:cancellable] %>
&nbsp;
<%= button_tag "Cancel", :class => "comment-cancel",
@ -41,7 +45,9 @@
<div style="clear: both;"></div>
<%= render :partial => "global/markdownhelp" %>
<% if @user %>
<%= render :partial => "global/markdownhelp" %>
<% end %>
</div>
</div>

View file

@ -13,7 +13,7 @@
<% if !@story.previewing %>
<ol class="comments comments1">
<% if @user && !@story.is_gone? && !@story.previewing %>
<% if !@story.is_gone? && !@story.previewing %>
<li><%= render "comments/commentbox", :comment => @comment %></li>
<% end %>