Sha256: 58bc8783ba09b763b20815fcdab3aebf2b91a03a2fdfd5f77fbf5a707c56d789

Contents?: true

Size: 1.94 KB

Versions: 1

Compression:

Stored size: 1.94 KB

Contents

<form action="/login" method="post" id="login-form">
	<h1>Login</h1>
	
	<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' %>
	
	<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 %>

<%= content_for :caboose_css do %>
	<%= stylesheet_link_tag "caboose/login", media: "all" %>
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
caboose-cms-0.3.70 app/views/caboose/login/index.html.erb