<%
import org.exoplatform.services.wcm.newsletter.NewsletterSubscriptionConfig;
import org.exoplatform.services.wcm.newsletter.config.NewsletterManagerConfig;
import org.exoplatform.services.wcm.newsletter.NewsletterCategoryConfig;
%>

	<div class="UINewsletterPortlet">
	<% uiform.begin() %>
		<div class="ClearFix">
		<div class="BreadCumbs">
			<a class="ItemContent" style="color:blue;" href="<%=uicomponent.event("BackToCategories")%>">
					eXo Newsletter
			</a>
			>
			<a class="ItemContent" style="color:blue;" href="<%=uicomponent.event("BackToSubcriptions")%>">
					<%=uicomponent.categoryConfig.getTitle()%>
			</a>
			>
			<a class="ItemContent"><%=uicomponent.subscriptionConfig.getTitle()%></a>
		 </div>
		
		 <div class="UIAction" style="float:left; margin-left: 20px; height: 35px;"> 
			<div class="ContentAction ActionTitle" style="float:left;">
				<div class="Name" style="float:none; cursor:pointer;">
          	  		<a href="javascript:void(0);" onclick="javaScript:void(0);" class="ActionButton LightBlueStyle">
          	  			<%=_ctx.appRes("NewsletterPortlet.action.CreateLetter")%>
          	  		</a>
				</div>
  	  		</div>
		</div>
		</div>
		<div class="UICategories">
			<div style="width:100%;">
				<!-- Subscription infor -->
				<div class=" ClearFix" style="width:100%;height:30px;line-height:30px;">
					<div style="float:left;">
						<strong><%=uicomponent.subscriptionConfig.getTitle() %></strong>:
						<%=uicomponent.subscriptionConfig.getDescription() %>
					</div>
					
					<!-- ----------------------------------- Button -------------------------------------------------- -->
					<div class="UIAction" style="float:right; padding:0px 0px 0px 10px;"> 
				          	  	
						<div class="ContentAction ActionTitle" style="float:right;" onclick="eXo.webui.UIPopupSelectCategory.show(this, event);">
							<div class="Name" style="float:none; cursor:pointer;">
			          	  		<a href="javascript:void(0);" onclick="javaScript:void(0);" class="ActionButton LightBlueStyle">
			          	  			<%=_ctx.appRes("NewsletterPortlet.action.Moderation")%>
			          	  		</a>
							</div>
							<!-- ----------------------------------- Menu popup -------------------------------------- -->
							<div style="position:relative;float:left;">
								<div class="UIPopupCategory" style="display:none;text-align:left;top:-2px; ">
									<div class="UIRightClickPopupMenu" style="display:block;">
										<div class="UIContextMenuContainer">											
											<div class="TopLeftRightClickPopupMenu">
												<div class="TopRightRightClickPopupMenu">
													<div class="TopCenterRightClickPopupMenu"><span></span></div>
												</div>
											</div>
											<div class="MiddleLeftRightClickPopupMenu">
												<div class="MiddleRightRightClickPopupMenu">
													<div class="UIRightPopupMenuContainer">
														<!-- Detail action -->
														<div class="MenuItem" onclick="<%=uicomponent.event("OpenNewsletter")%>">
															<div class="ItemIcon IconsView" style="padding-left:18px;">
																<a href="javaScript:void(0)">Open</a>
															</div>
														</div>
														<div class="MenuItem" onclick="<%=uicomponent.event("EditSubscription")%>">
															<div class="ItemIcon IconsView" style="padding-left:18px;">
																<a href="javaScript:void(0)">Edit</a>
															</div>
														</div>
														<div class="MenuItem" onclick="<%=uicomponent.event("DeleteSubscription")%>">
															<div class="ItemIcon IconsView" style="padding-left:18px;">
																<a href="javaScript:void(0)">Delete</a>
															</div>
														</div>
														<hr style="width:90%"/>
														<div class="MenuItem" onclick="<%=uicomponent.event("AddCategory")%>">
															<div class="ItemIcon IconsView" style="padding-left:18px;">
																<a href="javaScript:void(0)">Manager Uers</a>
															</div>
														</div>
														<!-- Finish detail action -->
													</div>
												</div>
											</div>
											<div class="BottomLeftRightClickPopupMenu">
												<div class="BottomRightRightClickPopupMenu">
													<div class="BottomCenterRightClickPopupMenu"><span></span></div>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
	          	  		</div>
					</div>
						
					<!-- end action of this category -->
					
					
				</div>
				
				
				<!-- All newsletter entry -->
				<div class="Subscriptions">
					<table cellpadding="5" cellspacing="0" border="0">
						<tr class="Header">
							<th class="ContentView" style="border-left:0px;">
								Letter
							</th>
							<th class="ContentView">
								Date
							</th>
							<th class="ContentView">
								Status
							</th>
							<th class="ContentView" style="border-left:1px solid black;width:40px;">
								<input type="checkbox" title="checked">
							</th>
						</tr>
						<%int count = 0;
							String color = "";
							for(NewsletterManagerConfig newsletter in uicomponent.listNewsletterConfig){
								if(count % 2 == 0) color = "";
								else color="background:white;";
							%>
								<tr class="SubcriptionInfor" style="$color">
									<td class="Infor" style="border-left:0px;">
										<a href="<%=uicomponent.event("OpenSubscription")%>">
											<%=newsletter.getNewsletterTitle()%>
										</a>
									</td>
									<td class="Infor"><%=newsletter.getNewsletterSentDate()%></td>
									<td class="Infor"><%=newsletter.getStatus()%></td>
									<td class="Infor">
										<%uicomponent.renderChild(newsletter.getNewsletterName())%>
									</td>
								</tr>
						<%	count ++;
							}%>
					</table>
				</div>
			</div>
		</div>
	<%uiform.end()%>	
</div>
