Index: trunk/prototype/modules/calendar/templates/calendar_list.ejs
===================================================================
--- trunk/prototype/modules/calendar/templates/calendar_list.ejs	(revision 5399)
+++ trunk/prototype/modules/calendar/templates/calendar_list.ejs	(revision 5592)
@@ -1,4 +1,4 @@
 <div class="all-list-calendars">
-<% var agendas_usuario = data.calendars %>
+<% var signature = data.signatures %>
 <% var external = false %>
 <div class="my-calendars">
@@ -7,28 +7,25 @@
 	<a href="#" class="button new new-calendar">Nova Agenda</a>
 	<ul class="list-calendars my-list-calendars">
-				<% for (var i=0; i < agendas_usuario.length; i++) {
-
-					if(data.signatureOf[agendas_usuario[i].id].isOwner == 1){
-					
-						var assinatures = data.signatureOf[agendas_usuario[i].id];
-
+				<% for (var i=0; i < signature.length; i++) {
+					if(signature[i].isOwner == 1){
 				%>
-					<li class="list-calendars-item list-calendars-item-<%= agendas_usuario[i].id %>">
+					<li class="list-calendars-item list-calendars-item-<%= signature[i].calendar.id %>">
 						
 						<div>
-							<input class="calendar-view" type="checkbox" name="" value="<%= agendas_usuario[i].id %>" checked="checked"/>
-							<label><%= agendas_usuario[i].name %></label>
+							<input class="calendar-view" type="checkbox" name="" value="<%= signature[i].calendar.id %>" checked="checked"/>
+							<label><%= signature[i].calendar.name %></label>
 							
 						</div> 
-							<a class="cal-list-options-btn my-cal-list-options-btn-<%= agendas_usuario[i].id %>" style="background-color:#<%=assinatures.backgroundColor%>; border-color:#<%= assinatures.borderColor%>;">
+							<a class="cal-list-options-btn my-cal-list-options-btn-<%= signature[i].calendar.id %>" style="background-color:#<%=signature[i].backgroundColor%>; border-color:#<%= signature[i].borderColor%>;">
 								<img src="../prototype/modules/calendar/img/arrow_down.png" width="10" height="10" class="cal-list-img"/>
 							</a>
 							
 							
-						<div class="cal-list-options my-cal-list-options-<%= agendas_usuario[i].id %> hidden">
+						<div class="cal-list-options my-cal-list-options-<%= signature[i].calendar.id %> hidden">
 							<ul>
-								<li><a href="#" onclick="add_tab_configure_calendar(<%= agendas_usuario[i].id%>);">Configurações</a></li>
-								<li><a href="#" onclick="show_modal_import_export(0, <%= agendas_usuario[i].id%>);">Importar</a></li>
-								<li><a href="#" onclick="show_modal_import_export(1, <%= agendas_usuario[i].id%>);">Exportar</a></li>
+								<li><a href="#" onclick="add_tab_configure_calendar(<%= signature[i].calendar.id%>);">Configurações</a></li>
+								<li><a href="#" onclick="show_modal_import_export(0, <%= signature[i].calendar.id%>);">Importar</a></li>
+								<li><a href="#" onclick="show_modal_import_export(1, <%= signature[i].calendar.id%>);">Exportar</a></li>
+								<li><a href="#" onclick="show_modal_shared(<%= signature[i].calendar.id%>);">Compartilhar agenda</a></li>
                                 <li><a href="#" onclick="remove_calendar();">Remover agenda</a></li>
 							</ul>
@@ -44,25 +41,30 @@
 	</ul>
 </div>
-<% if (external) { %>
+
 <div class="signed-calendars">
 	<a title='Agendas assinadas' class="title-signed-calendars" aria-expanded='false' role='button' tabindex='0'>Agendas assinadas</a>			
+	<span class="status-list-shared ui-icon ui-icon-triangle-1-s"></span>
+	<a href="#" class="button new new-calendar-shared tiny">Nova Agenda</a>
+	
+	<% if (external) { %>	
 		<ul class="list-calendars signed-list-calendars">
-			
-					<% for (var i=0; i < agendas_usuario.length; i++) {
-						if(data.signatureOf[agendas_usuario[i].id].isOwner == 0){
+				<% for (var i=0; i < signature.length; i++) {
+						if(signature[i].isOwner == 0){
 					%>
-						<li class="list-calendars-item list-calendars-item-<%= agendas_usuario[i].id %>">
-							<input class="calendar-view" type="checkbox" name="" value="<%= agendas_usuario[i].id %>" checked="checked"/>
-							<label><%= agendas_usuario[i].name %></label>
+						<li class="list-calendars-item list-calendars-item-<%= signature[i].calendar.id %>">
+							<input class="calendar-view" type="checkbox" name="" value="<%= signature[i].calendar.id %>" checked="checked"/>
+							<label><%= signature[i].calendar.name %></label>
 
-							<a class="cal-list-options-btn signed-cal-list-options-btn-<%= agendas_usuario[i].id %>" onclick="show_cal_list_options('signed-cal-list-options-', <%= agendas_usuario[i].id %>)"  style="background-color:#<%=assinatures.backgroundColor%>; border-color:#<%= assinatures.borderColor%>"><img src="img/arrow_down.png" width="10" height="10" class="cal-list-img"></a>
-							<div class="cal-list-options signed-cal-list-options-<%= agendas_usuario[i].id %> hidden">
+							<a class="cal-list-options-btn my-cal-list-options-btn-<%= signature[i].calendar.id %>" style="background-color:#<%=signature[i].backgroundColor%>; border-color:#<%= signature[i].borderColor%>;">
+							<img src="../prototype/modules/calendar/img/arrow_down.png" width="10" height="10" class="cal-list-img"/></a>
+							<div class="cal-list-options my-cal-list-options-<%= signature[i].calendar.id  %> hidden">
 								<ul>
-									<li><a href="#">Configurações</a></li>
-									<li><a href="#">Importar</a></li>
-									<li><a href="#">Exportar</a></li>
-                                    <li><a href="#">Cancelar assinatura</a></li>
+									<li><a href="#" onclick="add_tab_configure_calendar(<%= signature[i].calendar.id %>);">Configurações</a></li>
+									<li><a href="#" onclick="show_modal_import_export(0, <%= signature[i].calendar.id %>);">Importar</a></li>
+									<li><a href="#" onclick="show_modal_import_export(1, <%= signature[i].calendar.id %>);">Exportar</a></li>
+									<li><a href="#" onclick="cancel_signature(<%= signature[i].id %>);">Cancelar assinatura</a></li>
 								</ul>
-							</div>
+
+						</div>
 
 						</li>
@@ -72,5 +74,5 @@
 					%>
 		</ul>
+	<% } %>
 	</div>
-<% } %>
 </div>
