forked from e621ng/e621ng
[PostSets] Move invite link from helper to partial
This commit is contained in:
parent
f4e2cace14
commit
9111987abd
@ -1,16 +0,0 @@
|
||||
module PostSetMaintainerHelper
|
||||
def invite_links(m)
|
||||
html = ""
|
||||
if m.status == "pending"
|
||||
html << link_to("Accept", approve_post_set_maintainer_path(m), data: {confirm: "Are you sure you want to accept this invite?"})
|
||||
html << " " + link_to("Ignore", deny_post_set_maintainer_path(m), data: {confirm: "Are you sure you want to ignore this invite?"})
|
||||
html << " " + link_to("Block", block_post_set_maintainer_path(m), data: {confirm: "Are you sure you want to ignore and block future invites for this set?"})
|
||||
elsif m.status == "approved"
|
||||
html << link_to("Remove", deny_post_set_maintainer_path(m), data: {confirm: "Are you sure you want to remove yourself as maintainer of this set?"})
|
||||
html << " " + link_to("Block", block_post_set_maintainer_path(m), data: {confirm: "Are you sure you want to remove yourself and block future invites for this set?"})
|
||||
elsif m.status == "blocked"
|
||||
html << link_to("Unblock", deny_post_set_maintainer_path(m), data: {confirm: "Are you sure you want to unblock invites for this set?"})
|
||||
end
|
||||
html.html_safe
|
||||
end
|
||||
end
|
10
app/views/post_set_maintainers/_invite_links.html.erb
Normal file
10
app/views/post_set_maintainers/_invite_links.html.erb
Normal file
@ -0,0 +1,10 @@
|
||||
<% if invite.status == "pending" %>
|
||||
<%= link_to("Accept", approve_post_set_maintainer_path(invite), data: {confirm: "Are you sure you want to accept this invite?"}) %>
|
||||
<%= link_to("Ignore", deny_post_set_maintainer_path(invite), data: {confirm: "Are you sure you want to ignore this invite?"}) %>
|
||||
<%= link_to("Block", block_post_set_maintainer_path(invite), data: {confirm: "Are you sure you want to ignore and block future invites for this set?"}) %>
|
||||
<% elsif invite.status == "approved" %>
|
||||
<%= link_to("Remove", deny_post_set_maintainer_path(invite), data: {confirm: "Are you sure you want to remove yourself as maintainer of this set?"}) %>
|
||||
<%= link_to("Block", block_post_set_maintainer_path(invite), data: {confirm: "Are you sure you want to remove yourself and block future invites for this set?"}) %>
|
||||
<% elsif invite.status == "blocked" %>
|
||||
<%= link_to("Unblock", deny_post_set_maintainer_path(invite), data: {confirm: "Are you sure you want to unblock invites for this set?"}) %>
|
||||
<% end %>
|
@ -15,7 +15,7 @@
|
||||
<td><%= link_to m.post_set.name, post_set_path(m.post_set) %></td>
|
||||
<td><%= m.status.capitalize %></td>
|
||||
<td><%= compact_time m.updated_at %></td>
|
||||
<td><%= invite_links m %></td>
|
||||
<td><%= render "post_set_maintainers/invite_links", invite: m %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
Loading…
Reference in New Issue
Block a user