5
3
mirror of https://github.com/tildeverse/lobsters synced 2024-06-13 20:46:38 +00:00

move story deletion/moderation to edit screen

This commit is contained in:
joshua stein 2017-07-13 15:13:33 -05:00
parent 1b6ea267c1
commit ed3d0ebec9
4 changed files with 30 additions and 29 deletions

View File

@ -242,7 +242,7 @@ var _Lobsters = Class.extend({
},
moderateStory: function(link) {
var reason = prompt("Moderation reason:");
var reason = $("#story_moderation_reason").val();
if (reason == null || reason == "")
return false;
@ -335,7 +335,7 @@ $(document).ready(function() {
return false;
});
$("li.story a.mod_story_link").click(function() {
$("a.mod_story_link").click(function() {
return Lobsters.moderateStory(this);
}),

View File

@ -172,16 +172,18 @@ button,
input[type="button"],
input[type="reset"],
input[type="submit"],
div.select2-choices {
display: inline-block;
padding: 2px 10px 2px 10px;
line-height: 18px;
color: #333333;
text-align: center;
div.select2-choices,
a.button {
background-color: #fafafa;
border: 1px solid #ccc;
border-bottom-color: #bbb;
border: 1px solid #ccc;
color: #333333;
cursor: pointer;
display: inline-block;
line-height: 18px;
padding: 2px 10px 2px 10px;
text-align: center;
text-decoration: none;
}
button:first-child,
input[type="button"]:first-child,

View File

@ -123,24 +123,6 @@ class="story <%= story.vote && story.vote[:vote] == 1 ? "upvoted" : "" %>
|
<a href="<%= edit_story_path(story.short_id) %>" class="<%=
story.has_suggestions? ? "story_has_suggestions" : "" %>">edit</a>
<% if story.is_gone? && story.is_undeletable_by_user?(@user) %>
|
<%= link_to "undelete", story_undelete_path(story.short_id),
:method => :post, :data => {
:confirm => "Are you sure you want to undelete this story?" } %>
<% elsif !story.is_gone? %>
|
<% if story.user_id != @user.try(:id) &&
@user.try(:is_moderator?) %>
<%= link_to "delete", story_path(story.short_id),
:method => :delete, :class => "mod_story_link" %>
<% else %>
<%= link_to "delete", story_path(story.short_id),
:method => :delete, :data => {
:confirm => "Are you sure you want to delete this story?" } %>
<% end %>
<% end %>
<% end %>
<% if story.can_have_suggestions_from_user?(@user) %>
| <%= link_to "suggest", story_suggest_path(story.short_id),

View File

@ -44,8 +44,25 @@
</div>
<%= submit_tag "Save" %>
&nbsp;or <a href="<%= story_path(@story.short_id) %>">cancel
editing</a>
<% if @story.is_gone? && @story.is_undeletable_by_user?(@user) %>
&nbsp; | &nbsp;
<%= link_to "Undelete", story_undelete_path(@story.short_id),
:method => :post, :data => {
:confirm => "Are you sure you want to undelete this story?" },
:class => "button" %>
<% elsif !@story.is_gone? %>
&nbsp; | &nbsp;
<% if @story.user_id != @user.id && @user.is_moderator? %>
<%= link_to "Delete", story_path(@story.short_id),
:method => :delete, :class => "button mod_story_link" %>
<% else %>
<%= link_to "Delete", story_path(@story.short_id),
:method => :delete, :data => {
:confirm => "Are you sure you want to delete this story?" },
:class => "button" %>
<% end %>
<% end %>
<div style="clear: both;"></div>