diff --git a/wire/modules/Process/ProcessCommentsManager/ProcessCommentsManager.css b/wire/modules/Process/ProcessCommentsManager/ProcessCommentsManager.css index 8512f1e3..38d4040f 100644 --- a/wire/modules/Process/ProcessCommentsManager/ProcessCommentsManager.css +++ b/wire/modules/Process/ProcessCommentsManager/ProcessCommentsManager.css @@ -1,189 +1 @@ -#CommentListHeader { - padding-top: 0.5em; - padding-bottom: 0.5em; } - #CommentListHeader > p { - line-height: 2.25em; - padding-right: 1em; - margin-top: 0.25em; - margin-bottom: 0.25em; } - #CommentListHeader .MarkupPagerNav { - margin-top: 0; - margin-bottom: 0.5em; } - #CommentListHeader .CommentLimitSelect { - float: left; } - #CommentListHeader .CommentCheckAll { - display: block; - float: left; - padding-left: 0.75em; } - #CommentListHeader .CommentActions { - float: left; } - #CommentListHeader .CommentSorts { - float: left; } - -.CommentItems { - clear: both; - border-bottom: 1px solid #777; } - .CommentItems + button.ui-button { - margin-top: 1em; } - -.CommentItem { - clear: both; - border-top: 1px solid #777; - padding: 0.75em 0; - margin: 0; - width: 100%; - /* - &.CommentItemStatus-2 .CommentText { - background: #ffffcc; - } - - &.CommentItemStatus0 .CommentText { - background: #ffffdd; - } - */ } - .CommentItem.CommentChecked { - background-color: #eee; } - .CommentItem.CommentChecked th { - color: #999; } - .CommentItem table { - /* - margin-top: 0.7em; - margin-bottom: 0.7em; - */ - width: 45%; - float: left; } - .CommentItem table th, - .CommentItem table td { - padding: 4px 10px 4px 0; - border-bottom: 1px solid #ddd; - vertical-align: top; } - .CommentItem table th { - font-weight: bold; - white-space: nowrap; - text-align: left; - padding-left: 0.75em !important; } - .CommentItem table th:first-child { - width: 80px; } - .CommentItem table tr:last-child td, .CommentItem table tr:last-child th { - border-bottom: none; } - .CommentItem .CommentTitle th, - .CommentItem .CommentTitle td { - padding-top: 0; } - .CommentItem .CommentChangedIcon { - display: none; } - .CommentItem.CommentItemChanged .CommentChangedIcon { - display: inline; - float: right; - opacity: 0.3; } - .CommentItem input[type=number] { - width: 4em; } - .CommentItem .CommentVotes label { - margin-right: 1em; } - .CommentItem .CommentVotes .CommentUpvotes span { - font-weight: bold; - color: green; } - .CommentItem .CommentVotes .CommentDownvotes span { - font-weight: bold; - color: red; } - .CommentItem .CommentStars > span { - display: inline; - cursor: pointer; - padding-right: 3px; } - .CommentItem .CommentStars > span i.fa { - font-size: 18px !important; } - .CommentItem .CommentContent { - float: left; - width: 55%; - padding-left: 1em; - border: none; } - .CommentItem .CommentContent .CommentChildrenInfo { - margin-top: 0.5em; } - .CommentItem .CommentContent .CommentReplyInfo { - margin-bottom: 0; } - .CommentItem .CommentContent .CommentText { - cursor: pointer; - padding-right: 1em; } - .CommentItem .CommentContent .CommentText textarea { - font-size: 1em; - width: 100%; - min-height: 15em; - margin-top: 1em; - margin-bottom: 1em; } - .CommentItem .CommentContent .CommentText .CommentTextEdit { - white-space: nowrap; } - .CommentItem .CommentContent .CommentText .CommentTextEditable { - /* - p { - margin: 1em 0; - } - & > p:first-child { - margin-top: 0; - } - */ } - .CommentItem .CommentContent .CommentTextOverflow { - overflow-y: scroll; - max-height: 15em; } - .CommentItem label.CommentStatus { - white-space: nowrap; } - .CommentItem.CommentItemStatus999 { - display: none; } - -.CommentCheckAll label .detail, -.CommentItem .CommentTitle th label .detail { - font-weight: bold; - color: #444; } - -.pw-content .MarkupPagerNav { - padding-top: 0.5em; - float: right; } - .pw-content .MarkupPagerNav + button { - margin-top: 1em; } - -.AdminThemeReno .pw-content .MarkupPagerNav li a, -.AdminThemeReno .pw-content .MarkupPagerNav li:first-child a, -.AdminThemeReno .pw-content .MarkupPagerNav li.MarkupPagerNavOn a { - border-color: #fff !important; - border: none !important; - border-left: 1px solid #fff !important; } -.AdminThemeReno .pw-content .MarkupPagerNav li { - margin-bottom: 1px; } -.AdminThemeReno .pw-content #CommentListHeader { - border-top: 1px solid #eee; } - .AdminThemeReno .pw-content #CommentListHeader .MarkupPagerNav { - margin-top: 0.5em; } - -@media only screen and (max-width: 960px) { - .pw-content .MarkupPagerNav { - float: none; } - - #CommentListHeader { - padding-bottom: 1em; - padding-top: 1em; } - #CommentListHeader .MarkupPagerNav { - float: none; } - #CommentListHeader p { - margin-top: 0; - margin-bottom: 0; - padding-right: 1em; - padding-left: 0 !important; } - #CommentListHeader .CommentCheckAll { - width: auto; } } -@media only screen and (max-width: 768px) { - .CommentItem table { - width: 100%; - float: none; } - .CommentItem table th { - padding-left: 0 !important; } - .CommentItem .CommentContent { - width: 100%; - float: none; - padding-left: 0; } - .CommentItem .CommentContent .CommentText { - padding-right: 0; } - .CommentItem .CommentContent .CommentTextOverflow { - overflow-y: auto; - max-height: inherit; } } -.WireTabs { - opacity: 0; } - -/*# sourceMappingURL=ProcessCommentsManager.css.map */ +#CommentListHeader{padding-top:.5em;padding-bottom:.5em}#CommentListHeader>p{line-height:2.25em;padding-right:1em;margin-top:.25em;margin-bottom:.25em}#CommentListHeader .MarkupPagerNav{margin-top:0;margin-bottom:.5em}#CommentListHeader .CommentLimitSelect{float:left}#CommentListHeader .CommentCheckAll{display:block;float:left;padding-left:.75em}#CommentListHeader .CommentActions{float:left}#CommentListHeader .CommentSorts{float:left}.CommentItems{clear:both;border-bottom:1px solid #777}.CommentItems+button.ui-button{margin-top:1em}.CommentItem{clear:both;border-top:1px solid #777;padding:.75em 0;margin:0;width:100%}.CommentItem.CommentChecked{background-color:#eee}.CommentItem.CommentChecked th{color:#999}.CommentItem table{width:45%;float:left}.CommentItem table th,.CommentItem table td{padding:4px 10px 4px 0;border-bottom:1px solid #ddd;vertical-align:top}.CommentItem table th{font-weight:bold;white-space:nowrap;text-align:left;padding-left:.75em !important}.CommentItem table th:first-child{width:80px}.CommentItem table tr:last-child td,.CommentItem table tr:last-child th{border-bottom:none}.CommentItem .CommentTitle th,.CommentItem .CommentTitle td{padding-top:0}.CommentItem .CommentChangedIcon{display:none}.CommentItem.CommentItemChanged .CommentChangedIcon{display:inline;float:right;opacity:.3}.CommentItem input[type=number]{width:4em}.CommentItem .CommentVotes label{margin-right:1em}.CommentItem .CommentVotes .CommentUpvotes span{font-weight:bold;color:green}.CommentItem .CommentVotes .CommentDownvotes span{font-weight:bold;color:red}.CommentItem .CommentStars>span{display:inline;cursor:pointer;padding-right:3px}.CommentItem .CommentStars>span i.fa{font-size:18px !important}.CommentItem .CommentContent{float:left;width:55%;padding-left:1em;border:none}.CommentItem .CommentContent .CommentChildrenInfo{margin-top:.5em}.CommentItem .CommentContent .CommentReplyInfo{margin-bottom:0}.CommentItem .CommentContent .CommentText{cursor:pointer;padding-right:1em}.CommentItem .CommentContent .CommentText textarea{font-size:1em;width:100%;min-height:15em;margin-top:1em;margin-bottom:1em}.CommentItem .CommentContent .CommentText .CommentTextEdit{white-space:nowrap}.CommentItem .CommentContent .CommentTextOverflow{overflow-y:scroll;max-height:15em}.CommentItem label.CommentStatus{white-space:nowrap}.CommentItem.CommentItemStatus999{display:none}.CommentCheckAll label .detail,.CommentItem .CommentTitle th label .detail{font-weight:bold;color:#444}.pw-content .MarkupPagerNav{padding-top:.5em;float:right}.pw-content .MarkupPagerNav+button{margin-top:1em}.AdminThemeReno .pw-content .MarkupPagerNav li a,.AdminThemeReno .pw-content .MarkupPagerNav li:first-child a,.AdminThemeReno .pw-content .MarkupPagerNav li.MarkupPagerNavOn a{border-color:#fff !important;border:none !important;border-left:1px solid #fff !important}.AdminThemeReno .pw-content .MarkupPagerNav li{margin-bottom:1px}.AdminThemeReno .pw-content #CommentListHeader{border-top:1px solid #eee}.AdminThemeReno .pw-content #CommentListHeader .MarkupPagerNav{margin-top:.5em}@media only screen and (max-width: 960px){.pw-content .MarkupPagerNav{float:none}#CommentListHeader{padding-bottom:1em;padding-top:1em}#CommentListHeader .MarkupPagerNav{float:none}#CommentListHeader p{margin-top:0;margin-bottom:0;padding-right:1em;padding-left:0 !important}#CommentListHeader .CommentCheckAll{width:auto}}@media only screen and (max-width: 768px){.CommentItem table{width:100%;float:none}.CommentItem table th{padding-left:0 !important}.CommentItem .CommentContent{width:100%;float:none;padding-left:0}.CommentItem .CommentContent .CommentText{padding-right:0}.CommentItem .CommentContent .CommentTextOverflow{overflow-y:auto;max-height:inherit}}.WireTabs{opacity:0} diff --git a/wire/modules/Process/ProcessCommentsManager/ProcessCommentsManager.js b/wire/modules/Process/ProcessCommentsManager/ProcessCommentsManager.js index ab393d68..2f73c3cf 100644 --- a/wire/modules/Process/ProcessCommentsManager/ProcessCommentsManager.js +++ b/wire/modules/Process/ProcessCommentsManager/ProcessCommentsManager.js @@ -15,6 +15,7 @@ $(document).ready(function() { var $parent = $(this).closest('.CommentTextEditable'); $parent.parent('.CommentText').removeClass('CommentTextOverflow'); $textarea.attr('name', $parent.attr('id')); + $textarea.addClass($parent.attr('data-textarea-class')); //$textarea.height($parent.height()); $(this).remove(); // remove edit link $textarea.val($parent.text()); diff --git a/wire/modules/Process/ProcessCommentsManager/ProcessCommentsManager.min.js b/wire/modules/Process/ProcessCommentsManager/ProcessCommentsManager.min.js index f4cc51b0..dc0fc454 100644 --- a/wire/modules/Process/ProcessCommentsManager/ProcessCommentsManager.min.js +++ b/wire/modules/Process/ProcessCommentsManager/ProcessCommentsManager.min.js @@ -1 +1 @@ -$(document).ready(function(){var c=false;$(document).on("click",".WireTabs a",function(d){if(c){window.location.href=$(this).attr("href")}return false});$(".WireTabs").css("opacity",1);$(".WireTabs a.on").parent("li").click();$("a.CommentTextEdit").click(function(){var e=$("");var d=$(this).closest(".CommentTextEditable");d.parent(".CommentText").removeClass("CommentTextOverflow");e.attr("name",d.attr("id"));$(this).remove();e.val(d.text());d.after(e);d.remove();return false});$(".CommentText").click(function(){$(this).find("a.CommentTextEdit").click();return false});$(".CommentItem").each(function(){var e=$(this);var f=e.find(".CommentItemInfo");var d=f.height()+30;var g=e.find(".CommentText");if(g.height()>d){g.addClass("CommentTextOverflow")}});$("#CommentLimitSelect").change(function(){window.location="./?limit="+parseInt($(this).val())});$("#CommentListSort").change(function(){window.location="./?sort="+$(this).val()});function b(e){var d=e.closest(".CommentItem");if(e.is(":checked")){d.addClass("CommentChecked")}else{d.removeClass("CommentChecked")}}$(".CommentCheckbox").click(function(){b($(this))});$("#CommentCheckAll").click(function(){var d=$(".CommentCheckbox");if($(this).is(":checked")){d.attr("checked","checked")}else{d.removeAttr("checked")}d.each(function(){b($(this))})});$("#CommentActions").change(function(){var e=$(this).val();if(!e.length){return}var d=$(".CommentChecked");if(d.length){d.each(function(){if(e=="reset-upvotes"){$(this).find(".CommentUpvotes > input").val(0).change()}else{if(e=="reset-downvotes"){$(this).find(".CommentDownvotes > input").val(0).change()}else{$(this).find(".CommentStatus > input[value='"+e+"']").click()}}});d.effect("highlight",500)}else{ProcessWire.alert($(this).attr("data-nochecked"))}$(this).val("")});$(document).on("change",".CommentItem :input",function(){var d=$(this);if(d.is("[type='checkbox']")){return}$(this).closest(".CommentItem").addClass("CommentItemChanged")});$("#CommentListForm").submit(function(){$(this).addClass("CommentListFormSubmitted")});window.addEventListener("beforeunload",function(f){if($(".CommentListFormSubmitted").length){return}var d=$(".CommentItemChanged");if(d.length==0){return}var g=$("#CommentListForm").attr("data-unsaved");(f||window.event).returnValue=g;return g});var a=$(".WireTabs a.on").css("border-top-color");$("#CommentListHeader").css("border-top-color",a);c=true}); \ No newline at end of file +$(document).ready(function(){var ready=false;$(document).on("click",".WireTabs a",function($event){if(ready)window.location.href=$(this).attr("href");return false});$(".WireTabs").css("opacity",1);$(".WireTabs a.on").parent("li").click();$("a.CommentTextEdit").click(function(){var $textarea=$("");var $parent=$(this).closest(".CommentTextEditable");$parent.parent(".CommentText").removeClass("CommentTextOverflow");$textarea.attr("name",$parent.attr("id"));$textarea.addClass($parent.attr("data-textarea-class"));$(this).remove();$textarea.val($parent.text());$parent.after($textarea);$parent.remove();return false});$(".CommentText").click(function(){$(this).find("a.CommentTextEdit").click();return false});$(".CommentItem").each(function(){var $item=$(this);var $table=$item.find(".CommentItemInfo");var height=$table.height()+30;var $text=$item.find(".CommentText");if($text.height()>height){$text.addClass("CommentTextOverflow")}});$("#CommentLimitSelect").change(function(){window.location="./?limit="+parseInt($(this).val())});$("#CommentListSort").change(function(){window.location="./?sort="+$(this).val()});function commentCheckboxClicked($checkbox){var $item=$checkbox.closest(".CommentItem");if($checkbox.is(":checked")){$item.addClass("CommentChecked")}else{$item.removeClass("CommentChecked")}}$(".CommentCheckbox").click(function(){commentCheckboxClicked($(this))});$("#CommentCheckAll").click(function(){var $items=$(".CommentCheckbox");if($(this).is(":checked")){$items.attr("checked","checked")}else{$items.removeAttr("checked")}$items.each(function(){commentCheckboxClicked($(this))})});$("#CommentActions").change(function(){var val=$(this).val();if(!val.length)return;var $checkedItems=$(".CommentChecked");if($checkedItems.length){$checkedItems.each(function(){if(val=="reset-upvotes"){$(this).find(".CommentUpvotes > input").val(0).change()}else if(val=="reset-downvotes"){$(this).find(".CommentDownvotes > input").val(0).change()}else{$(this).find(".CommentStatus > input[value='"+val+"']").click()}});$checkedItems.effect("highlight",500)}else{ProcessWire.alert($(this).attr("data-nochecked"))}$(this).val("")});$(document).on("change",".CommentItem :input",function(){var $this=$(this);if($this.is("[type='checkbox']"))return;$(this).closest(".CommentItem").addClass("CommentItemChanged")});$("#CommentListForm").submit(function(){$(this).addClass("CommentListFormSubmitted")});window.addEventListener("beforeunload",function(e){if($(".CommentListFormSubmitted").length)return;var $changes=$(".CommentItemChanged");if($changes.length==0)return;var msg=$("#CommentListForm").attr("data-unsaved");(e||window.event).returnValue=msg;return msg});var color=$(".WireTabs a.on").css("border-top-color");$("#CommentListHeader").css("border-top-color",color);ready=true}); \ No newline at end of file diff --git a/wire/modules/Process/ProcessCommentsManager/ProcessCommentsManager.module b/wire/modules/Process/ProcessCommentsManager/ProcessCommentsManager.module index 36eaafa5..40e5b2e7 100644 --- a/wire/modules/Process/ProcessCommentsManager/ProcessCommentsManager.module +++ b/wire/modules/Process/ProcessCommentsManager/ProcessCommentsManager.module @@ -99,12 +99,14 @@ class ProcessCommentsManager extends Process { $this->wire('modules')->get('FieldtypeComments'); parent::init(); $this->statuses = array( + Comment::statusFeatured => 'featured', Comment::statusApproved => 'approved', Comment::statusPending => 'pending', Comment::statusSpam => 'spam', Comment::statusDelete => 'delete' ); $this->statusTranslations = array( + Comment::statusFeatured => $this->_('Featured'), Comment::statusApproved => $this->_('Approved'), Comment::statusPending => $this->_('Pending'), Comment::statusSpam => $this->_('Spam'), @@ -359,13 +361,28 @@ class ProcessCommentsManager extends Process { $children = $comment->children(); $numChildren = count($children); } + + $adminTheme = $this->wire('adminTheme'); + if($adminTheme && $adminTheme instanceof AdminThemeFramework) { + $inputClass = $adminTheme->getClass('input-small'); + $textareaClass = $adminTheme->getClass('textarea'); + $radioClass = $adminTheme->getClass('input-radio'); + $checkboxClass = $adminTheme->getClass('input-checkbox'); + $tableClass = $adminTheme->getClass('table'); + } else { + $inputClass = ''; + $textareaClass = ''; + $radioClass = ''; + $checkboxClass = ''; + $tableClass = ''; + } foreach($this->statusTranslations as $status => $label) { $checked = $comment->status == $status ? " checked='checked'" : ''; if($status == Comment::statusDelete && $numChildren) continue; $type .= "   "; } @@ -382,23 +399,23 @@ class ProcessCommentsManager extends Process { $text = preg_replace('/\r?(\n)/', '\r', $text); $text = str_replace('\r\r', "
\n
\n", $text); $text = str_replace('\r', "
\n", $text); - + $page = $comment->getPage(); if($page->editable()) { $text = - "
" . + "
" . "

$text  " . $this->_('edit') . "

" . "
"; } $out = - "" . + "
" . "" . "" . @@ -452,11 +469,11 @@ class ProcessCommentsManager extends Process { "" . "" . @@ -510,9 +527,12 @@ class ProcessCommentsManager extends Process { $setStatusLabel = $this->_('Set status:'); $perPageLabel = $this->_('per page'); + $adminTheme = $this->wire('adminTheme'); + $selectClass = $adminTheme && $adminTheme instanceof AdminThemeFramework ? $adminTheme->getClass('select') : ''; + $checkboxClass = $adminTheme && $adminTheme instanceof AdminThemeFramework ? $adminTheme->getClass('input-checkbox') : ''; $pagerLimitOut = " - @@ -523,12 +543,12 @@ class ProcessCommentsManager extends Process { $checkAllLabel = $this->_('Check/uncheck all'); $checkAll = - "
" . "" . "" . $this->_('Votes') . "" . " " . " " . "