]> git.parisson.com Git - teleforma.git/commitdiff
Postman migration WIP
authortest test <yoanl@pilotsystems.net>
Thu, 27 May 2021 09:53:41 +0000 (11:53 +0200)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Thu, 27 May 2021 09:53:41 +0000 (11:53 +0200)
app/settings.py
app/urls.py
teleforma/templates/postman/base.html
teleforma/templates/postman/base_folder.html
teleforma/templates/postman/view.html
teleforma/templates/teleforma/base.html
teleforma/templates/teleforma/inc/user_list.html
teleforma/templates/teleforma/profile_detail.html
teleforma/templates/teleforma/users.html
teleforma/templates/telemeta/base.html

index b0abcfc4f50a84b53818e5614ee4d40c35c3a4a7..8441798db41c888f96bec8958905e68d88c9248f 100644 (file)
@@ -219,6 +219,7 @@ SERVER_EMAIL = 'crfpa@pre-barreau.com'
 EMAIL_SUBJECT_PREFIX = '[' + TELEMETA_ORGANIZATION + '] '
 
 POSTMAN_AUTO_MODERATE_AS = True
+POSTMAN_DISALLOW_ANONYMOUS = True
 
 #FILE_PROTECTION_METHOD = 'xsendfile'
 
index 132935a2853a4b37d159bbfe2ec3b965fdfb49d6..2fc2ff892a0bf54edaaa96f15f433f6b5efcc234 100644 (file)
@@ -29,4 +29,5 @@ urlpatterns = [
     #url(r'^pdfviewer/', include('webviewer.urls')),
     url(r'^pdfannotator/', include('pdfannotator.urls')),
     url(r'^captcha/', include('captcha.urls')),
+    url(r'^messages/', include('postman.urls', namespace='postman')),
 ]
index d172ced3f2ef1bb38d44d06c5e87705ad424379e..1ba9388fd7b5f7a0513e1ec0fa856fd4369f2ec3 100644 (file)
 <div style="background: white;">
 {% postman_unread as unread_count %}
 <ul>
-<li><a href="{% url 'postman_inbox' %}">{% if unread_count %} <strong>{% trans "Inbox" %} ({{ unread_count }})</strong>{% else %}{% trans "Inbox" %}{% endif %}</a></li>
-<li><a href="{% url 'postman_sent' %}">{% trans "Sent Messages" %}</a></li>
-<li><a href="{% url 'postman_archives' %}">{% trans "Archives" %}</a></li>
-<li><a href="{% url 'postman_trash' %}">{% trans "Trash" %}</a></li>
+<li><a href="{% url 'postman:inbox' %}">{% if unread_count %} <strong>{% trans "Inbox" %} ({{ unread_count }})</strong>{% else %}{% trans "Inbox" %}{% endif %}</a></li>
+<li><a href="{% url 'postman:sent' %}">{% trans "Sent Messages" %}</a></li>
+<li><a href="{% url 'postman:archives' %}">{% trans "Archives" %}</a></li>
+<li><a href="{% url 'postman:trash' %}">{% trans "Trash" %}</a></li>
 </ul>
 </div>
 </div>
 <div class="module_action">
-<a href="{% url 'postman_write' %}" class="component_icon button" id="action_orange">{% trans "New message" %}</a>
+<a href="{% url 'postman:write' %}" class="component_icon button" id="action_orange">{% trans "New message" %}</a>
 </div>
 </div>
 
index 1de6da4735847e8801b987426e447efe338b18b5..376cc00305f732bbec51f78d838cf4deb2b434bb 100644 (file)
   <tr>
    <td><input type="checkbox" {% if by_conversation and message.thread_id %}name="tpks" value="{{ message.thread_id }}"{% else %}name="pks" value="{{ message.pk }}"{% endif %} /></td>
 
-   {% block pm_sender_cell %}<td><a href="{% if by_conversation and message.thread_id %}{% url 'postman_view_conversation' message.thread_id %}{% else %}{{message.get_absolute_url }}{% endif %}?next={{ current_url|urlencode }}" title="{% get_training_profile message.sender %}">{% if message.is_new %}<strong>{% endif %}{{ message.obfuscated_sender|or_me:user }}{% if message.count %} ({{ message.count }}){% endif %}{% if message.is_new %}</strong>{% endif %}</a></td>{% endblock %}
+   {% block pm_sender_cell %}<td><a href="{% if by_conversation and message.thread_id %}{% url 'postman:view_conversation' message.thread_id %}{% else %}{{message.get_absolute_url }}{% endif %}?next={{ current_url|urlencode }}" title="{% get_training_profile message.sender %}">{% if message.is_new %}<strong>{% endif %}{{ message.obfuscated_sender|or_me:user }}{% if message.count %} ({{ message.count }}){% endif %}{% if message.is_new %}</strong>{% endif %}</a></td>{% endblock %}
 
-   {% block pm_recipient_cell %}<td><a href="{% if by_conversation and message.thread_id %}{% url 'postman_view_conversation' message.thread_id %}{% else %}{{message.get_absolute_url }}{% endif %}?next={{ current_url|urlencode }}" title="{% get_training_profile message.recipient %}">{{ message.obfuscated_recipient|or_me:user }}{% if message.count %} ({{ message.count }}){% endif %}</a></td>{% endblock %}
+   {% block pm_recipient_cell %}<td><a href="{% if by_conversation and message.thread_id %}{% url 'postman:view_conversation' message.thread_id %}{% else %}{{message.get_absolute_url }}{% endif %}?next={{ current_url|urlencode }}" title="{% get_training_profile message.recipient %}">{{ message.obfuscated_recipient|or_me:user }}{% if message.count %} ({{ message.count }}){% endif %}</a></td>{% endblock %}
 
    <td>{% if message.is_new %}<strong>{% endif %}{% if message.is_replied %}<em>{% endif %}
    {% block pm_subject %}
-    <a href="{% if by_conversation and message.thread_id %}{% url 'postman_view_conversation' message.thread_id %}{% else %}{{message.get_absolute_url }}{% endif %}?next={{ current_url|urlencode }}">
+    <a href="{% if by_conversation and message.thread_id %}{% url 'postman:view_conversation' message.thread_id %}{% else %}{{message.get_absolute_url }}{% endif %}?next={{ current_url|urlencode }}">
     {% include "postman/inc_subject_ex.html" %}
     </a>{% endblock %}
    {% if message.is_replied %}</em>{% endif %}{% if message.is_new %}</strong>{% endif %}</td>
 <br />
 {% block pm_form_buttons %}<span id="pm_buttons">
 {% block pm_delete_button %}
-<a href="#" class="component_icon button icon_delete" onclick="f=document.getElementById('_messageForm'); f.action='{% url 'postman_delete' %}'; f.submit(); return false;">{% trans "Delete" %}</a>
+<a href="#" class="component_icon button icon_delete" onclick="f=document.getElementById('_messageForm'); f.action='{% url 'postman:delete' %}'; f.submit(); return false;">{% trans "Delete" %}</a>
 {% endblock %}
 {% block pm_archive_button %}
-<a href="#" class="component_icon button icon_save" onclick="f=document.getElementById('_messageForm'); f.action='{% url 'postman_archive' %}'; f.submit(); return false;">{% trans "Archive" %}</a>
+<a href="#" class="component_icon button icon_save" onclick="f=document.getElementById('_messageForm'); f.action='{% url 'postman:archive' %}'; f.submit(); return false;">{% trans "Archive" %}</a>
 {% endblock %}
 {% block pm_undelete_button %}
-<a href="#" class="component_icon button icon_previous" onclick="f=document.getElementById('_messageForm'); f.action='{% url 'postman_undelete' %}'; f.submit(); return false;">{% trans "Undelete" %}</a>
+<a href="#" class="component_icon button icon_previous" onclick="f=document.getElementById('_messageForm'); f.action='{% url 'postman:undelete' %}'; f.submit(); return false;">{% trans "Undelete" %}</a>
 {% endblock %}
 </span>{% endblock %}
 
index ce988abb4897f10607948f7313540efcb8398f81..5f8cc0fa2b5e65c5ec0bd7fa9f25ed3342850333 100644 (file)
 <a href="{{ next_url }}" class="component_icon button icon_previous">{% trans "Back" %}</a>
 <span id="pm_buttons">
 {% block pm_delete_button %}
-<a href="#" class="component_icon button icon_delete" onclick="f=document.getElementById('_messageForm'); f.action='{% url 'postman_delete' %}'; f.submit(); return false;">{% trans "Delete" %}</a>
+<a href="#" class="component_icon button icon_delete" onclick="f=document.getElementById('_messageForm'); f.action='{% url 'postman:delete' %}'; f.submit(); return false;">{% trans "Delete" %}</a>
 {% endblock %}
 {% block pm_archive_button %}
 {% if not archived %}
-<a href="#" class="component_icon button icon_save" onclick="f=document.getElementById('_messageForm'); f.action='{% url 'postman_archive' %}'; f.submit(); return false;">{% trans "Archive" %}</a>
+<a href="#" class="component_icon button icon_save" onclick="f=document.getElementById('_messageForm'); f.action='{% url 'postman:archive' %}'; f.submit(); return false;">{% trans "Archive" %}</a>
 {% endif %}
 {% endblock %}
 </form>
 {% if reply_to_pk %}<hr />
 <h2>{% trans 'Reply' %}</h2>
-<form id="_messageReply" action="{% url 'postman_reply' reply_to_pk %}?next={{ next_url|urlencode }}" method="post">{% csrf_token %}
+<form id="_messageReply" action="{% url 'postman:reply' reply_to_pk %}?next={{ next_url|urlencode }}" method="post">{% csrf_token %}
 <div id="pm_reply">{{ form.body }}</div><br />
 <a href="#" class="component_icon button icon_next" onclick="f=document.getElementById('_messageReply'); f.submit(); return false;">{% trans "Reply" %}</a>
 
index a9b83ee1a61b517ff0e0b2e5e321e3434651f8cf..17501b465980dfa572f4732c89a6f63fde50ac11 100644 (file)
@@ -76,7 +76,6 @@
     <div id="header">
 
 
-
       <div id="menu">
         <div id="logo_wrapper">
           <div id="logo">
 
           {% if user.is_authenticated %}
 
-          <li><a href="postman_inbox" class="orange">{% trans "Messaging" %}{% if postman_unread_count %}
-              ({{ postman_unread_count }}){% endif %} TODO : fix this link</a></li>
+          <li><a href="{% url 'postman:inbox' %}" class="orange">{% trans "Messaging" %}{% if postman_unread_count %}
+              ({{ postman_unread_count }}){% endif %}</a></li>
 
           {% if not user.student or not user.student.get.restricted %}
             <li><a href="{% url 'teleforma-annals' %}" class="yellow">{% trans "Annals" %}</a></li>
index bfc98c113f0f736ac577617dc4641408cfe54476..abeaebffb95a22189443329aee5e2cb3ddcdd0fe 100644 (file)
@@ -69,7 +69,7 @@
         <td></td>
         <td></td>
     {%  endif %}
-    <td><a href="{% url 'postman_write' user.username %}" class="component_icon button" id="action_orange">{% trans "Message" %}</a></td>
+    <td><a href="{% url 'postman:write' user.username %}" class="component_icon button" id="action_orange">{% trans "Message" %}</a></td>
     </tr>
     {% endfor %}
     </tbody>
index 4613b3d893f5f9ee473d240979a98d69c34d70b7..656249e9fa7428a31819d4c822053b23fcc7ae79 100644 (file)
@@ -33,7 +33,7 @@
 
   {% if user.is_authenticated and user.username != usr.username %}
    <div class="module_action">
-    <a href="{% url 'postman_write' usr.username %}" class="component_icon button" id="action_orange">{% trans "Send a message" %}</a>
+    <a href="{% url 'postman:write' usr.username %}" class="component_icon button" id="action_orange">{% trans "Send a message" %}</a>
    </div>
   {%  endif %}
  </div>
index 0efbd02ac5c452819a33125a6965702a9a9f602b..9d83d6b05a37e93e19a631d371c3924fa549c454 100644 (file)
@@ -51,7 +51,7 @@
 
 {% if users %}
 <div class="module_action">
-<a href="{% url 'postman_write' users|to_recipients %}" class="component_icon button" id="action_orange">{% trans "Grouped message" %}</a>
+<a href="{% url 'postman:write' users|to_recipients %}" class="component_icon button" id="action_orange">{% trans "Grouped message" %}</a>
 </div>
 {% endif %}
 
index 273557f20bb35c7e5e7384615a01ecff249b3e66..8ab79a59a3aa54c5a813f1f909ba52e223501f29 100644 (file)
@@ -110,7 +110,7 @@ alt="logo" />
 
  {% if user.is_authenticated %}
 
- <li><a href="{% url 'postman_inbox' %}" class="orange">{% trans "Messaging" %}{% if postman_unread_count %} ({{ postman_unread_count }}){% endif %}</a></li>
+ <li><a href="{% url 'postman:inbox' %}" class="orange">{% trans "Messaging" %}{% if postman_unread_count %} ({{ postman_unread_count }}){% endif %}</a></li>
 
   <li><a href="{% url 'teleforma-annals' %}" class="yellow">{% trans "Annals" %}</a></li>