Index: trunk/prototype/modules/calendar/templates/event_list.ejs
===================================================================
--- trunk/prototype/modules/calendar/templates/event_list.ejs	(revision 6525)
+++ trunk/prototype/modules/calendar/templates/event_list.ejs	(revision 6996)
@@ -1,3 +1,9 @@
-<div title="Lista de eventos" class="events-list events-list-win active">
+<%
+
+    var decoder = {status: {1: 'Sem ações', 2: 'Em processo', 3: 'Completo', 4: 'Cancelado'}, priority: {1: 'Alta', 2: 'Normal', 3: 'Baixa'}}
+
+%>
+
+<div title="<%=data.tab_title%>" class="events-list events-list-win active">
 	
 	
@@ -43,4 +49,19 @@
 					<td>
 						<span>
+							<%
+							var img_type = "";
+							var title_type = "";
+							if(_event.type == '1'){
+								img_type = "../prototype/modules/calendar/img/big-event.png";
+								title_type = "Evento";
+							}if(_event.type == '2'){
+								img_type = "../prototype/modules/calendar/img/big-task.png"; 
+								title_type = "Tarefa";
+							}if(_event.type == '3'){
+								img_type = "../prototype/modules/calendar/img/activity_icon.jpg"; 
+								title_type = "Atividade";
+							}
+							%>
+							<img title="<%= title_type %>" src="<%= img_type %>"> 
 							<a class="title event-details-item" title='<%= _event.summary %>' aria-expanded='false' role='button' tabindex='0'><%= _event.summary %></a>
 							<!-- TODO: FAZER FUNCIONAR DESTA FORMA -->
@@ -86,9 +107,9 @@
 							%>
 						</span>	
-						<div class="details-event-list hidden">
+						<div class="details-event-list hidden <%= (title_type == "Evento" ? "details-event" : "details-task")  %>">
 							<fieldset class="fields-details-event-list">							
 								<%if(_event.allDay){%>
 									<p class="input-group date-info">
-										<label>Duração</label>
+										<label>Duração:</label>
 										<span class="">Dia inteiro</span>
 									</p>
@@ -108,38 +129,66 @@
 									</p>
 								<%}%>
-								<%if(_event.repeat ){%>
+								<%if(_event.type == '1'){
+									if(_event.repeat ){%>
 								    <p class="input-group">
 									<label>Repetição</label>
 									<span><%= _event.repeat %></span>
 								    </p>
-								<%}%>
-								<p class="input-group">
-									<label>Lembretes</label>
-									<% if(_event.alarms) { %>
+								<%}}%>
+								<p class="input-group">
+									<label>Lembretes:</label>
+									<% if(_event.alarms) { 
+											var string_alarm = "";
+											if(_event.type == '1')
+												string_alarm = 'do evento'; 
+											if(_event.type == '2')
+												string_alarm = 'da tarefa';
+											if(_event.type == '3')
+												string_alarm = 'da atividade';
+											%>
 										<span class="large" >
 											<% for (var l=0; l < _event.alarms.length; l++) { %>
-												<span class="large" >Você será notificado por um <%=dateCalendar.alarmtype[_event.alarms[l].type]%> <%= _event.alarms[l].time %> <%= dateCalendar.timeunit[_event.alarms[l].unit]%><%=_event.alarms[l].time > 1 ? 's' : '' %> antes do evento</span>
+												<span class="large" >Você será notificado por um <%=dateCalendar.alarmtype[_event.alarms[l].type]%> <%= _event.alarms[l].time %> <%= dateCalendar.timeunit[_event.alarms[l].unit]%><%=_event.alarms[l].time > 1 ? 's' : '' %> antes <%=string_alarm%></span>
 											<% } %>
 										</span>
 									<% } %>
 								</p>
-								<p class="input-group">
-									<label>Local</label>
+								<%if(_event.type == '1'){%>
+								<p class="input-group">
+									<label>Local:</label>
 									<span><%= _event.location %></span>
 								</p>
-								<p class="input-group">
-									<label>Descrição </label>
+								<%}%>
+								<p class="input-group">
+									<label>Descrição:</label>
 									<span class="large" ><%= _event.description %></span>
 								</p>
-								<!--<p class="input-group">
+								<%if(_event.type != '1'){%>
+								<p class="input-group">
+									<label>Prioridade:</label>
+									<span><%= decoder['priority'][_event.priority] %></span>
+								</p>
+								<p class="input-group">
+									<label>% Conlusão:</label>
+									<span><%= _event.percentage %>%</span>
+								</p>
+								<p class="input-group">
+									<label>Status:</label>
+									<span><%= decoder['status'][_event.status] %></span>
+								</p>
+								<% } %>
+								<!-- <p class="input-group">
 									<label>Privacidade</label>
 									<span><%= _event.privacy %></span>
-								</p>-->
-								<p class="input-group">
-									<label>Organizador</label>
-									<span class="large"><%= _event.organizer.user ? _event.organizer.user.name : _event.organizer.name %>  (<%= _event.organizer.user ? _event.organizer.user.mail : _event.organizer.mail %>)</span>
-								</p>
-								<p class="input-group">
-									<label>Participantes</label>
+								</p> -->
+								<%if(_event.organizer && _event.organizer.user){%>
+    								<p class="input-group">
+    									<label>Organizador:</label>
+    									<span class="large"><%= _event.organizer.user ? _event.organizer.user.name : _event.organizer.name %>  (<%= _event.organizer.user ? _event.organizer.user.mail : _event.organizer.mail %>)</span>
+    								</p>
+                                <%}%>
+								<%if(_event.type != '3'){%>
+								<p class="input-group">
+									<label>Participantes:</label>
 									<% if(_event.attendee) { %>
 										<span class="large" >
@@ -150,22 +199,39 @@
 									<% } %>
 								</p>
-								<p class="input-group">
-									<label>Presença</label>
+								<%}
+								if(_event.type == '3'){%>
+								<p class="input-group">
+									<label>Tarefas</label>
+									<% if(_event.tasks) { %>
+										<span class="large" >
+											<% for (var m in _event.tasks) { %>
+												<span class="large"><%=_event.tasks[m].description%></span>
+											<%}%>
+										</span>
+									<% } %>
+								</p>
+								<%}%>
+								
+								<p class="input-group">
+									<label>Presença:</label>
 									<span>
-                                                                            <% var status_name;
-                                                                                if (_event.status == 1)
-                                                                                    status_name = "Eu vou";
-                                                                                else if (_event.status == 2)
-                                                                                    status_name = "Talvez";
-                                                                                else if (_event.status == 3)
-                                                                                    status_name = "Eu não vou";
-                                                                            %>
-                                                                            <%= status_name %>
-                                                                        </span> <!-- Ta hardcodificado isso aqui? -->
-								</p>
+                                        <% var status_name;
+                                            if (_event.status == 1)
+                                                status_name = "Eu vou";
+                                            else if (_event.status == 2)
+                                                status_name = "Talvez";
+                                            else if (_event.status == 3)
+                                                status_name = "Eu não vou";
+                                        %>
+                                        <%= status_name %>
+                                    </span> <!-- Ta hardcodificado isso aqui? -->
+								</p>
+
 							</fieldset>
 							<div class="menu-container footer-container">
 								<input name="eventid" type="hidden" value="<%=_event.id%>"></input>
-                                                                <input name="calendarid" type="hidden" value="<%=_event.calendar%>"></input>
+								<input name="eventtype" type="hidden" value="<%=_event.type%>"></input>
+                                <input name="calendarid" type="hidden" value="<%=_event.calendar ? _event.calendar : _event.group%>"></input>
+								<a title="Imprimir" class="button print" href="#">Imprimir</a>
 								<a title="Excluir" class="button delete" href="#">Excluir</a>
 								<a title="Editar" class="button edit" href="#">Editar</a>
