src/cm/templates/site/macros/user_actions.html
changeset 0 40c8f766c9b8
child 38 be1807d390d4
equal deleted inserted replaced
-1:000000000000 0:40c8f766c9b8
       
     1 {% load com %}
       
     2 {% load i18n %}
       
     3 <b>
       
     4 	{% ifequal user request.user %}
       
     5     <a title="{% blocktrans %}Your profile{% endblocktrans %}" class="main_object_title" href="{% url profile %}">{{ user.get_profile.admin_print }}</a>
       
     6     {% else %}
       
     7     <a title="{% blocktrans with user.get_profile.admin_print as userprint %}Edit user {{ userprint }}{% endblocktrans %}" class="main_object_title" href="{% url user-edit user.get_profile.key %}">{{ user.get_profile.admin_print }}</a>
       
     8     {% endifequal %}
       
     9 </b>
       
    10 <div class="hidden-user-actions user-actions-{{ user.get_profile.key }}" style="visibility:hidden;">
       
    11 {% ifequal user request.user %}
       
    12   <a title="Your profile" href="{% url profile %}">{% blocktrans %}Your profile{% endblocktrans %}</a> 
       
    13 {% else %}
       
    14   <a title="Edit user" href="{% url user-edit user.get_profile.key %}">{% blocktrans %}Edit{% endblocktrans %}</a> 
       
    15 | <a href="{% url user-contact user.get_profile.key %}">{% blocktrans %}Contact{% endblocktrans %}</a>               
       
    16 {% if user.get_profile.is_suspended %}
       
    17 	{% if user.is_active %}
       
    18 		| <a id="user-enable-{{ user.get_profile.key }}" href="#">{% blocktrans %}Enable access{% endblocktrans %}</a>
       
    19 	{% else %}
       
    20 		{% include "site/macros/user_moderation.html" %}
       
    21 	{% endif %}
       
    22 {% else %}
       
    23         | <a id="user-suspend-{{ user.get_profile.key }}" href="#">{% blocktrans %}Suspend access{% endblocktrans %}</a>
       
    24         | <a id="user-resend-{{ user.get_profile.key }}" href="#">{% blocktrans %}(Re-)send invitation{% endblocktrans %}</a>
       
    25 {% endif %}
       
    26 {% endifequal %}  
       
    27 </div>
       
    28 <script type="text/javascript">
       
    29 <!--
       
    30 $(function() {
       
    31     $("#user-suspend-{{ user.get_profile.key }}").click(function(){
       
    32         url = '{% url user-suspend user.get_profile.key %}';
       
    33     	question = "{% blocktrans %}Are you sure you want to suspend this user's access to the workspace?{% endblocktrans %}";
       
    34         if (confirm(question)) {
       
    35             $.post(url, function(data){
       
    36                   window.location = '{% url user %}';
       
    37                 });                        
       
    38         }
       
    39     });
       
    40     $("#user-enable-{{ user.get_profile.key }}").click(function(){
       
    41         url = '{% url user-enable user.get_profile.key %}';
       
    42     	question = "{% blocktrans %}Are you sure you want to enable this user's access to the workspace?{% endblocktrans %}";
       
    43         if (confirm(question)) {
       
    44             $.post(url, function(data){
       
    45                   window.location = '{% url user %}';
       
    46                 });                        
       
    47         }
       
    48     });
       
    49     $("#user-resend-{{ user.get_profile.key }}").click(function(){
       
    50     	url = '{% url user-send-invitation user.get_profile.key %}';
       
    51     	question = "{% blocktrans %}Are you sure you want to send this user an invitation to the workspace?{% endblocktrans %}";
       
    52         if (confirm(question)) {
       
    53             $.post(url, function(data){
       
    54                   window.location = '{% url user %}';
       
    55                 });                        
       
    56         }
       
    57     });
       
    58     
       
    59     $(".user-{{ user.get_profile.key }}").mouseover(function(){
       
    60         $(".user-actions-{{ user.get_profile.key }}").css('visibility','visible');
       
    61         $(".user-{{ user.get_profile.key }}").addClass('hover');                       
       
    62     });
       
    63     $(".user-{{ user.get_profile.key }}").mouseout(function(){
       
    64         $(".user-actions-{{ user.get_profile.key }}").css('visibility','hidden');   
       
    65         $(".user-{{ user.get_profile.key }}").removeClass('hover');                       
       
    66     });
       
    67 }) ;
       
    68 --> 
       
    69 </script>