summaryrefslogtreecommitdiffstats
path: root/askbot/skins
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-09-06 00:01:17 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-09-06 00:01:17 -0400
commitc46cbfb2e5bf1d28a5fbfbcf156e5d3509241316 (patch)
tree2443b45bdf2baa72b9e778849a655b3cab202f67 /askbot/skins
parent3f6ee303f6df25fad5618d113b5b401e707c4fe8 (diff)
downloadaskbot-c46cbfb2e5bf1d28a5fbfbcf156e5d3509241316.tar.gz
askbot-c46cbfb2e5bf1d28a5fbfbcf156e5d3509241316.tar.bz2
askbot-c46cbfb2e5bf1d28a5fbfbcf156e5d3509241316.zip
group join moderation works
Diffstat (limited to 'askbot/skins')
-rw-r--r--askbot/skins/default/media/style/style.less2
-rw-r--r--askbot/skins/default/templates/500.html5
-rw-r--r--askbot/skins/default/templates/macros.html2
-rw-r--r--askbot/skins/default/templates/user_inbox/base.html63
-rw-r--r--askbot/skins/default/templates/user_inbox/group_join_requests.html50
-rw-r--r--askbot/skins/default/templates/user_inbox/responses_and_flags.html43
-rw-r--r--askbot/skins/default/templates/user_profile/group_join_requests.html108
-rw-r--r--askbot/skins/default/templates/user_profile/user_inbox.html114
8 files changed, 158 insertions, 229 deletions
diff --git a/askbot/skins/default/media/style/style.less b/askbot/skins/default/media/style/style.less
index d64bd6c8..e7f219b2 100644
--- a/askbot/skins/default/media/style/style.less
+++ b/askbot/skins/default/media/style/style.less
@@ -194,7 +194,7 @@ body.user-messages {
.notification {
margin-top: 6px;
- margin-bottom: 6px;
+ /*margin-bottom: 6px;*/
font-size: 16px;
color:#424242
}
diff --git a/askbot/skins/default/templates/500.html b/askbot/skins/default/templates/500.html
deleted file mode 100644
index 8ec1bce4..00000000
--- a/askbot/skins/default/templates/500.html
+++ /dev/null
@@ -1,5 +0,0 @@
-{% load extra_tags %}
-{% include_jinja "500.jinja.html" request %}
-{% comment %}this template must be django
-because of the use of default handler500
-{% endcomment %}
diff --git a/askbot/skins/default/templates/macros.html b/askbot/skins/default/templates/macros.html
index b810cada..afdde6b6 100644
--- a/askbot/skins/default/templates/macros.html
+++ b/askbot/skins/default/templates/macros.html
@@ -17,7 +17,7 @@
{{ response.response_type }}
({{ timeago(response.timestamp) }}):<br/>
{% if inbox_section != 'flags' %}
- {{ response.response_snippet|escape }}
+ {{ response.response_snippet }}
{% endif %}
</a>
{% if inbox_section == 'flags' %}
diff --git a/askbot/skins/default/templates/user_inbox/base.html b/askbot/skins/default/templates/user_inbox/base.html
new file mode 100644
index 00000000..4d74f8bc
--- /dev/null
+++ b/askbot/skins/default/templates/user_inbox/base.html
@@ -0,0 +1,63 @@
+{% extends "user_profile/user.html" %}
+{% block before_css %}
+ <link href="{{'/bootstrap/css/bootstrap.css'|media}}" rel="stylesheet" type="text/css" />
+{% endblock %}
+{% block profilesection %}
+ {% trans %}inbox{% endtrans %}
+{% endblock %}
+{% block usercontent %}
+<div style="padding-top:5px;font-size:13px;">
+ {% set re_count = request.user.new_response_count +
+ request.user.seen_response_count
+ %}
+ {% if re_count + flags_count + group_join_requests_count > 0 %}
+ <div id="re_sections">
+ {% trans %}Sections:{% endtrans %}
+ {% set sep = joiner('|') %}
+ {% if re_count > 0 %}{{ sep() }}
+ <a href="{{request.user.get_absolute_url()}}?sort=inbox&section=forum"
+ {% if inbox_section == 'forum' %}class="on"{% endif %}
+ >
+ {% trans %}forum responses ({{re_count}}){% endtrans -%}
+ </a>
+ {% endif %}
+ {% if flags_count > 0 %}{{ sep() }}
+ <a href="{{request.user.get_absolute_url()}}?sort=inbox&section=flags"
+ {% if inbox_section == 'flags' %}class="on"{% endif %}
+ >
+ {% trans %}flagged items ({{flags_count}}){% endtrans %}
+ </a>
+ {% endif %}
+ {% if group_join_requests_count %}{{ sep() }}
+ <a href="{{request.user.get_absolute_url()}}?sort=inbox&section=join_requests"
+ {% if inbox_section == 'join_requests' %}class="on"{% endif %}
+ >
+ {% trans %}group join requests{% endtrans %}
+ </a>
+ {% endif %}
+ </div>
+ {% endif %}
+ {% block inbox_content %}
+ {% endblock %}
+</div>
+{% endblock %}
+{% block userjs %}
+ <script type="text/javascript">
+ var askbot = askbot || {};
+ askbot['urls'] = askbot['urls'] || {};
+ askbot['urls']['manageInbox'] = '{% url manage_inbox %}';
+ askbot['urls']['save_post_reject_reason'] = '{% url save_post_reject_reason %}';
+ askbot['urls']['delete_post_reject_reason'] = '{% url delete_post_reject_reason %}';
+ {% if request.user.is_administrator_or_moderator() %}
+ askbot['data']['postRejectReasons'] = [
+ {% for reason in post_reject_reasons %}
+ {'id': {{reason.id}}, 'title': '{{reason.title|escapejs}}'},
+ {% endfor %}
+ ];
+ {% endif %}
+ $(document).ready(function(){
+ $('body').addClass('inbox-{{ inbox_section }}');
+ setup_inbox();
+ });
+ </script>
+{% endblock %}
diff --git a/askbot/skins/default/templates/user_inbox/group_join_requests.html b/askbot/skins/default/templates/user_inbox/group_join_requests.html
new file mode 100644
index 00000000..2defe5e1
--- /dev/null
+++ b/askbot/skins/default/templates/user_inbox/group_join_requests.html
@@ -0,0 +1,50 @@
+{% extends "user_inbox/base.html" %}
+{% import "macros.html" as macros %}
+{% block profilesection %}
+ {% trans %}inbox - group join requests{% endtrans %}
+{% endblock %}
+{% block inbox_content %}
+ <table>
+ {% for join_request in join_requests %}
+ <tr>
+ <td>{% trans
+ user=join_request.user,
+ group=groups_dict[join_request.object_id].name
+ %}{{ user }} wants to join group {{ group }}{% endtrans %}
+ </td>
+ <td>{# forms with accept and reject buttons #}
+ <form action="{% url moderate_group_join_request %}" method="post"
+ >{% csrf_token %}
+ <input
+ type="hidden"
+ name="request_id"
+ value="{{join_request.id}}"
+ />
+ <input type="hidden" name="action" value="approve"/>
+ <input
+ class="btn"
+ type="submit"
+ value="{% trans %}Approve{% endtrans %}"
+ />
+ </form>
+ </td>
+ <td>
+ <form action="{% url moderate_group_join_request %}" method="post">
+ {% csrf_token %}
+ <input
+ type="hidden"
+ name="request_id"
+ value="{{join_request.id}}"
+ />
+ <input type="hidden" name="action" value="deny"/>
+ <input
+ class="btn"
+ type="submit"
+ value="{% trans %}Deny{% endtrans %}"
+ />
+ </form>
+ </td>
+ </tr>
+ {% endfor %}
+ </table>
+{% endblock %}
diff --git a/askbot/skins/default/templates/user_inbox/responses_and_flags.html b/askbot/skins/default/templates/user_inbox/responses_and_flags.html
new file mode 100644
index 00000000..c889bb0a
--- /dev/null
+++ b/askbot/skins/default/templates/user_inbox/responses_and_flags.html
@@ -0,0 +1,43 @@
+{% extends "user_inbox/base.html" %}
+{% import "macros.html" as macros %}
+{% block profilesection %}
+ {% trans %}inbox - responses{% endtrans %}
+{% endblock %}
+{% block inbox_content %}
+ <div id="re_tools">
+ <strong>{% trans %}select:{% endtrans %}</strong>
+ <a id="sel_all">{% trans %}all{% endtrans %}</a> |
+ <a id="sel_seen">{% trans %}seen{% endtrans %}</a> |
+ <a id="sel_new">{% trans %}new{% endtrans %}</a> |
+ <a id="sel_none">{% trans %}none{% endtrans %}</a><br />
+ <div class="btn-group">
+ {% if inbox_section == 'forum' %}
+ <a class="btn" id="re_mark_seen">{% trans %}mark as seen{% endtrans %}</a>
+ <a class="btn" id="re_mark_new">{% trans %}mark as new{% endtrans %}</a>
+ <a class="btn" id="re_dismiss">{% trans %}dismiss{% endtrans %}</a>
+ {% else %}
+ <a class="btn" id="re_remove_flag">{% trans %}remove flags/approve{% endtrans %}</a>
+ <a
+ class="btn"
+ id="re_delete_post"
+ >{% trans %}delete post{% endtrans %}</a>
+ {% endif %}
+ </div>
+ </div>
+ {% include "user_profile/reject_post_dialog.html" %}
+ <div id="responses">
+ {% for response in responses %}
+ <div class="response-parent" data-response-id="{{response.id}}">
+ <p class="headline">
+ <strong>"{{ response.response_title.strip()|escape}}"</strong>
+ </p>
+ {{ macros.inbox_post_snippet(response, inbox_section) }}
+ {% for nested_response in response.nested_responses %}
+ {{ macros.inbox_post_snippet(nested_response, inbox_section) }}
+ {%endfor%}
+ </div>
+ <div class="clearfix"></div>
+ {% endfor %}
+ </div>
+ </div>
+{% endblock %}
diff --git a/askbot/skins/default/templates/user_profile/group_join_requests.html b/askbot/skins/default/templates/user_profile/group_join_requests.html
deleted file mode 100644
index 6d484b88..00000000
--- a/askbot/skins/default/templates/user_profile/group_join_requests.html
+++ /dev/null
@@ -1,108 +0,0 @@
-{% extends "user_profile/user.html" %}
-{% import "macros.html" as macros %}
-{% block before_css %}
- <link href="{{'/bootstrap/css/bootstrap.css'|media}}" rel="stylesheet" type="text/css" />
-{% endblock %}
-<!-- user_responses.html -->
-{#
-This template accepts a list of response list
-they are a generalized form of any response and
-
-The following properties of response object are used:
-timestamp - when it happened
-user - user who gave response (database object)
-response_type - type of response
-response_url - link to the question
-response_title - title of the question
-response_snippet - abbreviated content of the response
-inbox_section - forum|flags
-#}
-{% block profilesection %}
- {% trans %}inbox{% endtrans %}
-{% endblock %}
-{% block usercontent %}
- <div style="padding-top:5px;font-size:13px;">
- {% set re_count = request.user.new_response_count +
- request.user.seen_response_count
- %}
- {% if moderation_items %}
- {% set flag_count = moderation_items['new_count'] +
- moderation_items['seen_count']
- %}
- {% else %}
- {% set flag_count = 0 %}
- {% endif %}
- {% if re_count > 0 and flag_count > 0 %}
- <div id="re_sections">
- {% trans %}Sections:{% endtrans %}
- <a href="{{request.user.get_absolute_url()}}?sort=inbox&section=forum"
- {% if inbox_section == 'forum' %}class="on"{% endif %}
- >
- {% trans %}forum responses ({{re_count}}){% endtrans -%}
- </a> |
- <a href="{{request.user.get_absolute_url()}}?sort=inbox&section=flags"
- {% if inbox_section == 'flags' %}class="on"{% endif %}
- >
- {% trans %}flagged items ({{flag_count}}){% endtrans %}
- </a>
- {% if join_requests_count %} |
- <a href="{{request.user.get_absolute_url()}}?sort=inbox&section=join_requests"
- {% if inbox_section == 'join_requests' %}class="on"{% endif %}
- >
- {% trans %}group join requests{% endtrans %}
- </a>
- {% endif %}
- </div>
- {% endif %}
- {# content #}
- <table>
- {% for join_request in join_requests %}
- <tr>
- <td>{% trans
- user=join_request.user
- group=groups_dict[join_request.object_id].name
- %}{{ user }} wants to join group {{ group }}{% endtrans %}
- </td>
- <td>{# forms with accept and reject buttons #}
- <form action="{% url moderate_group_join_request %}" method="post">
- <input
- type="hidden"
- name="request_id"
- value="{{join_request.id}}"
- />
- <input type="hidden" name="action" value="approve"/>
- <input
- class="btn"
- type="submit"
- value="{% trans %}Approve{% endtrans %}"
- />
- </form>
- <form action="{% url moderate_group_join_request %}" method="post">
- <input
- type="hidden"
- name="request_id"
- value="{{join_request.id}}"
- />
- <input type="hidden" name="action" value="deny"/>
- <input
- class="btn"
- type="submit"
- value="{% trans %}Deny{% endtrans %}"
- />
- </form>
- </td>
- </tr>
- {% endfor %}
- <table>
- data = {
- 'active_tab':'users',
- 'page_class': 'user-profile-page',
- 'tab_name' : 'join_requests',
- 'tab_description' : _('group joining requests'),
- 'page_title' : _('profile - moderation'),
- 'groups_dict': groups_dict,
- 'join_requests': join_requests
- }
-{% endblock %}
-{% block userjs %}
-{% endblock %}
diff --git a/askbot/skins/default/templates/user_profile/user_inbox.html b/askbot/skins/default/templates/user_profile/user_inbox.html
deleted file mode 100644
index 076f957c..00000000
--- a/askbot/skins/default/templates/user_profile/user_inbox.html
+++ /dev/null
@@ -1,114 +0,0 @@
-{% extends "user_profile/user.html" %}
-{% import "macros.html" as macros %}
-{% block before_css %}
- <link href="{{'/bootstrap/css/bootstrap.css'|media}}" rel="stylesheet" type="text/css" />
-{% endblock %}
-<!-- user_responses.html -->
-{#
-This template accepts a list of response list
-they are a generalized form of any response and
-
-The following properties of response object are used:
-timestamp - when it happened
-user - user who gave response (database object)
-response_type - type of response
-response_url - link to the question
-response_title - title of the question
-response_snippet - abbreviated content of the response
-inbox_section - forum|flags
-#}
-{% block profilesection %}
- {% trans %}inbox{% endtrans %}
-{% endblock %}
-{% block usercontent %}
- <div style="padding-top:5px;font-size:13px;">
- {% set re_count = request.user.new_response_count +
- request.user.seen_response_count
- %}
- {% if moderation_items %}
- {% set flag_count = moderation_items['new_count'] +
- moderation_items['seen_count']
- %}
- {% else %}
- {% set flag_count = 0 %}
- {% endif %}
- {% if re_count > 0 and flag_count > 0 %}
- <div id="re_sections">
- {% trans %}Sections:{% endtrans %}
- <a href="{{request.user.get_absolute_url()}}?sort=inbox&section=forum"
- {% if inbox_section == 'forum' %}class="on"{% endif %}
- >
- {% trans %}forum responses ({{re_count}}){% endtrans -%}
- </a> |
- <a href="{{request.user.get_absolute_url()}}?sort=inbox&section=flags"
- {% if inbox_section == 'flags' %}class="on"{% endif %}
- >
- {% trans %}flagged items ({{flag_count}}){% endtrans %}
- </a>
- {% if join_requests_count %} |
- <a href="{{request.user.get_absolute_url()}}?sort=inbox&section=join_requests"
- {% if inbox_section == 'join_requests' %}class="on"{% endif %}
- >
- {% trans %}group join requests{% endtrans %}
- </a>
- {% endif %}
- </div>
- {% endif %}
- <div id="re_tools">
- <strong>{% trans %}select:{% endtrans %}</strong>
- <a id="sel_all">{% trans %}all{% endtrans %}</a> |
- <a id="sel_seen">{% trans %}seen{% endtrans %}</a> |
- <a id="sel_new">{% trans %}new{% endtrans %}</a> |
- <a id="sel_none">{% trans %}none{% endtrans %}</a><br />
- <div class="btn-group">
- {% if inbox_section == 'forum' %}
- <a class="btn" id="re_mark_seen">{% trans %}mark as seen{% endtrans %}</a>
- <a class="btn" id="re_mark_new">{% trans %}mark as new{% endtrans %}</a>
- <a class="btn" id="re_dismiss">{% trans %}dismiss{% endtrans %}</a>
- {% else %}
- <a class="btn" id="re_remove_flag">{% trans %}remove flags/approve{% endtrans %}</a>
- <a
- class="btn"
- id="re_delete_post"
- >{% trans %}delete post{% endtrans %}</a>
- {% endif %}
- </div>
- </div>
- {% include "user_profile/reject_post_dialog.html" %}
- <div id="responses">
- {% for response in responses %}
- <div class="response-parent" data-response-id="{{response.id}}">
- <p class="headline">
- <strong>"{{ response.response_title.strip()|escape}}"</strong>
- </p>
- {{ macros.inbox_post_snippet(response, inbox_section) }}
- {% for nested_response in response.nested_responses %}
- {{ macros.inbox_post_snippet(nested_response, inbox_section) }}
- {%endfor%}
- </div>
- <div class="clearfix"></div>
- {% endfor %}
- </div>
- </div>
-{% endblock %}
-{% block userjs %}
- <script type="text/javascript">
- var askbot = askbot || {};
- askbot['urls'] = askbot['urls'] || {};
- askbot['urls']['manageInbox'] = '{% url manage_inbox %}';
- askbot['urls']['save_post_reject_reason'] = '{% url save_post_reject_reason %}';
- askbot['urls']['delete_post_reject_reason'] = '{% url delete_post_reject_reason %}';
- {% if request.user.is_administrator_or_moderator() %}
- askbot['data']['postRejectReasons'] = [
- {% for reason in post_reject_reasons %}
- {'id': {{reason.id}}, 'title': '{{reason.title|escapejs}}'},
- {% endfor %}
- ];
- {% endif %}
- $(document).ready(function(){
- $('body').addClass('inbox-{{ inbox_section }}');
- setup_inbox();
- });
- </script>
-<!-- end user_responses.html -->
-{% endblock %}