aboutsummaryrefslogtreecommitdiff
path: root/data/assets/js
diff options
context:
space:
mode:
Diffstat (limited to 'data/assets/js')
-rw-r--r--data/assets/js/admin/tabs/posts.js42
1 files changed, 28 insertions, 14 deletions
diff --git a/data/assets/js/admin/tabs/posts.js b/data/assets/js/admin/tabs/posts.js
index 6bd4c4c..f2e082d 100644
--- a/data/assets/js/admin/tabs/posts.js
+++ b/data/assets/js/admin/tabs/posts.js
@@ -23,22 +23,31 @@ jQuery(function($) {
"</td>",
"<td>",
- "<a href='#' ",
- "class='edit-user' ",
- "title='Edit user %{user_name|h}.' ",
- "data-user_id='%{user_id|h}' ",
+ "<a ",
+ "href='#' ",
+ "class='edit' ",
+ "title='Edit site \"%{site_name|h}\".' ",
+ "data-edit='site' ",
+ "data-site_id='%{site_id|h}' ",
">",
- "%{user_name|h}",
+ "%{site_name|h}",
"</a>",
"</td>",
"<td>",
- // TODO: make editable
- "%{site_name|h}",
+ "%{post_url}",
"</td>",
"<td>",
- "%{post_url}",
+ "<a ",
+ "href='#' ",
+ "class='edit' ",
+ "title='Edit user \"%{user_name|h}\".' ",
+ "data-edit='user' ",
+ "data-user_id='%{user_id|h}' ",
+ ">",
+ "%{user_name|h}",
+ "</a>",
"</td>",
"<td title='%{created_at_text_full|h}'>",
@@ -106,10 +115,11 @@ jQuery(function($) {
.find('.loading').toggleClass('hidden');
send('post/get_posts', {
- type: $('#posts-filter-type li.active a').data('id'),
- state: $('#posts-filter-state li.active a').data('id'),
- q: $('#posts-q').data('q'),
- page: 1,
+ type: $('#posts-filter-type li.active a').data('id'),
+ state: $('#posts-filter-state li.active a').data('id'),
+ user_id: $('#posts-filter-user li.active a').data('id'),
+ q: $('#posts-q').data('q'),
+ page: 1,
}).always(function() {
$('#posts-reload').removeClass('disabled')
.find('.loading').toggleClass('hidden');
@@ -199,10 +209,14 @@ jQuery(function($) {
reload();
});
- $('#posts').on('click', 'a.edit-user', function() {
+ $('#posts').on('click', 'a.edit', function() {
var data = $(this).data();
- $('#user-edit-dialog').data(data).modal('show');
+ if (data.edit == 'user') {
+ $('#user-edit-dialog').data(data).modal('show');
+ } else if (data.edit == 'site') {
+ alert('TODO: edit site');
+ }
// stop event
return false;