Merge Request #88

Closed
softwarepublico/softwarepublico!88
Created by Carlos Coêlho

Threads

Dropdown menu for threads and pt-br correction to the old "Groups" string.

Assignee: None
Milestone: None

Closed by Melissa Wen

Changes were not merged into target branch

Commits (6)
2 participants
src/colab-spb-theme-plugin/colab_spb_theme/static/css/screen.css
... ... @@ -516,3 +516,12 @@ span.highlighted {
516 516 padding: 40px 0 60px 0;
517 517 color: #172738;
518 518 }
  519 +
  520 +.colab-content {
  521 + max-width: 960px;
  522 + min-width: 960px;
  523 +}
  524 +
  525 +a.btn {
  526 + margin: 2px 0 2px 0;
  527 +}
... ...
src/colab-spb-theme-plugin/colab_spb_theme/templates/accounts/manage_subscriptions.html 0 → 100644
... ... @@ -0,0 +1,45 @@
  1 +{% extends 'base.html' %}
  2 +{% load i18n gravatar %}
  3 +
  4 +{% block main-content %}
  5 + <div class="colab-content container">
  6 + <h2>Inscreva-se nas listas de discussão</h2>
  7 + <h3>{% gravatar user_.email 50 %} {{ user_.get_full_name }} ({{ user_.username }})</h3>
  8 + <br>
  9 +
  10 + <form method='post'>
  11 + {% csrf_token %}
  12 +
  13 + <div class="row">
  14 + {% for email, lists in membership.items %}
  15 + <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
  16 + <div class="panel panel-default">
  17 + <div class="panel-heading">
  18 + <h3 class="panel-title">{{ email }}</h3>
  19 + </div>
  20 + <div class="panel-body">
  21 + {% for list, checked in lists %}
  22 + <div class="checkbox" title="{{ list.description }}">
  23 + <label>
  24 + <input name="{{ email }}" value="{{ list.listname }}" type="checkbox" {% if checked %}checked{% endif%}>{{ list.listname }}</input>
  25 + </label>
  26 + </div>
  27 + {% endfor %}
  28 + </div>
  29 + </div>
  30 + </div>
  31 + {% endfor %}
  32 + </div>
  33 +
  34 + <div class="row">
  35 + <div class="col-md-12">
  36 + <button class="btn btn-lg btn-primary" type="submit">{% trans 'Update subscriptions' %}</button>
  37 + </div>
  38 + </div>
  39 +
  40 + </form>
  41 +
  42 + <br><br>
  43 + <br><br>
  44 + </div>
  45 +{% endblock %}
... ...
src/colab-spb-theme-plugin/colab_spb_theme/templates/accounts/user_detail.html 0 → 100644
... ... @@ -0,0 +1,164 @@
  1 +{% extends "base.html" %}
  2 +
  3 +{% load i18n gravatar %}
  4 +
  5 +{% block title %}Perfil{% endblock %}
  6 +
  7 +{% block head_js %}
  8 + {% trans "Messages" as group_collabs %}
  9 + {% trans "Contributions" as type_collabs %}
  10 +
  11 + {% include "doughnut-chart.html" with chart_data=type_count chart_canvas="collabs" name=type_collabs %}
  12 + {% include "doughnut-chart.html" with chart_data=list_activity chart_canvas="collabs2" name=group_collabs %}
  13 +{% endblock %}
  14 +
  15 +{% block main-content %}
  16 + <div class="colab-content container">
  17 + <div id="user-profile" class="row">
  18 + <div class="colab-vcard col-lg-4 col-md-4 col-sm-5">
  19 + <div class="thumbnail">
  20 + {% gravatar user_.email 200 %}
  21 + </div>
  22 +
  23 + <h1>
  24 + <span>{{ user_.get_full_name }}</span>
  25 + <em>{{ user_.username }}</em>
  26 + </h1>
  27 +
  28 + {% if request.user == user_ or request.user.is_superuser %}
  29 + <a class="btn btn-info" href="{% url 'user_profile_update' user_ %}"><span class="glyphicon glyphicon-pencil"></span>&nbsp;&nbsp;{% trans "edit profile"|title %}</a>
  30 + <a class="btn btn-info" href="{% url 'user_list_subscriptions' user_ %}"><span class="glyphicon glyphicon-pencil"></span>&nbsp;&nbsp;Inscreva-se nas listas de discussão</a>
  31 + {% endif %}
  32 +
  33 + {% if request.user.is_active %}
  34 + {% if user_.bio %}
  35 + <div class="divider"></div>
  36 + <ul class="unstyled-list">
  37 + <li>
  38 + <strong>{% trans 'Bio' %}</strong>
  39 + </li>
  40 + <li class="text-muted"> {{ user_.bio }}</li>
  41 + </ul>
  42 + {% endif %}
  43 + {% endif %}
  44 +
  45 + <div class="divider"></div>
  46 + {% if request.user.is_active %}
  47 + <ul class="unstyled-list">
  48 + <li><span class="icon-envelope icon-fixed-width"></span> <a href="mailto:{{ user_.email }}">{{ user_.email }}</a></li>
  49 + </ul>
  50 + <div class="divider"></div>
  51 + {% endif %}
  52 +
  53 + <ul class="unstyled-list">
  54 + {% if user_.institution or user_.role %}
  55 + <li>
  56 + <span class="icon-briefcase icon-fixed-width"></span>
  57 + {{ user_.role }}
  58 + {% if user_.institution and user_.role %}-{% endif %}
  59 + {{ user_.institution }}
  60 + </li>
  61 + {% endif %}
  62 + {% if request.user.is_active %}
  63 + {% if SOCIAL_NETWORK_ENABLED %}
  64 + <li>
  65 + {% if user_.twitter %}
  66 + <span class="icon-twitter icon-fixed-width" title="{% trans 'Twitter account' %}"></span> <a target="_blank" href="{{ user_.twitter_link }}" title="{% trans 'Twitter account' %}">{{ user_.twitter }}</a>
  67 + {% endif %}
  68 + {% if user_.facebook %}
  69 + <span class="icon-facebook icon-fixed-width" title="{% trans 'Facebook account' %}"></span> <a target="_blank" href="{{ user_.facebook_link }}" title="{% trans 'Facebook account' %}">{{ user_.facebook }}</a>
  70 + {% endif %}
  71 + </li>
  72 +
  73 + {% if user_.google_talk %}
  74 + <li><span class="icon-google-plus icon-fixed-width" title="{% trans 'Google talk account' %}"></span> {{ user_.google_talk }}</li>
  75 + {% endif %}
  76 +
  77 + {% if user_.github %}
  78 + <li><span class="icon-github icon-fixed-width" title="{% trans 'Github account' %}"></span> <a target="_blank" href="https://github.com/{{ user_.github }}">{{ user_.github }}</a></li>
  79 + {% endif %}
  80 +
  81 + {% if user_.webpage %}
  82 + <li><span class="icon-link icon-fixed-width" title="{% trans 'Personal webpage' %}"></span> <a target="_blank" href="{{ user_.webpage }}" title="{% trans 'Personal webpage' %}">{{ user_.webpage }}</a></li>
  83 + {% endif %}
  84 + {% endif %}
  85 + {% endif %}
  86 + </ul>
  87 + {% if user_.mailinglists %}
  88 + <b>Listas de discussão</b>
  89 + {% for list in user_.mailinglists %}
  90 + <a href="{% url 'haystack_search' %}?order=latest&amp;type=thread&amp;list={{ list }}"><span class="label label-primary">{{ list }}</span></a>
  91 + {% endfor %}
  92 + {% endif %}
  93 +
  94 + <div class="divider"></div>
  95 +
  96 + </div>
  97 +
  98 + <div class="col-lg-4 col-md-4 col-sm-7">
  99 + <div class="panel panel-default">
  100 + <div class="panel-heading">
  101 + <h3 class="panel-title">{% trans "Collaborations by Type" %}</h3>
  102 + </div>
  103 + <div class="panel-body">
  104 + <div id="collabs"></div>
  105 + <div class="chart collabs">
  106 + <canvas width="200" height="200"></canvas>
  107 + <p></p>
  108 + </div>
  109 + </div>
  110 + </div>
  111 + </div>
  112 +
  113 +
  114 + <div class="col-lg-4 col-md-4 col-sm-7">
  115 + <div class="panel panel-default">
  116 + <div class="panel-heading">
  117 + <h3 class="panel-title">Participação por lista de discussão</h3>
  118 + </div>
  119 + <div class="panel-body">
  120 + <div class="chart collabs2">
  121 + <canvas width="200" height="200"></canvas>
  122 + <p></p>
  123 + </div>
  124 + </div>
  125 + </div>
  126 + </div>
  127 +
  128 + </div> <!-- End of user-profile row -->
  129 +
  130 + <div class="row">
  131 +
  132 + <div class="col-lg-6 col-md-6 col-sm-12">
  133 + <h3>{% trans "Latest posted" %} </h3>
  134 + <ul class="message-list">
  135 + {% for doc in emails %}
  136 + {% include "message-preview.html" with result=doc %}
  137 + {% empty %}
  138 + <li>{% trans "There are no posts by this user so far." %}</li>
  139 + {% endfor %}
  140 + </ul>
  141 + <a href="{% url 'haystack_search' %}?type=thread&amp;author={{ user_.username }}">
  142 + {% trans "View more posts..." %}
  143 + </a>
  144 + <div>&nbsp;</div>
  145 + </div>
  146 +
  147 + <div class="col-lg-6 col-md-6 col-sm-12">
  148 + <h3>{% trans "Latest contributions" %}</h3>
  149 + <ul class="message-list">
  150 + {% for result in results %}
  151 + {% include "message-preview.html" %}
  152 + {% empty %}
  153 + <li>{% trans "No contributions of this user so far." %}</li>
  154 + {% endfor %}
  155 + </ul>
  156 + <a href="{% url 'haystack_search' %}?order=latest&amp;collaborators={{ user_.username }}">
  157 + {% trans "View more contributions..." %}
  158 + </a>
  159 + <div>&nbsp;</div>
  160 + </div>
  161 +
  162 + </div>
  163 + </div>
  164 +{% endblock %}
... ...
src/colab-spb-theme-plugin/colab_spb_theme/templates/header.html
... ... @@ -134,9 +134,19 @@
134 134 </div>
135 135 <div id="sobre">
136 136 <ul>
137   - <li id="softwarepublico-groups" class="softwarepublico-item">
138   - <a href="{% url 'thread_list' %}" title="Listas de discussão">Listas de discussão</a>
139   - </li>
  137 + {% if not user.is_authenticated %}
  138 + <li id="softwarepublico-groups" class="softwarepublico-item">
  139 + <a href="{% url 'thread_list' %}" title="Listas de discussão">Listas de discussão</a>
  140 + </li>
  141 + {% else %}
  142 + <li class="dropdown softwarepublico-item">
  143 + <a href="#" class="dropdown-toggle" data-toggle="dropdown">Listas de discussão <b class="caret"></b></a>
  144 + <ul class="dropdown-menu">
  145 + <li><a href="{% url 'thread_list' %}">Acesse todas as listas</a></li>
  146 + <li><a href="{% url 'user_list_subscriptions' user %}">Inscreva-se nas listas</a></li>
  147 + </ul>
  148 + </li>
  149 + {% endif %}
140 150 {% plugins_menu %}
141 151 <li id="softwarepublico-perguntas-frequentes" class="softwarepublico-item">
142 152 <a href="/social/spb/ajuda" title="Perguntas frequentes">Perguntas frequentes</a>
... ...
src/colab-spb-theme-plugin/colab_spb_theme/templates/superarchives/thread-dashboard.html 0 → 100644
... ... @@ -0,0 +1,101 @@
  1 +{% extends 'base.html' %}
  2 +{% load i18n %}
  3 +
  4 +{% block title %}Listas de discussão{% endblock %}
  5 +
  6 +{% block main-content %}
  7 + <div class="colab-content container">
  8 + <h2>Listas de discussão</h2>
  9 + <hr/>
  10 +
  11 + {% for mailinglist in lists %}
  12 + {% if mailinglist.get_latest or mailinglist.get_most_relevant %}
  13 + <h3><b>{{ mailinglist.name|title|lower }} {% if mailinglist.description %} ({{ mailinglist.description }}){% endif %}</b></h3>
  14 + <div class="btn-group btn-group-sm">
  15 + <a href="#" class="btn btn-default" disabled="disabled">{% blocktrans with number_of_users=mailinglist.get_number_of_users %}{{ number_of_users }} members{% endblocktrans %}</a>
  16 + </div>
  17 + <hr/>
  18 +
  19 + <div class="row">
  20 + <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
  21 + <h4>{% trans 'latest'|title %}</h4>
  22 + <ul class="message-list">
  23 + {% for thread in mailinglist.get_latest %}
  24 + {% include "message-preview.html" with result=thread.latest_message %}
  25 + {% endfor %}
  26 + </ul>
  27 + <div class="text-right">
  28 + <a href="{% url 'haystack_search' %}?order=latest&list={{ mailinglist.name }}&type=thread">
  29 + {% trans "more..." %}
  30 + </a>
  31 + </div>
  32 + </div>
  33 +
  34 + <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
  35 + <h4>{% trans 'most relevant'|title %}</h4>
  36 + <ul class="message-list">
  37 + {% for thread in mailinglist.get_most_relevant %}
  38 + {% include "message-preview.html" with result=thread %}
  39 + {% endfor %}
  40 + </ul>
  41 + <div class="text-right">
  42 + <a href="{% url 'haystack_search' %}?list={{ mailinglist.name }}&type=thread">
  43 + {% trans "more..." %}
  44 + </a>
  45 + </div>
  46 + </div>
  47 + </div>
  48 +
  49 +
  50 + {% endif %}
  51 + {% endfor %}
  52 +
  53 + {% if page_obj.has_other_pages %}
  54 + <div class="text-center">
  55 + <ul class="pagination">
  56 + <li {% if page_obj.number == 1 %}class="disabled"{% endif %}>
  57 + <a href="{% if page_obj.number == 1 %}javascript:void(0);{% else %}?page={{1}}{% endif %}"><span class="glyphicon glyphicon-chevron-left small-icon"></span><span class="glyphicon glyphicon-chevron-left small-icon"></span></a>
  58 + </li>
  59 + <li {% if not page_obj.has_previous %}class="disabled"{% endif %}>
  60 + <a href="{% if page_obj.has_previous %}?page={{page_obj.previous_page_number }}{% else %}javascript:void(0);{% endif %}"><span class="glyphicon glyphicon-chevron-left small-icon"></span></a>
  61 + </li>
  62 +
  63 + {% if page_obj.has_previous %}
  64 + {% if page_obj.previous_page_number > 1 %}
  65 + <li>
  66 + <a href="?page={{page_obj.previous_page_number|add:-2 }}">{{ page_obj.number|add:-2 }}</a>
  67 + </li>
  68 + {% endif %}
  69 + <li>
  70 + <a href="?page={{page_obj.previous_page_number }}">{{ page_obj.number|add:-1 }}</a>
  71 + </li>
  72 + {% endif %}
  73 +
  74 + <li class="active">
  75 + <a href="javascript:void(0);">{{ page_obj.number }}</a>
  76 + </li>
  77 +
  78 + {% if page_obj.has_next %}
  79 + <li>
  80 + <a href="?page={{page_obj.next_page_number }}">{{ page_obj.number|add:1 }}</a>
  81 + </li>
  82 + {% if page_obj.next_page_number < page_obj.paginator.num_pages %}
  83 + <li>
  84 + <a href="?page={{page_obj.next_page_number|add:1 }}">{{ page_obj.number|add:2 }}</a>
  85 + </li>
  86 + {% endif %}
  87 + {% endif %}
  88 +
  89 + <li {% if not page_obj.has_next %}class="disabled"{% endif %}>
  90 + <a href="{% if page_obj.has_next %}?page={{page_obj.next_page_number }}{% else %}javascript:void(0);{% endif %}"><span class="glyphicon glyphicon-chevron-right small-icon"></span></a>
  91 + </li>
  92 +
  93 + <li {% if page_obj.number == page_obj.paginator.num_pages %}class="disabled"{% endif %}>
  94 + <a href="{% if page_obj.number == page_obj.paginator.num_pages %}javascript:void(0);{% else %}?page={{page_obj.paginator.num_pages }}{% endif %}"><span class="glyphicon glyphicon-chevron-right small-icon"></span><span class="glyphicon glyphicon-chevron-right small-icon"></span></a>
  95 + </li>
  96 +
  97 + </ul>
  98 + </div>
  99 + {% endif %}
  100 + </div>
  101 +{% endblock %}
... ...