mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
changed a bunch of whitespace back into tabs, and fixed issue where categories without a parentCid were not showing up at all in the ACP
This commit is contained in:
@@ -11,7 +11,9 @@ div.categories {
|
||||
}
|
||||
}
|
||||
|
||||
.fa-ul {
|
||||
.stats {
|
||||
display: inline-block;
|
||||
|
||||
li {
|
||||
min-height: 0;
|
||||
display: inline;
|
||||
@@ -66,8 +68,4 @@ div.categories {
|
||||
.description {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.stats, .btn-group {
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,11 @@
|
||||
/*global define, socket, app, bootbox, templates, ajaxify, RELATIVE_PATH, Sortable */
|
||||
|
||||
define('admin/manage/categories', function() {
|
||||
var Categories = {}, newCategoryId = -1, sortables, itemTemplate;
|
||||
var Categories = {}, newCategoryId = -1, sortables;
|
||||
|
||||
Categories.init = function() {
|
||||
socket.emit('admin.categories.getAll', function(error, payload){
|
||||
console.log(payload);
|
||||
if(error){
|
||||
return app.alertError(error.message);
|
||||
}
|
||||
@@ -57,12 +58,12 @@ define('admin/manage/categories', function() {
|
||||
Categories.render = function(categories){
|
||||
var container = $('.categories');
|
||||
|
||||
if(!categories || categories.length == 0){
|
||||
if (!categories || categories.length == 0) {
|
||||
$('<div></div>')
|
||||
.addClass('alert alert-info text-center')
|
||||
.text('You have no active categories.')
|
||||
.appendTo(container);
|
||||
}else{
|
||||
} else {
|
||||
sortables = {};
|
||||
renderList(categories, container, 0);
|
||||
}
|
||||
|
||||
@@ -319,8 +319,11 @@ var async = require('async'),
|
||||
Categories.getTree = function(categories, parentCid) {
|
||||
var tree = [], i = 0, len = categories.length, category;
|
||||
|
||||
for(i; i < len; ++i){
|
||||
for(i; i < len; ++i) {
|
||||
category = categories[i];
|
||||
if (!category.hasOwnProperty('parentCid')) {
|
||||
category.parentCid = 0;
|
||||
}
|
||||
|
||||
if(category.parentCid == parentCid){
|
||||
tree.push(category);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!-- BEGIN categories -->
|
||||
<li data-cid="{categories.cid}" <!-- IF categories.disabled -->class="disabled"<!-- ENDIF categories.disabled -->>
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
<div class="col-md-8">
|
||||
<div class="clearfix">
|
||||
<div class="icon" style="color: {categories.color}; background-color: {categories.bgColor};<!-- IF categories.backgroundImage --> background-image: url('{categories.backgroundImage}');<!-- ENDIF categories.backgroundImage -->">
|
||||
<i data-name="icon" value="{categories.icon}" class="fa {categories.icon}"></i>
|
||||
@@ -13,11 +13,11 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="clearfix pull-right">
|
||||
<ul class="fa-ul stats">
|
||||
<li class="fa-li"><i class="fa fa-book"></i> {categories.topic_count}</li>
|
||||
<li class="fa-li"><i class="fa fa-pencil"></i> {categories.post_count}</li>
|
||||
<div class="col-md-4">
|
||||
<div class="clearfix pull-right text-right">
|
||||
<ul class="stats">
|
||||
<li><i class="fa fa-book"></i> {categories.topic_count}</li>
|
||||
<li><i class="fa fa-pencil"></i> {categories.post_count}</li>
|
||||
</ul>
|
||||
<div class="btn-group">
|
||||
<button data-action="toggle" data-disabled="{categories.disabled}" class="btn btn-xs <!-- IF categories.disabled -->btn-primary<!-- ELSE -->btn-danger<!-- ENDIF categories.disabled -->">
|
||||
|
||||
Reference in New Issue
Block a user