Group icons are displayed in group tab
authorverrierj
Wed, 04 Jan 2012 12:17:47 +0100
changeset 329 6a0b65d60d00
parent 328 8a626a7a66bf
child 330 806188af5027
Group icons are displayed in group tab
src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/groups.html
src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/groupslist.html
src/ldt/ldt/static/ldt/css/workspace.css
--- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/groups.html	Wed Jan 04 11:20:13 2012 +0100
+++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/groups.html	Wed Jan 04 12:17:47 2012 +0100
@@ -27,7 +27,7 @@
 	
 	input_list_init = [
 		{'input_selector':"#searchprojectsinput", 'container_selector':"#projectslistcontainer", 'url':project_filter_url},
-		{'input_selector':"#searchgroupsinput", 'container_selector':"#groupslistcontainer", 'url':groups_filter_url},
+		{'input_selector':"#searchgroupsinput", 'container_selector':"#groupslistcontainer", 'url':groups_filter_url}
 	];
 	
 		
@@ -39,7 +39,7 @@
         //alert("group id = " + $(this).attr('id') + ", url = " + get_group_projects_url);
         var id_group = $(this).attr('id');
         // Remove icons from all the lines
-        $(".next_icon, td .grouplink").hide();
+        $(".next_icon").hide();
         // Display icons from the good line
         $(".next_icon, .grouplink",this).show();
         // Show the search textfield and update the id_group in the hidden input
--- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/groupslist.html	Wed Jan 04 11:20:13 2012 +0100
+++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/groupslist.html	Wed Jan 04 12:17:47 2012 +0100
@@ -1,4 +1,22 @@
 {% load i18n %}
+{% load thumbnail %}
+
+<script type="text/javascript">
+
+	$(document).ready(function () {
+		var icon_size = 16;
+		$(".editable").each(function () {
+			var img = $('<img src="{{LDT_MEDIA_PREFIX}}img/pencil.png"/>');
+			var top = $(this).offset().top + $(this).height() - icon_size;
+			var left = $(this).offset().left + $(this).width() - icon_size;
+			img.css({'position' : 'absolute',
+					'top': top,
+					'left': left});
+			$(this).after(img);
+		});
+		
+	});
+</script>
 
 <div class="projectscontentsheader projectcontentsheadertitle span-12 last" id="contentsheader">
 {% trans "Click on the line to see the group's projects" %}
@@ -8,18 +26,19 @@
 <table class="projectscontentstable">
     <tbody class="projectscontentsbody">
 	{% for group in groups %}
-	<tr class="imageline {% cycle 'projectscontentsoddline' 'projectscontentsevenline' as color_cycle%} update_group_projects" id="{{ group.id }}">
+	<tr class="clickable imageline {% cycle 'projectscontentsoddline' 'projectscontentsevenline' as color_cycle%} update_group_projects" id="{{ group.id }}">
 		
 		{% if group.change %}
-			<td class="cellimg">
-			 	<a class="grouplink create_group" title="{% trans 'Change this group'%}" href="{% url ldt.ldt_utils.views.group.update_group group.id %}">
-			 	<img src="{{LDT_MEDIA_PREFIX}}img/group_edit.png" alt="{% trans 'Change this group' %}" title="{% trans 'Change this group' %}"/></a>
-			</td>
+			<td class="groupimg" >
+				<a class="grouplink create_group" title="{% trans 'Change this group'%}" href="{% url ldt.ldt_utils.views.group.update_group group.id %}">
+			    {% thumbnail group.profile.image "50x50" crop="center" format="PNG" as im %}<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}" class="editable"/>{% empty %}&nbsp;{% endthumbnail %}
+	    		</a>
+	    	</td>
 			<td><b>{{ group.name }}</b></td>
 		{% else %}
-			<td class="cellimg">
-			 	<img class="grouplink" src="{{ LDT_MEDIA_PREFIX }}img/group.png" title="{% trans "You are not allowed to edit this group" %}"/>
-			</td>
+			<td>
+	        {% thumbnail group.profile.image "50x50" crop="center" format="PNG" as im %}<img class="grouplink" src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}" title="{% trans "You are not allowed to edit this group" %}"/>{% empty %}&nbsp;{% endthumbnail %}
+	    	</td>
 			<td>{{ group.name }}</td>
 		{% endif %}
 		
@@ -29,10 +48,10 @@
 	{% endfor %}
 	
 	{% if not user.is_superuser and not search_active %}
-	<tr class="imageline {% cycle color_cycle %} update_group_projects" id="-1">  
-			<td class="cellimg">
-			 	<img class="grouplink" src="{{ LDT_MEDIA_PREFIX }}img/group.png" title="{% trans "You are not allowed to edit this group" %}"/>
-			</td>
+	<tr class="clickable imageline {% cycle color_cycle %} update_group_projects" id="-1">  
+			<td class="groupimg">
+	        {% thumbnail user.get_profile.image "50x50" crop="center" format="PNG" as im %}<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}" />{% empty %}&nbsp;{% endthumbnail %}
+	    	</td>
 			<td>{% trans "Projects shared with me only" %}</td>
 			
 			<td class="align_right"><img src="{{LDT_MEDIA_PREFIX}}/img/control_play.png" class="next_icon"/></td>	
--- a/src/ldt/ldt/static/ldt/css/workspace.css	Wed Jan 04 11:20:13 2012 +0100
+++ b/src/ldt/ldt/static/ldt/css/workspace.css	Wed Jan 04 12:17:47 2012 +0100
@@ -200,7 +200,7 @@
     margin-top: 20px;
 }
 
-.next_icon, .grouplink {
+.next_icon {
 	display: none;
 }
 
@@ -221,3 +221,12 @@
 #profile_forms input[type="text"], #profile_forms input[type="password"], select {
 	width: 250px;
 }
+
+.groupimg  {
+	height: 60px;	
+	width: 60px;
+}
+
+.clickable {
+	cursor: pointer;	
+}