Commit 2110d48790f2578d90d6ef1c3567834dc0545de6

Authored by Luan
1 parent 73e166b6

Adding first layout implementation of users's profile with badges

Showing 1 changed file with 65 additions and 44 deletions   Show diff stats
src/accounts/templates/accounts/user_detail.html
1 1 {% extends "base.html" %}
  2 +
2 3 {% load i18n gravatar %}
3 4  
  5 +
4 6 {% block head_js %}
5 7 {% include "pizza-chart.html" with chart_data=type_count chart_div="collabs" chart_height=300 %}
6 8 {% include "pizza-chart.html" with chart_data=list_activity chart_div="collabs2" chart_height=300 %}
... ... @@ -36,40 +38,41 @@
36 38  
37 39 <ul class="unstyled-list">
38 40 {% if user_.institution or user_.role %}
39   - <li>
40   - <span class="icon-briefcase icon-fixed-width"></span>
41   - {{ user_.role }}
42   - {% if user_.institution and user_.role %}-{% endif %}
43   - {{ user_.institution }}
44   - </li>
45   - {% endif %}
46   - {% if request.user.is_active %}
47   - <li>
48   - {% if user_.twitter %}
49   - <span class="icon-twitter icon-fixed-width"></span> <a target="_blank" href="{{ user_.twitter_link }}" title="{% trans 'Twitter account' %}">{{ user_.twitter }}</a>
50   - {% endif %}
51   - {% if user_.facebook %}
52   - <span class="icon-facebook icon-fixed-width"></span> <a target="_blank" href="{{ user_.facebook_link }}" title="{% trans 'Facebook account' %}">{{ user_.facebook }}</a>
53   - {% endif %}
54   - </li>
55   -
56   - {% if user_.google_talk %}
57   - <li><span class="icon-google-plus icon-fixed-width"></span> {{ user_.google_talk }}</li>
  41 + <li>
  42 + <span class="icon-briefcase icon-fixed-width"></span>
  43 + {{ user_.role }}
  44 + {% if user_.institution and user_.role %}-{% endif %}
  45 + {{ user_.institution }}
  46 + </li>
58 47 {% endif %}
59   - {% if user_.webpage %}
60   - <li><span class="icon-link icon-fixed-width"></span> <a target="_blank" href="{{ user_.webpage }}" title="{% trans 'Personal webpage' %}">{{ user_.webpage }}</a></li>
  48 + {% if request.user.is_active %}
  49 + <li>
  50 + {% if user_.twitter %}
  51 + <span class="icon-twitter icon-fixed-width"></span> <a target="_blank" href="{{ user_.twitter_link }}" title="{% trans 'Twitter account' %}">{{ user_.twitter }}</a>
  52 + {% endif %}
  53 + {% if user_.facebook %}
  54 + <span class="icon-facebook icon-fixed-width"></span> <a target="_blank" href="{{ user_.facebook_link }}" title="{% trans 'Facebook account' %}">{{ user_.facebook }}</a>
  55 + {% endif %}
  56 + </li>
  57 +
  58 + {% if user_.google_talk %}
  59 + <li><span class="icon-google-plus icon-fixed-width"></span> {{ user_.google_talk }}</li>
  60 + {% endif %}
  61 + {% if user_.webpage %}
  62 + <li><span class="icon-link icon-fixed-width"></span> <a target="_blank" href="{{ user_.webpage }}" title="{% trans 'Personal webpage' %}">{{ user_.webpage }}</a></li>
  63 + {% endif %}
61 64 {% endif %}
62   - {% endif %}
63 65 </ul>
64 66  
65 67 {% if user_.mailinglists %}
66   - <b>{% trans 'Subscribes: ' %}</b>
  68 + <b>{% trans 'Subscribes: ' %}</b>
67 69 {% for list in user_.mailinglists %}
68 70 <span class="label label-primary">{{ list }}</span>
69 71 {% endfor %}
70 72 {% endif %}
71 73  
72 74 <div class="divider"></div>
  75 +
73 76 </div>
74 77  
75 78 <div class="col-lg-4 col-md-4 col-sm-7">
... ... @@ -95,29 +98,47 @@
95 98 </div>
96 99 </div>
97 100  
98   - </div>
99   - <div class="row">
100   - <div class="col-lg-6 col-md-6 col-sm-12">
101   - <h3>{% trans "Latest posted" %} </h3>
102   - <ul class="message-list">
103   - {% for doc in emails %}
104   - {% include "message-preview.html" with result=doc %}
105   - {% empty %}
106   - <li>{% trans "There are no posts by this user so far." %}</li>
107   - {% endfor %}
108   - </ul>
109   - </div>
110 101  
111   - <div class="col-lg-6 col-md-6 col-sm-12">
112   - <h3>{% trans "Community inside participations" %}</h3>
113   - <ul class="message-list">
114   - {% for result in results %}
115   - {% include "message-preview.html" %}
116   - {% empty %}
117   - <li>{% trans "No contributions of this user so far." %}</li>
118   - {% endfor %}
119   - </ul>
  102 + <div class="col-lg-8 col-md-12 col-sm-7">
  103 + <div class="panel panel-default">
  104 + <div class="panel-heading">
  105 + <h3 class="panel-title">{% trans "Badges" %}</h3>
  106 + </div>
  107 + <div class="panel-body">
  108 + <div>
  109 + {% for badge in user_.badge_set.all %}
  110 + <img src="{{ badge.get_badge_url }}" title="{{ badge.description }}" />
  111 + {% endfor %}
  112 + </div>
  113 + </div>
120 114 </div>
  115 + </div>
  116 +
  117 + </div> <!-- End of user-profile row -->
  118 +
  119 + <div class="row">
  120 +
  121 + <div class="col-lg-6 col-md-6 col-sm-12">
  122 + <h3>{% trans "Latest posted" %} </h3>
  123 + <ul class="message-list">
  124 + {% for doc in emails %}
  125 + {% include "message-preview.html" with result=doc %}
  126 + {% empty %}
  127 + <li>{% trans "There are no posts by this user so far." %}</li>
  128 + {% endfor %}
  129 + </ul>
  130 + </div>
  131 +
  132 + <div class="col-lg-6 col-md-6 col-sm-12">
  133 + <h3>{% trans "Community inside participations" %}</h3>
  134 + <ul class="message-list">
  135 + {% for result in results %}
  136 + {% include "message-preview.html" %}
  137 + {% empty %}
  138 + <li>{% trans "No contributions of this user so far." %}</li>
  139 + {% endfor %}
  140 + </ul>
  141 + </div>
121 142  
122 143 </div>
123 144  
... ...