<!DOCTYPE html>
<html>
<head>
	<title> <%= APP_ABR %> </title>

	<% if user_signed_in? %>
	<!-- BEGIN THEME LAYOUT STYLES -->
	<%= stylesheet_link_tag  "application", "global/custom.css", "global/layout.css", "global/search.css", media: "all" %>
	<!-- END THEME LAYOUT STYLES -->
	<% else %>
	<!-- BEGIN PAGE GLOBAL STYLES -->
	<%= stylesheet_link_tag  "application", "global/login-5.css"  %>
	<!-- END PAGE GLOBAL STYLES -->
	<% end %>
	
	<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
	
	<%= csrf_meta_tags %>
</head>

<% if user_signed_in? %>
<!-- <body class="page-container-bg-solid page-header-menu-fixed"> -->
	<body class="page-container-bg-solid page-boxed">
	 <% unless flash.empty? %>
	  <script type="text/javascript">
	      <% flash.each do |f| %>
	      <% type = f[0].to_s.gsub('alert', 'error').gsub('notice', 'info') %>
	     	 toastr['<%= type %>']('<%= f[1] %>');
	      <% end %>
	  </script>
	 <% end %>
	 
	<!-- BEGIN HEADER -->
	<div class="page-header">
		<!-- BEGIN HEADER TOP -->
		<div class="page-header-top">
			<div class="container-fluid">
				<!-- BEGIN LOGO -->
				<div class="page-logo">
					<%= link_to root_path do %>
					  <%= image_tag "logos/logo-default.png", {:class=>"logo-default"} %>
					<% end %>	
				</div>
				<!-- END LOGO -->
				<!-- BEGIN TOP NAVIGATION MENU -->
				<a href="javascript:;" class="menu-toggler"></a>
				<div class="top-menu">
					<ul class="nav navbar-nav pull-right">
						<!-- BEGIN NOTIFICATION DROPDOWN -->
<!-- 						<li class="dropdown dropdown-extended dropdown-notification dropdown-dark" id="header_notification_bar">
							<a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
								<i class="fa fa-bell-o"></i>
								<span class="badge badge-default">7</span>
							</a>
							<ul class="dropdown-menu">
								<li class="external">
									<h3>Tienes
										<strong>2 mensaje(s)</strong> pendientes </h3>
									<a href="#">ver todos</a>
								</li>
								<li>
									<ul class="dropdown-menu-list scroller" style="height: 250px;" data-handle-color="#637283">
										<li>
											<a href="javascript:;">
												<span class="time">justo ahora</span>
												<span class="details">
													<span class="label label-sm label-icon label-success">
													<i class="fa fa-plus"></i>
													</span> Nuevo producto registrado. 
												</span>
											</a>
										</li>
										<li>
											<a href="javascript:;">
												<span class="time">10 mins</span>
												<span class="details">
													<span class="label label-sm label-icon label-warning"> <i class="fa fa-bell-o"></i>
													</span> Cambios en punto de venta. </span>
											</a>
										</li>
									</ul>
								</li>
							</ul>
						</li> -->
						<!-- END NOTIFICATION DROPDOWN -->

<!-- 						<li class="droddown dropdown-separator">
							<span class="separator"></span>
						</li> -->
						
						<!-- BEGIN USER LOGIN DROPDOWN -->
						<li class="dropdown dropdown-user dropdown-dark">
							<a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
								<!--<img alt="" class="img-circle" src="../assets/layouts/layout3/img/avatar9.jpg"> -->
								<%= image_tag "avatar.png", {:class=>"img-circle"} %>
								<span class="username username-hide-mobile"> <%= current_user.full_name %> </span>
							</a>
							<ul class="dropdown-menu dropdown-menu-default">
								<!-- <li>
									<a href="page_user_profile_1.html">
										<i class="icon-user"></i> My Profile </a>
								</li>
								<li>
									<a href="app_calendar.html">
										<i class="icon-calendar"></i> My Calendar </a>
								</li>
								<li>
									<a href="app_inbox.html">
										<i class="icon-envelope-open"></i> My Inbox
										<span class="badge badge-danger"> 3 </span>
									</a>
								</li>
								<li>
									<a href="app_todo_2.html">
										<i class="icon-rocket"></i> My Tasks
										<span class="badge badge-success"> 7 </span>
									</a>
								</li>
								<li class="divider"> </li> -->
								<li>
									<%= link_to  pwdchange_path   do %> <i class="fa fa-lock"></i> Cambiar contraseña
									<% end %>
								</li>
								<li>
									<%= link_to  destroy_user_session_path, :method => :delete  do %> <i class="fa fa-key"></i> Cerrar sesión
									<% end %>
								</li>
								<!-- <li>
									<a href="page_user_lock_1.html">
										<i class="icon-lock"></i> Lock Screen </a>
								</li>
								<li>
									<a href="page_user_login_1.html">
										<i class="icon-key"></i> Log Out </a>
								</li> -->
							</ul>
						</li>
						<!-- END USER LOGIN DROPDOWN -->
						
					</ul>
				</div>
				<!-- END TOP NAVIGATION MENU -->
			</div>
		</div>
		<!-- END HEADER TOP -->
		<!-- BEGIN HEADER MENU -->
		<div class="page-header-menu">
			<div class="container-fluid">
				<!-- BEGIN MEGA MENU -->
				<!-- DOC: Apply "hor-menu-light" class after the "hor-menu" class below to have a horizontal menu with white background -->
				<!-- DOC: Remove data-hover="dropdown" and data-close-others="true" attributes below to disable the dropdown opening on mouse hover -->
				<div class="hor-menu  ">
					<%= render_navigation( expand_all: true, renderer: :bootstrap3 ) %>
				</div> 
				<!-- END MEGA MENU -->
			</div>
		</div>
		<!-- END HEADER MENU -->
	</div>
	<!-- END HEADER -->

	<%= yield %>
	<%= render 'layouts/dialog' %>
	<div id="modal-holder"></div>
	<!-- BEGIN FOOTER -->
	
	<!-- BEGIN INNER FOOTER -->
	<div class="page-footer">
		<div class="container-fluid"> <%= APP_CREDITS %> 
			<!-- <a href="http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes" title="Purchase Metronic just for 27$ and get lifetime updates for free" target="_blank">Purchase Metronic!</a> -->
		</div>
	</div>
	<div class="scroll-to-top">
		<i class="fa fa-arrow-up"></i>
	</div>
	<!-- END INNER FOOTER -->
	<!-- END FOOTER -->
<% else %>
	<%= yield %>
<% end %>

</body>
</html>
