]> git.ipfire.org Git - ipfire.org.git/commitdiff
people: Do not show any personal information to users without status
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 7 May 2019 16:58:31 +0000 (17:58 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 7 May 2019 16:58:31 +0000 (17:58 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/templates/people/user.html

index a1b5a3d15cfee48b0ac4aae4553d0a51963e2a1a..45bddc26691bf62e3696a45fbecb9e6b82a3daa1 100644 (file)
                                </div>
                        </div>
 
-                       <div class="row">
-                               {% if account.address %}
-                                       <div class="col-md-6 mt-5">
-                                               <h6>{{ _("Postal Address") }}</h6>
+                       {% if current_user == account or current_user.is_staff() %}
+                               <div class="row">
+                                       {% if account.address %}
+                                               <div class="col-md-6 mt-5">
+                                                       <h6>{{ _("Postal Address") }}</h6>
 
-                                               <address>
-                                                       <strong>{{ account.name }}</strong>
-                                                       <br>
-                                                       {% for line in account.address %}
-                                                               {{ line }}<br>
-                                                       {% end %}
-                                               </address>
-                                       </div>
-                               {% end %}
+                                                       <address>
+                                                               <strong>{{ account.name }}</strong>
+                                                               <br>
+                                                               {% for line in account.address %}
+                                                                       {{ line }}<br>
+                                                               {% end %}
+                                                       </address>
+                                               </div>
+                                       {% end %}
 
-                               <div class="col-md-6 mt-5">
-                                       {% if account.phone_number or account.fax_number %}
-                                               <h6 class="mb-2">{{ _("Phone Numbers") }}</h6>
+                                       <div class="col-md-6 mt-5">
+                                               {% if account.phone_number or account.fax_number %}
+                                                       <h6 class="mb-2">{{ _("Phone Numbers") }}</h6>
 
-                                               <ul class="list-unstyled">
-                                                       {% if account.phone_number %}
-                                                               <li>
-                                                                       <span class="fas fa-phone"></span>
+                                                       <ul class="list-unstyled">
+                                                               {% if account.phone_number %}
+                                                                       <li>
+                                                                               <span class="fas fa-phone"></span>
 
-                                                                       <a href="tel:{{ format_phone_number_to_e164(account.phone_number) }}">
-                                                                               {{ format_phone_number(account.phone_number) }}
-                                                                       </a>
-                                                               </li>
-                                                       {% end %}
+                                                                               <a href="tel:{{ format_phone_number_to_e164(account.phone_number) }}">
+                                                                                       {{ format_phone_number(account.phone_number) }}
+                                                                               </a>
+                                                                       </li>
+                                                               {% end %}
 
-                                                       {% if account.fax_number %}
-                                                               <li>
-                                                                       <span class="fas fa-fax"></span>
+                                                               {% if account.fax_number %}
+                                                                       <li>
+                                                                               <span class="fas fa-fax"></span>
 
-                                                                       <a href="fax:{{ format_phone_number_to_e164(account.fax_number) }}">
-                                                                               {{ format_phone_number(account.fax_number) }}
-                                                                       </a>
-                                                               </li>
-                                                       {% end %}
-                                               </ul>
-                                       {% end %}
+                                                                               <a href="fax:{{ format_phone_number_to_e164(account.fax_number) }}">
+                                                                                       {{ format_phone_number(account.fax_number) }}
+                                                                               </a>
+                                                                       </li>
+                                                               {% end %}
+                                                       </ul>
+                                               {% end %}
 
-                                       {% if account.phone_numbers %}
-                                               <h6 class="mb-2">{{ _("External Phone Numbers") }}</h6>
+                                               {% if account.phone_numbers %}
+                                                       <h6 class="mb-2">{{ _("External Phone Numbers") }}</h6>
 
-                                               <ul class="list-unstyled">
-                                                       {% for number in account.phone_numbers %}
-                                                               <li>
-                                                                       {% if phonenumbers.number_type(number) == phonenumbers.PhoneNumberType.MOBILE %}
-                                                                               <span class="fas fa-mobile" title="{{ _("Mobile") }}"></span>
-                                                                       {% else %}
-                                                                               <span class="fas fa-phone"></span>
-                                                                       {% end %}
+                                                       <ul class="list-unstyled">
+                                                               {% for number in account.phone_numbers %}
+                                                                       <li>
+                                                                               {% if phonenumbers.number_type(number) == phonenumbers.PhoneNumberType.MOBILE %}
+                                                                                       <span class="fas fa-mobile" title="{{ _("Mobile") }}"></span>
+                                                                               {% else %}
+                                                                                       <span class="fas fa-phone"></span>
+                                                                               {% end %}
 
-                                                                       <a href="tel:{{ format_phone_number_to_e164(number) }}"
-                                                                               title="{{ format_phone_number_location(number) }}">{{ format_phone_number(number) }}</a>
-                                                               </li>
-                                                       {% end %}
-                                               </ul>
-                                       {% end %}
+                                                                               <a href="tel:{{ format_phone_number_to_e164(number) }}"
+                                                                                       title="{{ format_phone_number_location(number) }}">{{ format_phone_number(number) }}</a>
+                                                                       </li>
+                                                               {% end %}
+                                                       </ul>
+                                               {% end %}
+                                       </div>
                                </div>
-                       </div>
+                       {% end %}
                </div>
        </div>
 {% end block %}