#{param name=currentProjectId /}
#{param name=project /}
#{param name=projectStatuses /}
#{param name=numberTasksByStatus/}
#{param name=tasks /}
#{param name=taskNum/}
#{param name=incomNum/}
#{param name=groupTasks /}
#{param name=keyword /}
#{param name=groupBy /}
#{param name=orderBy /}
#{param name=filter /}
#{param name=projects/}
#{param name=labels/}
#{param name=userSetting/}
#{param name=userTimezone/}
#{param name=bundle/}
#{param name=taskId/}
#{param name=taskModel/}
#{param name=isInSpace/}
#{param name=orders /}
#{param name=groups /}
#{param name=viewType/}
#{param name=currentLabelId/}
#{param name=currentLabelName/}
#{param name=advanceSearch/}
#{param name=showCompleted/}
#{param name=paging/}
#{param name=errorMessage/}

<!-- Consider this -->
#{param name=taskService/}
#{param name=currentUser/}

<div class="taskMngCont">
	<div id="taskManagement" class="row-fluid">
	    <div class="leftPanel uiAccordion span3">
	        <ul class="left-menu">
	             <%if (!isInSpace) { %>
                <li class="accordion-heading dropdown">
                    <div class="item">
                        <a class="dropdownIcon collapseTree pull-right" href="javascript:void(0)">
                            <i class="uiIconLightGray uiIconArrowDownMini"></i>
                        </a>
                        <a class="project-name" href="javascript:void(0)">&{label.tasks}</a>
                    </div>
                    <ul class="list-projects">
                    
                        <li class="dropdown project-item ${currentProjectId == -1 ? "active" : ""}">
                            <div class="sub-item">
                                <a href="javascript:void(0);" class="project-name" data-id="-1" data-filter="incoming">&{label.incoming}&nbsp;<span class="badgeDefault badgePrimary mini top">${incomNum}</span></a>
                            </div>
                        </li>                     
                        <li class="dropdown project-item ${currentProjectId == -2 && (filter == null || filter == "") ? "active" : ""}">
                            <div class="sub-item">
                                <a href="javascript:void(0)" class="project-name" data-id="-2" data-filter="">
                                    &{label.allTasks}
                                </a>
                            </div>
                        </li>
                        <li class="dropdown project-item ${currentProjectId == -2 && (filter == "overdue") ? "active" : ""}">
                            <div class="sub-item">
                                <a href="javascript:void(0)" class="project-name" class="project-name" data-id="-2" data-filter="overdue">
                                    &{label.overdue}
                                </a>
                            </div>
                        </li>
                        <li class="dropdown project-item ${currentProjectId == -2 && (filter == "today") ? "active" : ""}">
                            <div class="sub-item">
                                <a href="javascript:void(0)" class="project-name" class="project-name" data-id="-2"  data-filter="today">
                                    &{label.today}
                                </a>
                            </div>
                        </li>
                        <li class="dropdown project-item ${currentProjectId == -2 && (filter == "tomorrow") ? "active" : ""}">
                            <div class="sub-item">
                                <a href="javascript:void(0)" class="project-name" class="project-name" data-id="-2"  data-filter="tomorrow">
                                    &{label.tomorrow}
                                </a>
                            </div>
                        </li>
                        <li class="dropdown project-item ${currentProjectId == -2 && (filter == "upcoming") ? "active" : ""}">
                            <div class="sub-item">
                                <a href="javascript:void(0)" class="project-name" class="project-name" data-id="-2"  data-filter="upcoming">
                                    &{label.upcoming}
                                </a>
                            </div>
                        </li>
                    </ul>
                </li>
                <%} %>
	            <!-- <li class="accordion-heading" style="display: none">
	              <a class="dropdownIcon pull-right" href="javascript:void(0)">
                      <i class="uiIconLightGray uiIconArrowDown"></i>
                  </a>  
                  <a class="project-name" data-id="-2" href="#">&{label.todo}</a>
	            </li> -->
	            <li class="accordion-heading dropdown" data-showhiddenproject="${userSetting.showHiddenProject}">
	                <div class="item">
		                <a class="dropdownIcon pull-right collapseTree" href="javascript:void(0)">
                            <i class="uiIconLightGray uiIconArrowDownMini" ></i>
                        </a>
                        <a class="dropdown-toggle actionIconSmall dropdownIcon add-new-project pull-right" 
		                   data-toggle="dropdown" data-content="&{label.welcome.firstProject}" data-placement="bottom"
		                   href="javascript:void(0)">
		                    <i class="uiIconLightGray uiIconSimplePlusMini addProject" ></i>
                        </a>
		                <div class="dropdown-menu uiDropdownWithIcon">
		                	<span class="arrowLeft"></span>
		                	<ul class="uiDropdownMenu">
			                    <li>
                                    <a class="new-project" data-projectId="0" href="#">
                                        <i class="uiIconAddProject uiIconLightGray"></i>&{label.addProject}
                                    </a>
                                </li>
			                    <li>
                                    <a href="javascript:void(0)" class="actionShowHiddenProject">
                                        <i class="uiIconShowProject uiIconLightGray"></i><span class="label-showHiddenProject">&{label.showHiddenProject}</span><span class="label-hideHiddenProject">&{label.hideHiddenProject}</span>
                                    </a>
                                </li>
			                </ul>
			            </div>
		                <a class="project-name" data-id="0" href="#">&{label.projects}</a>
					</div>
	
	                #{include path=listProjects.gtmpl /}
	            </li>
	            <li class="accordion-heading dropdown" data-showhiddenlabel="${userSetting.showHiddenLabel}">
	               <div class="item">  
                      <a class="dropdownIcon collapseTree pull-right" href="javascript:void(0)">
                          <i class="uiIconLightGray uiIconArrowDownMini"></i>
                      </a>
                      <a href="javascript:void(0)" data-placement="bottom" data-content="&{label.welcome.firstLabel}" data-toggle="dropdown" class="dropdown-toggle actionIconSmall dropdownIcon add-new-label pull-right">
                        <i class="uiIconLightGray uiIconSimplePlusMini addLabel"></i>
                      </a>
                      <div class="dropdown-menu uiDropdownWithIcon">
                        <span class="arrowLeft"></span>
                        <ul class="uiDropdownMenu">
                            <li>
                              <a class="new-label" data-projectId="0" href="#">
                                <i class="uiIconAddLabel uiIconLightGray"></i>&{label.addLabel}
                              </a>
                            </li>
                            <li>
                              <a href="javascript:void(0)" class="actionShowHiddenLabel">
                                <i class="uiIconShowLabel uiIconLightGray"></i><span class="label-showHiddenLabel">&{label.showHiddenLabel}</span><span class="label-hideHiddenLabel">&{label.hideHiddenLabel}</span>
                              </a>
	                         </li>
                          </ul>
                      </div>
                      <a class="label-name" data-labelid="0" href="#">&{label.labels}</a>
                   </div>
                   
                   <div class="lblContainer">
                   	#{include path=listLabels.gtmpl /}
                   </div>
	            </li>
	        </ul>	   
	    </div>
	    <div class="centerPanel uiBox <%=taskId == -1 ? "span9" : "span5" %>">
	         <div class="resizeButton show-hide-left" id="ShowHideLeft">
				  <i  class="uiIconMiniArrowLeft"></i>
				</div>
            <div class="centerPanelContent ">            	
                #{include path=projectTaskListView.gtmpl /}
            </div>
	    </div>
	    <div class="rightPanel span4" style="<%= taskId == -1 ? "display: none" : ""%>">
	    	<div class="resizeButton close-right-panel" id="ShowHideRight" >
			  <!-- after click this icon add class .saved -->
			  <i class="uiIconMiniArrowRight saved"></i>
			</div>
	        <div class="rightPanelContent ">
	            <!-- Content at right will be load dynamically by ajax -->
	            <%if (taskId != -1) { %>
	            #{include path=detail.gtmpl /}
	            <%} %>
	        </div>
	    </div>
	    
	    <!-- Modal -->
	    <div class="modalPlace"></div>
        <div class="modalPlaceForMessage"></div>
	    <div class="confirmCloneProject uiPopup modal hide fade" tabindex="-1" role="dialog" aria-labelledby="cloneProjectLabel" aria-hidden="true">
		  <div class="popupHeader clearfix">
		  	<a onclick="" title="Close Window" data-dismiss="modal" aria-hidden="true" class="uiIconClose pull-right"></a>
		    <div id="cloneProjectLabel" class="PopupTitle popupTitle">&{popup.confirm}</div>
		  </div>
		  <div class="PopupContent popupContent">
			  <div class="media">
			  	<div class="pull-left">
			  		<i class="uiIconColorQuestion"></i>
			  	</div>
			  	<div class="media-body">
			  		<p class="msg" data-msg="&{popup.msg.cloneProject}"></p>	
			    	<p>
				    	<span class="uiCheckbox">
			                <input type="checkbox" checked="checked" class="checkbox cloneTask">
			                <span>&{popup.checkbox.cloneTask}</span>
		                </span>			    
			    		<input type="hidden" class="pId"/>
		    		</p>
			  	</div>
			  </div>
			  <div class="uiAction uiActionBorder">
			    <button class="btn btn-primary">&{popup.clone}</button>
			    <button class="btn" data-dismiss="modal" aria-hidden="true">&{popup.cancel}</button>
			  </div>
		  </div>
		</div>
	</div>
</div>
<script type="text/javascript">
<%if (errorMessage != null && !errorMessage.isEmpty()) {%>
    require(['taskManagementApp'], function(taApp) {
        taApp.showWarningDialog("${errorMessage}");
    });
<%}%>
</script>