diff --git a/app/assets/javascripts/spam2.js b/app/assets/javascripts/spam2.js index 8d8d635224..baedd16a02 100644 --- a/app/assets/javascripts/spam2.js +++ b/app/assets/javascripts/spam2.js @@ -5,13 +5,17 @@ function table_main(id) { var table = $(id).DataTable({ - "order": [[1, "desc"]], - "stateSave": false, "autoWidth": false, "search": { "regex": true }, - "scrollX": true + "scrollX": true, + "language": { + "search": "Search in this batch", + "info": "Showing _START_ to _END_ of _TOTAL_ entries in batch", + "infoFiltered": "(filtered from this batch of _MAX_ entries)", + "lengthMenu": "Show _MENU_ entries for this batch" + } }); $('#selectall').click(function () { $('.selectedId').prop('checked', this.checked); @@ -27,11 +31,10 @@ function table_main(id) { return table; } -function disable_buttons(id){ - if ($(id).is(":checked")){ +function disable_buttons(id) { + if ($(id).is(":checked")) { $("#batch-spam, #batch-publish, #delete-batch, #batch-ban, #batch-unban").removeClass("disabled"); - } - else { + } else { $("#batch-spam, #batch-publish, #delete-batch, #batch-ban, #batch-unban").addClass("disabled"); } -} +} \ No newline at end of file diff --git a/app/assets/stylesheets/spam2.css b/app/assets/stylesheets/spam2.css index a5bbf9cc08..da7f3ba5df 100644 --- a/app/assets/stylesheets/spam2.css +++ b/app/assets/stylesheets/spam2.css @@ -1,13 +1,14 @@ /* *= require datatables/dataTables.bootstrap4 */ + .nav_top { z-index: 5; width: 100%; } #batch-spam:hover { - color: red !important; + color: red !important; cursor: pointer; } @@ -32,12 +33,12 @@ } #batch-unban:hover { - color: green !important; + color: green !important; cursor: pointer; } -#node-hover:hover{ - color:blue !important; +#node-hover:hover { + color: blue !important; } #table-card { @@ -45,40 +46,48 @@ } #card-top { - margin-top:2vh; + margin-top: 2vh; } -#bulk-nav{ +#bulk-nav { margin-top: 2%; margin-bottom: 1%; - width:100%; + width: 100%; } -.active .drop{ - color:white !important; +.active .drop { + color: white !important; } -#col-search{ +#col-search { cursor: text; - text-align:left !important; - margin-top:2px; + text-align: left !important; + margin-top: 2px; +} + +#col-select { + margin-top: 2px; } -#col-select{ - margin-top:2px; +.page-table { + width: 100%; + margin-top: 10px; } @media (max-width: 750px) { - #table-card, #bulk-nav, .nav_top, + #table-card, + #bulk-nav, + .nav_top, + .page-table, #card-top { - margin-left: 5vw; - width:90vw; + margin-left: 5vw; + width: 90vw; } - .nav_title{ + .nav_title { font-size: 18px; - margin-bottom : 10px; + margin-bottom: 10px; } - #card-top .card-header{ + #card-top .card-header { font-size: 18px; } } \ No newline at end of file diff --git a/app/controllers/spam2_controller.rb b/app/controllers/spam2_controller.rb index 2dcf11b715..c8096c0404 100644 --- a/app/controllers/spam2_controller.rb +++ b/app/controllers/spam2_controller.rb @@ -3,7 +3,8 @@ class Spam2Controller < ApplicationController def _spam if logged_in_as(%w(moderator admin)) - @nodes = Node.order('nid DESC') + @nodes = Node.order('changed DESC') + .paginate(page: params[:page], per_page: 100) @nodes = if params[:type] == 'wiki' @nodes.where(type: 'page', status: 1) else @@ -22,7 +23,8 @@ def _spam def _spam_revisions if logged_in_as(%w(admin moderator)) @revisions = Revision.where(status: 0) - .order('timestamp DESC') + .paginate(page: params[:page], per_page: 100) + .order('timestamp DESC') render template: 'spam2/_spam' else flash[:error] = 'Only moderators and admins can moderate this.' @@ -32,8 +34,9 @@ def _spam_revisions def _spam_comments if logged_in_as(%w(moderator admin)) - @comments = Comment.order('timestamp DESC') - .where(status: 0) + @comments = Comment.where(status: 0) + .order('timestamp DESC') + .paginate(page: params[:page], per_page: 100) render template: 'spam2/_spam' else flash[:error] = 'Only moderators can moderate comments.' diff --git a/app/views/spam2/_comments.html.erb b/app/views/spam2/_comments.html.erb index 9cfde28142..cca70a7a98 100644 --- a/app/views/spam2/_comments.html.erb +++ b/app/views/spam2/_comments.html.erb @@ -71,4 +71,12 @@ $(document).ready(function () { - \ No newline at end of file + +