Sha256: fde687a24bb372e2db4670d15dc07488fc9f1bbd6f7c7a084606d3085c645361

Contents?: true

Size: 1.89 KB

Versions: 30

Compression:

Stored size: 1.89 KB

Contents

<form action="/login" method="post" id="login-form">
	<div class="header">
		<img src="/assets/caboose/caboose_logo.png" alt="Caboose">
		<h1>caboose</h1>
		<p>Coo Coo Ca Choo</p>
	</div>
	
	<input type="hidden"   name="return_url" value="<%= @return_url %>" />
	<input type="text"     name="username" id="username" placeholder="Login or email" />
	<input type="password" name="password" id="password" placeholder="Password" />
	
	<label>
		<input type="checkbox" name="remember" id="remember" value="1" checked="true" /> Remember me
	</label>
	
	<ul id="login-options">
		<li><a href="/register?return_url=<%= @return_url %>" class='register'>Need to register?</a></li>
		<li><a href="/login/forgot-password?return_url=<%= @return_url %>" class='forgot'>Forgot your password?</a></li>
	</ul>
	
	<div id="message"></div>
	
	<p class="buttons">
	  <input type="button" class="btn" value="Cancel" onclick="parent.$.fn.colorbox.close();" />
		<input type="submit" class="btn" value="Login" onclick='login(); return false;' />
	</p>
</form>

<%= content_for :caboose_css do %>
<%= stylesheet_link_tag "caboose/login", media: "all" %>		
<style type="text/css">
#modal_content input[type=checkbox] { position: relative; }
</style>
<% end %>

<% content_for :caboose_js do %>
<script type="text/javascript">
var modal = false;
	
$(window).load(function() {
  modal = new CabooseModal(400);
});
	
function login() {
  modal.autosize("<p class='loading'>Logging in...</p>");

	$.ajax({
		url: '/login',
		type: 'post',
		data: $('#login-form').serialize(),
		success: function(response) {
			if (response.error) modal.autosize("<p class='note error'>" + response.error + "</p>");
			else if (response.redirect != false) <%= @modal ? "" : "parent." %>window.location = response.redirect;
			else parent.location.reload(true);
		},
		error: function() {	
			modal.autosize("<p class='note error'>Error</p>");			
		}
	});
}
</script>
<% end %>

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
caboose-cms-0.4.13 app/views/caboose/login/index.html.erb
caboose-cms-0.4.12 app/views/caboose/login/index.html.erb
caboose-cms-0.4.11 app/views/caboose/login/index.html.erb
caboose-cms-0.4.10 app/views/caboose/login/index.html.erb
caboose-cms-0.4.9 app/views/caboose/login/index.html.erb
caboose-cms-0.4.8 app/views/caboose/login/index.html.erb
caboose-cms-0.4.7 app/views/caboose/login/index.html.erb
caboose-cms-0.4.6 app/views/caboose/login/index.html.erb
caboose-cms-0.4.5 app/views/caboose/login/index.html.erb
caboose-cms-0.4.4 app/views/caboose/login/index.html.erb