<div class="UIAddressEmailsForm $uicomponent.id">
<%
import org.exoplatform.services.organization.User;
 uiform.begin() 
 def rcontext = _ctx.getRequestContext() ;
 rcontext.getJavascriptManager().addJavascript('eXo.ks.CheckBox.init("'+uiform.id+'") ;') ;
 %>
<div class="UIInsertAddress">
  <div class="InsertAddressContainer" style="padding:5px">
  	<!-- ======================================= search user ======================================================= -->
	<div style="border:1px solid gray;padding:10px;float:left;margin:5px 0px 10px 0px;text-align:center;width:620px;">
		<div style="float:left;margin:5px 5px 5px 10px;">
			<div style="float:left;font-weight:bold;"><%=_ctx.appRes("UIAddressEmailsForm.label.user-search") %>:</div>
			<div style="float:left;margin-left:5px"><% uiform.renderField(uiform.USER_SEARCH) %></div>
			<div style="float:left;padding-top:6px;">
				<a class="SearchIcon" style="padding:5px 5px 2px 10px; margin-left:5px" href="<%=uicomponent.event("Search")%>" title="<%=_ctx.appRes(uicomponent.id+ '.label.quick-search') %>">&nbsp;</a>
			</div>
		</div>
		
		<div style="float:left; margin:5px 5px 5px 5px;">
		  <div class="AddressLabel" style="float:left; padding-left:10px;"><b><%=_ctx.appRes("UIAddressEmailsForm.label.addresses-from-group") %> :</b></div>
		  <div style="float:left; margin-left:10px;"><% uiform.renderField(uiform.USER_GROUP) %></div>
		  <div style="clear:left"><span></span></div>
		</div>
	</div>
	<div style="clear:left;"><span></span></div>
    
	<!-- ======================================= view all users ======================================================= -->
    <div class="AddressContainer">
      <div class="ListAddress">

        <table cellspacing="0" border="0" cellpadding="0" id="UIListUsers" class="UIGrid">
            <thead>
              <tr>
                <th style="width:20px;" class="BorderAddress"><input type="checkbox" class="checkbox" value="4" /></th>
                <th class="BorderAddress">
                  <div class="BlueDownArrowIcon">
                    <div class="Label"><%=_ctx.appRes("UIAddressEmailsForm.label.name") %></div>
                  </div>
                </th>
                <th style="width:48%;" >
                  <div class="BlueDownArrowIcon">
                    <div class="Label"><%=_ctx.appRes("UIAddressEmailsForm.label.email") %></div>
                  </div>
                </th>
              </tr>
            </thead>
            <tbody>
              <%
                for (User user : uicomponent.getUsers()) {
					checkboxField = uicomponent.getChildById(user.getUserName());
              %>
	                <tr>
					  <td>
	                    <%
	                    if (checkboxField != null) { uicomponent.renderField(checkboxField); }
	                    %>
	                  </td>
	                  <td class="text BorderAddress"><%=user.getFullName()%></td>
	                  <td class="text"><%=(user.getEmail() != null ? user.getEmail() : "")%></td>
	                </tr>
              <%}%>
          </tbody>
        </table>
		<div style="padding:5px 10px;while-space:nowrap;">
			<%_ctx.include("app:/templates/faq/webui/UIPageIterator.gtmpl");%>     
		</div>
      </div>
      
    </div>

  </div>
  <div class="UIAction">
	<a href="javascript:void(0);" onclick="<%=uicomponent.event("Add")%>" class="ActionButton LightBlueStyle"><%=_ctx.appRes("UIAddressEmailsForm.label.add-address") %></a>
	<a href="javascript:void(0);" onclick="<%=uicomponent.event("Cancel")%>" class="ActionButton LightBlueStyle"><%=_ctx.appRes("UIAddressEmailsForm.label.cancel") %></a>
</div>
 </div>
<% uiform.end() %>
</div>