From 815ea88fa5aaa7d07f0f73446aa006ca2530f974 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 25 Mar 2015 11:58:21 -0400 Subject: [PATCH] readded some missing classes, fixed some styling on category.tpl, fixed image uploading code --- public/less/admin/admin.less | 22 ++++++++++++++++++++++ public/src/admin/manage/category.js | 2 +- src/views/admin/manage/categories.tpl | 20 ++++++++++++++++++++ src/views/admin/manage/category.tpl | 12 ++++++++---- 4 files changed, 51 insertions(+), 5 deletions(-) diff --git a/public/less/admin/admin.less b/public/less/admin/admin.less index 57e46db038..6331c3b1e2 100644 --- a/public/less/admin/admin.less +++ b/public/less/admin/admin.less @@ -295,3 +295,25 @@ max-width: calc( ~"(100% - 200px)/4" ); } } + +.category-preview { + width: 100%; + height: 100px; + text-align: center; + color: white; + margin-top: 0; + + .icon { + width: 30px; + height: 30px; + line-height: 40px; + display: inline-block; + margin: 35px 5px 0 5px; + } +} + +.table-reordering { + tr:hover { + cursor: move; + } +} diff --git a/public/src/admin/manage/category.js b/public/src/admin/manage/category.js index 5794084f61..d6057e2663 100644 --- a/public/src/admin/manage/category.js +++ b/public/src/admin/manage/category.js @@ -111,7 +111,7 @@ define('admin/manage/category', [ var inputEl = $(this), cid = inputEl.attr('data-cid'); - uploader.open(RELATIVE_PATH + '/admin/category/uploadpicture', { cid: cid }, 0, function(imageUrlOnServer) { + uploader.open(RELATIVE_PATH + '/api/admin/category/uploadpicture', { cid: cid }, 0, function(imageUrlOnServer) { inputEl.val(imageUrlOnServer); var previewBox = inputEl.parent().siblings('.category-preview'); previewBox.css('background', 'url(' + imageUrlOnServer + '?' + new Date().getTime() + ')') diff --git a/src/views/admin/manage/categories.tpl b/src/views/admin/manage/categories.tpl index 6c1dd413e1..3f94ff125e 100644 --- a/src/views/admin/manage/categories.tpl +++ b/src/views/admin/manage/categories.tpl @@ -15,6 +15,7 @@ + @@ -39,6 +40,15 @@ + + + +
+ You have no active categories. +
+ + + @@ -61,6 +71,7 @@ + @@ -85,6 +96,15 @@ + + + +
+ You have no disabled categories. +
+ + + diff --git a/src/views/admin/manage/category.tpl b/src/views/admin/manage/category.tpl index bfae5700a8..dcb045adf6 100644 --- a/src/views/admin/manage/category.tpl +++ b/src/views/admin/manage/category.tpl @@ -83,7 +83,7 @@ -
+
-
- +
+
+ +
- +
+ +