Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // one
- {% if item.active == item.STATUS_OFF %}
- {% url 'change_item_state' item.id 'activate' as activate_url %}
- off <a href="javascript:update_status({{ item.id }}, '{{ activate_url }}')">[on]</a>
- {% endif %}
- // two
- {% if item.active == item.STATUS_ON %}
- {% url 'change_item_state' item.id 'deactivate' as deactivate_url %}
- on <a href="javascript:update_status({{ item.id }}, '{{ deactivate_url }}')">[off]</a>
- {% endif %}
- // three
- {% url 'change_item_state' item.id 'hide' as hide_url %}
- <a href="javascript: update_status({{ item.id }}, '{{ hide_url }}', true)" title="Can't be undone.">[hide]</a>
- function update_status(item_id, url_val, hide_item) {
- if (true && !confirm('Do you really want to hide this item?')) return ;
- $.get(url_val, function(data) {
- if (data.html_text != '') {
- $('#status_' + item_id).html(data.html_text);
- }
- if (data.group_text != null) {
- $('#group_' + item_id).html(data.group_text);
- }
- }, 'json');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement