aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2016-05-25 18:52:10 -0400
committerPaul Duncan <pabs@pablotron.org>2016-05-25 18:52:10 -0400
commitb08a33c634e8c894cd742266d92c5d16fcf1d364 (patch)
tree8ef50659514a06b76d0f3879185d0baec3fc1479 /data
parent9679aa0d8f072a06f7c8af3b92c87fc3f23a804c (diff)
downloadguff-b08a33c634e8c894cd742266d92c5d16fcf1d364.tar.bz2
guff-b08a33c634e8c894cd742266d92c5d16fcf1d364.zip
cleanups, s/posted/public/
Diffstat (limited to 'data')
-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;