<%@page import="javax.portlet.RenderRequest"%>
<%@page import="java.util.prefs.Preferences"%>
<%@page import="br.mp.mprj.portal.portlet.gestaomensagens.action.ConfiguracaoAction"%>
<%@page import="com.liferay.portal.service.persistence.PortletUtil"%>
<%@page import="javax.portlet.PortletSession"%>

<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %> 
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %> 
<%@ page import="javax.portlet.PortletPreferences" %>
<%@page import="com.liferay.portal.kernel.servlet.SessionMessages"%>
<%@page import="br.mp.mprj.portal.portlet.gestaomensagens.service.service.EmailDestinatarioLocalServiceUtil"%>

<%@ include file="/jsp/init.jsp" %>
<%
	Boolean result = SessionMessages.contains(renderRequest, "sucesso-excluir");
%>

<liferay-ui:success key="sucess" message="Seu e-mail foi removido da nossa lista de envios com sucesso."/>
<liferay-ui:error key="nao-cadastrado" message="E-mail informado já foi removido!" />

<liferay-portlet:actionURL var="removerEmailDestinatario">
	<liferay-portlet:param name="<%= ActionRequest.ACTION_NAME %>" value="ExcluirEmailDestinatario"/>
	<liferay-portlet:param name="mvcPath" value="/jsp/excluir-usuario.jsp"/>
</liferay-portlet:actionURL>

<liferay-portlet:renderURL var="redirect">
	<liferay-portlet:param name="mvcPath" value="/jsp/excluir-usuario.jsp"/>
</liferay-portlet:renderURL>
		<div class="portlet-content">		
	<div class=" portlet-content-container" style="">

		<div class="portlet-body">
			<ul aria-label="Breadcrumb" class="breadcrumb breadcrumb-horizontal" style="padding-left: 0px;">
				<li class="first"><a href="/web/consumidorvencedor-rj">Consumidor Vencedor</a><span class="divider">/</span></li><li class="active last"><a href="#">Descadastrar</a><span class="divider">/</span></li>
			</ul>
		</div>

	</div>				
</div>
		<c:if test="<%=result%>">
		   <div class="alert alert-info responsaveis-user">Seu e-mail foi removido da nossa lista de envios com sucesso.</div>
		</c:if>
		
      <aui:form action="${removerEmailDestinatario}" name="formCadEmail" id="formCadEmail" method="post">
       	 	
                
         <aui:input name="redirect" value="${redirect}" type="hidden"/>
         <span>Por favor, insira seu e-mail para cancelar o recebimento de newsletter:</span>
         <aui:row>
    			<aui:col span="9">
    				<aui:input name="email_usuario"	type="text" label="" required="true" inlineLabel="top"	inlineField="false"	showRequiredLabel="false" maxlength="80">
			           	<aui:validator name="required" />
						<aui:validator name="email" errorMessage="Por favor, preencha o campo de e-mail corretamente."/>
						<aui:validator name="maxLength" errorMessage="Por favor, digite até 80 caracteres.">80</aui:validator>
		       	  </aui:input> 
    			</aui:col>
    			<aui:col span="3" style="margin: 0 !important;">
    				 <aui:input type = "submit" value = "Enviar" name = "btnEmailDestinatario" label=" " cssClass="span3" onClick="javascript:window.location.href = $('#<portlet:namespace/>redirect').val();"></aui:input>    
    			</aui:col>
    	</aui:row>
       

      </aui:form>

<aui:script>
	AUI().ready('aui-module', function(A){ 
	
		var b = document.getElementsByClassName("breadcrumb breadcrumb-horizontal");
		
		
		var c = b[0].getElementsByClassName("active last")
		var d = c[0].getElementsByTagName("a");
		d[0].text = "descadastrar";
		d[0].href = window.location;
		
	});

</aui:script>