-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<script> | ||
+ $(document).ready(function () { | ||
+ var table = table_main("#queue_table"); | ||
+ $("#all").click(function () { //select all button | ||
+ select_all(); | ||
+ }); | ||
+ $("#batch-spam").bind('click', function (e) { //batch spam | ||
+ batch_nav("batch_spam"); | ||
+ }); | ||
+ $("#batch-publish").bind('click', function (e) { //batch publish | ||
+ batch_nav("batch_publish"); | ||
+ }); | ||
+ $("#batch-ban").bind('click', function (e) { //batch ban | ||
+ batch_nav("batch_ban"); | ||
+ }); | ||
+ $("#batch-unban").bind('click', function (e) { //batch unban | ||
+ batch_nav("batch_unban"); | ||
+ }); | ||
+ $("#delete-batch").bind('click', function (e) { // batch delete | ||
+ batch_nav("batch_delete"); | ||
+ }); | ||
+ }); | ||
</script> | ||
|
||
<div class="py-3 pl-3 w-100"> | ||
<% if @tags_followed.length == 0 %> | ||
<span class="text-secondary">You are not following any tag, Click <a class="badge badge-pill badge-info" href="/subscriptions">here</a> to follow. </span> | ||
<% else %> | ||
<a class="fa fa-plus-circle text-info" href="/subscriptions"> </a> | ||
<% end %> | ||
<% @tags_followed.limit(20).each do |tag| %> | ||
<a class="btn btn-xs my-1 btn-<% if params[:tag] == tag.tagname %>info<%else%>light border<%end%> border-curve" href="/spam2/queue/filter/<%= tag.tagname %>"><%= tag.tagname %> <span class="badge badge-pill badge-<% if params[:tag] == tag.tagname %>light<%else%>info<%end%>" data-toggle="tooltip" data-placement="top" title="Filter Nodes by Tag"><%= Tag.followers(tag.tagname).where('rusers.role = ?', 'moderator').or(Tag.followers(tag.tagname).where('rusers.role = ?', 'admin')).size %></span></a> | ||
<% end %> | ||
</div> | ||
<div class="card" id="table-card"> | ||
<div class="bg-light navbar navbar-expand"> | ||
<ul class="nav navbar-expand navbar-nav-scroll"> | ||
<li class="nav-item"> | ||
<a class="btn nav-link text-secondary" data-toggle="tooltip" data-placement="top" title="Selected per page"> Selected <span id="select-count" class="badge badge-dark">0</span></a> | ||
</li> | ||
<li class="nav-item"> | ||
<a href="/spam2/queue/filter/everything" class="btn nav-link <% if params[:tag] == "everything" %> active<% else %> text-secondary<% end %>"><i class="fa fa-arrow-circle-o-up <% if params[:tag] == "everything" %> text-dark<% else %> text-secondary<% end %>" data-toggle="tooltip" data-placement="top" title="All Nodes which you are following"></i> All Tags</a> | ||
</li> | ||
</ul> | ||
</div> | ||
<div class="card-body" style="overflow-x:hidden;"> | ||
<% unless @queue.empty? %> | ||
<div class="my-0 text-secondary small "><%= page_entries_info(@queue) %>s</div> | ||
<% end %> | ||
<table id="queue_table" class="nowrap table table-hover" style="width:100%; text-align:left"> | ||
<thead style="text-align:left;"> | ||
<tr> | ||
<th><input type="checkbox" id="selectall"/></th> | ||
<th style="width:250px !important;"><%=translation('users.profile.title')%></th> | ||
<th>Author</th> | ||
<th>Updated at</th> | ||
<th>Action</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% @queue.each do |node| %> | ||
<tr id="n<%= node.id %>"> | ||
<td><input class="selectedId" value="<%= node.nid %>" type="checkbox" /></td> | ||
<td style="width:250px !important;"> | ||
<% if node.status == 1 %><i class="fa fa-check text-success"></i> <% elsif node.status == 0 %><i class="fa fa-ban text-danger"></i> <% elsif node.status == 4 %><i class="fa fa-circle text-primary"></i> <% end %> <% if params[:type] == 'flagged'%> <i class="fa fa-flag text-warning"><% end %> | ||
<a href="javascript:void(0);" class="text-dark font-weight-bold" id="node-hover" data-toggle="modal" data-target="#ninfo<%= node.id %>"><%= node.title.truncate(25) %></a><br /> | ||
<span class="text-secondary small"><%= node.type.capitalize %> | <%= time_ago_in_words(node.created_at) %> ago</span> | ||
</td> | ||
<td> | ||
<a href="/profile/<%= node.author&.name %>" class="text-info"><%= node.author&.name.truncate(15) %></a><br> | ||
<span class="text-secondary small"><%= Node.where(uid: node.author&.id).count %> Nodes<span> <%= node.author&.new_contributor%> | ||
</td> | ||
<td> | ||
<span class="text-dark"><%= time_ago_in_words(node.updated_at) %> ago</span> | ||
</td> | ||
<td> | ||
<a class="btn btn-xs border-curve font-weight-bold btn<% if node.status != 1 %>-success<% else %>-secondary disabled<% end %> publish" data-remote="true" href="/moderate/publish/<%= node.id %>" ><i class="fa fa-check-circle fa-white"></i> Publish post</a> | ||
<a class="btn btn-xs border-curve font-weight-bold btn<% if node.status != 0 %>-danger<% else %>-secondary disabled<% end %> spam" data-remote="true" href="/moderate/spam/<%= node.id %>"><i class="fa fa-ban fa-white"></i> Spam post</a> | ||
<a class="btn btn-xs border-curve font-weight-bold btn-secondary ban a<%= node.author.id %>" <% if node.author.status == 0 %>style="display:none;"<% end %> data-remote="true" href="/ban/<%= node.author.id %>">Ban user</a> | ||
<a class="btn btn-xs border-curve font-weight-bold btn-secondary unban a-unban<%= node.author.id %>" <% if node.author.status == 1 %>style="display:none;"<% end %> data-remote="true" href="/unban/<%= node.author.id %>">Unban user</a> | ||
<a class="btn btn-xs border-curve font-weight-bold btn-warning unflag <% if node.flag == 0 %>disabled <% end %>" data-remote="true"href="/moderate/remove_flag_node/<%= node.id %>"> Unflag</a> | ||
<%= link_to "/notes/delete/#{node.id}", data: { confirm: "Are you sure you want to delete #{node.path}?" }, :remote => true, :class => "btn border-curve btn-sm font-weight-bold btn-light delete" do %> | ||
<i class="fa fa-trash text-dark"></i> | ||
<% end %> | ||
<script> | ||
$('#n<%= node.id %> .delete').bind('ajax:success', function(e){ | ||
$('#n<%= node.id %>').fadeOut() | ||
+ notyNotification('relax', 3000, 'danger', 'topRight', 'Node deleted'); | ||
}); | ||
$('#n<%= node.id %> .publish').bind('ajax:success', function(e){ | ||
$('#n<%= node.id %>').hide() | ||
notyNotification('relax', 3000, 'success', 'topRight', 'Node published'); |