diff options
author | Paul Duncan <pabs@pablotron.org> | 2016-07-30 18:40:08 -0400 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2016-07-30 18:40:08 -0400 |
commit | bb2a315df93c173db84d2d6fc0cf1b2bdbd931a7 (patch) | |
tree | 831f46bd240348af1df70eb0abf98bb92b360f3e /data/assets/js/admin/tabs/sites.js | |
parent | 9cec164e724465c11ff91772cdad3126de663ade (diff) | |
download | guff-bb2a315df93c173db84d2d6fc0cf1b2bdbd931a7.tar.bz2 guff-bb2a315df93c173db84d2d6fc0cf1b2bdbd931a7.zip |
refactor site dialogs and add site editing
Diffstat (limited to 'data/assets/js/admin/tabs/sites.js')
-rw-r--r-- | data/assets/js/admin/tabs/sites.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/data/assets/js/admin/tabs/sites.js b/data/assets/js/admin/tabs/sites.js index 8644705..1ed7b48 100644 --- a/data/assets/js/admin/tabs/sites.js +++ b/data/assets/js/admin/tabs/sites.js @@ -81,11 +81,12 @@ jQuery(function($) { })); }).done(function(r) { list.html($.map(r, function(row) { - var active = (row.is_active == '1'); + var is_default = !!+row.is_default; return TEMPLATES.run('site', $.extend({}, row, { q: [row.site_id, row.slug, row.name, row.body].join(' ').toLowerCase(), - badge_css: +row.is_default ? '' : 'hidden', + badge_css: is_default ? '' : 'hidden', + css: is_default ? 'list-group-item-warning' : '', })); }).join('')); @@ -108,9 +109,8 @@ jQuery(function($) { $('#sites .active').removeClass('active'); $(this).addClass('active'); - // TODO - // $('#site-edit-dialog').data('site_id', site_id).modal('show'); - alert('TODO: edit site ' + site_id); + // show dialog + $('#site-edit-dialog').data('site_id', site_id).modal('show'); // stop event return false; |