]> 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>
Wed, 12 Apr 2023 09:39:39 +0000 (11:39 +0200)
app/settings.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 758d926a12e8fdb0f65ba699cac913a69c004408..b4bef6c14cad7faa21bd888795d712cd946f774e 100644 (file)
@@ -220,6 +220,7 @@ SERVER_EMAIL = 'crfpa@pre-barreau.com'
 EMAIL_SUBJECT_PREFIX = '[' + TELEMETA_ORGANIZATION + '] '
 
 POSTMAN_AUTO_MODERATE_AS = True
+POSTMAN_DISALLOW_ANONYMOUS = True
 
 TELECASTER_CONF = [{'type':'mp3','server_type':'icecast','conf':'/etc/telecaster/deefuzzer_mp3.xml', 'port':'8000'},
                    {'type':'webm','server_type':'stream-m','conf':'/etc/telecaster/deefuzzer_webm.xml', 'port':'8080'}, ]
index 4c665eb5bb4caa564a0afe77071cbc4d99b70347..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 7bd38b86b6dc719263984049cab204d163df3f4b..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 a3ea8d9e6e28514100147a9ff970ad1616d0a499..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 38d38d15780db576cf88defe5442af22a7c722b9..6f50d651bbb2cc756addad44573252e25573d859 100644 (file)
@@ -39,7 +39,7 @@
     {% else %}
         <td>{% trans "Unknown" %}</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 fc16181337f8e1c7bf88e713ae771804fb67fe1a..da83fa788df003afe46efb678db3a535691190ff 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 18884d0aa0f945dd644fd1d5153722de294a16c5..6f744f68e7cbc1448570efc3767b4fe35f4f3bcf 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>