##// END OF EJS Templates
Load moderation menu on demand
neko259 -
r1815:df75139a default
parent child Browse files
Show More
@@ -54,49 +54,53 b''
54 $.contextMenu({
54 $.contextMenu({
55 selector: '#{{ post.id }} .moderation-menu',
55 selector: '#{{ post.id }} .moderation-menu',
56 trigger: 'left',
56 trigger: 'left',
57 items: {
57 build: function($trigger, e) {
58 edit: {
58 return {
59 name: '{% trans "Edit" %}',
59 items: {
60 callback: function(key, opt) {
60 edit: {
61 window.location = '{% url 'admin:boards_post_change' post.id %}';
61 name: '{% trans "Edit" %}',
62 },
62 callback: function(key, opt) {
63 visible: {% if perms.boards.change_post %}true{% else %}false{% endif %}
63 window.location = '{% url 'admin:boards_post_change' post.id %}';
64 },
64 },
65 deletePost: {
65 visible: {% if perms.boards.change_post %}true{% else %}false{% endif %}
66 name: '{% trans "Delete post" %}',
66 },
67 callback: function(key, opt) {
67 deletePost: {
68 window.location = '{% url 'admin:boards_post_delete' post.id %}';
68 name: '{% trans "Delete post" %}',
69 },
69 callback: function(key, opt) {
70 visible: {% if not is_opening and perms.boards.delete_post %}true{% else %}false{% endif %}
70 window.location = '{% url 'admin:boards_post_delete' post.id %}';
71 },
71 },
72 editThread: {
72 visible: {% if not is_opening and perms.boards.delete_post %}true{% else %}false{% endif %}
73 name: '{% trans "Edit thread" %}',
73 },
74 callback: function(key, opt) {
74 editThread: {
75 window.location = '{% url 'admin:boards_thread_change' thread.id %}';
75 name: '{% trans "Edit thread" %}',
76 },
76 callback: function(key, opt) {
77 visible: {% if is_opening and perms.boards.change_thread %}true{% else %}false{% endif %}
77 window.location = '{% url 'admin:boards_thread_change' thread.id %}';
78 },
78 },
79 deleteThread: {
79 visible: {% if is_opening and perms.boards.change_thread %}true{% else %}false{% endif %}
80 name: '{% trans "Delete thread" %}',
80 },
81 callback: function(key, opt) {
81 deleteThread: {
82 window.location = '{% url 'admin:boards_thread_delete' thread.id %}';
82 name: '{% trans "Delete thread" %}',
83 },
83 callback: function(key, opt) {
84 visible: {% if is_opening and perms.boards.delete_thread %}true{% else %}false{% endif %}
84 window.location = '{% url 'admin:boards_thread_delete' thread.id %}';
85 },
85 },
86 findByIp: {
86 visible: {% if is_opening and perms.boards.delete_thread %}true{% else %}false{% endif %}
87 name: 'IP = {{ post.poster_ip }}',
87 },
88 callback: function(key, opt) {
88 findByIp: {
89 window.location = '{% url "feed" %}?ip={{ post.poster_ip }}';
89 name: 'IP = {{ post.poster_ip }}',
90 },
90 callback: function(key, opt) {
91 visible: {% if post.has_ip %}true{% else %}false{% endif %}
91 window.location = '{% url "feed" %}?ip={{ post.poster_ip }}';
92 },
92 },
93 raw: {
93 visible: {% if post.has_ip %}true{% else %}false{% endif %}
94 name: 'RAW',
94 },
95 callback: function(key, opt) {
95 raw: {
96 window.location = '{% url 'post_sync_data' post.id %}';
96 name: 'RAW',
97 },
97 callback: function(key, opt) {
98 visible: {% if post.global_id_id %}true{% else %}false{% endif %}
98 window.location = '{% url 'post_sync_data' post.id %}';
99 }
99 },
100 visible: {% if post.global_id_id %}true{% else %}false{% endif %}
101 }
102 }
103 };
100 }
104 }
101 });
105 });
102 </script>
106 </script>
General Comments 0
You need to be logged in to leave comments. Login now