Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

More Bootstrapification.

  • Loading branch information...
commit 34872cb3eabbcbbb81a1b1698ad009e3363be9bb 1 parent 23e35ff
@davorg authored
Showing with 80 additions and 38 deletions.
  1. +27 −23 views/layouts/main.tt
  2. +8 −3 views/login.tt
  3. +45 −12 views/register.tt
View
50 views/layouts/main.tt
@@ -1,27 +1,28 @@
<!DOCTYPE html>
<html lang="en">
-<head>
- <meta charset="[% settings.charset %]">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Lystyng</title>
- <link rel="stylesheet" href="[% request.uri_base %]/css/bootstrap.min.css" />
+ <head>
+ <meta charset="[% settings.charset %]">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>Lystyng</title>
+ <link rel="stylesheet" href="[% request.uri_base %]/css/bootstrap.min.css" />
+ <link rel="stylesheet" href="[% request.uri_base %]/css/bootstrap-theme.min.css">
- <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
- <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
- <!--[if lt IE 9]>
+ <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
+ <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
+ <!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
- <![endif]-->
-<script type="text/javascript">/* <![CDATA[ */
+ <![endif]-->
+ <script type="text/javascript">/* <![CDATA[ */
!window.jQuery && document.write('<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.js"><\/script>')
/* ]]> */</script>
- <script src="js/bootstrap.min.js"></script>
-</head>
-<body>
- <div class="container">
+ <script src="js/bootstrap.min.js"></script>
+ </head>
+ <body>
+ <div class="container">
<!-- Static navbar -->
- <div class="navbar navbar-default" role="navigation">
+ <div class="navbar navbar-inverse" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">Lystyng</a>
@@ -29,8 +30,7 @@
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
[% IF session.user -%]
- <li>Welcome [% session.user.name %]</li>
- <li><a href="/logout">Log out</a></li>
+ <li>Welcome [% session.user.name %] <a href="/logout">Log out</a></li>
[% ELSE -%]
<li><a href="/register">Register</a> / <a href="/login">Log in</a></li>
[% END -%]
@@ -38,10 +38,14 @@
</div><!--/.nav-collapse -->
</div><!--/.container-fluid -->
</div>
+ <div class="container">
[% content %]
- <div id="footer">
- Powered by <a href="http://perldancer.org/">Dancer</a> [% dancer_version %]
- </div>
- </div>
-</body>
+ </div>
+
+ <div id="footer">
+ <div class="container">
+ <p class="text-muted">Powered by <a href="http://perldancer.org/">Dancer</a> [% dancer_version %]</p>
+ </div>
+ </div>
+ </body>
</html>
View
11 views/login.tt
@@ -1,9 +1,14 @@
+<div class="col-md-4">
[% IF error -%]
-<p>That username and/or password is incorrect.</p>
+<div class="alert alert-danger fade-in">
+That username and/or password is incorrect.
+<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
+</div>
[% END -%]
<form class="form-signin" role="form" method="post" action="/login">
<h2 class="form-signin-heading">Please sign in</h2>
<input type="text" class="form-control" placeholder="Username" name="username" value="[% params.username %]" required autofocus>
- <input type="password" class="form-control" placeholder="Password" name="passoword" value="[% params.password %]" required>
- <button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
+ <input type="password" class="form-control" placeholder="Password" name="password" value="[% params.password %]" required>
+ <button class="btn btn-primary btn-block" type="submit">Sign in</button>
</form>
+</div>
View
57 views/register.tt
@@ -1,16 +1,49 @@
+<div class="col-md-6">
[% IF errors -%]
-<ul>
+ <div class="alert alert-danger fade-in">
+ <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
+ <ul>
[% FOREACH error IN errors -%]
-<li>[% error %]</li>
+ <li>[% error %]</li>
[% END -%]
+ </ul>
+ </div>
[% END -%]
-<form method="post" action="/register">
-<table>
- <tr><th>Username:</th><td><input name="username" value="[% params.username %]"></td></tr>
- <tr><th>Email:</th><td><input name="email" value="[% params.email %]"></td></tr>
- <tr><th>Name:</th><td><input name="name" value="[% params.name %]"></td></tr>
- <tr><th>Password:</th><td><input name="password" value="[% params.password %]"></td></tr>
- <tr><th>Confirm Password:</th><td><input name="password2" value="[% params.password2 %]"></td></tr>
- <tr><td colspan="2"><input type="submit"></td></tr>
-</table>
-</form>
+ <form role="form" class="form-horizontal">
+ <div class="form-group">
+ <label class="col-md-2 control-label" for="username">Username</label>
+ <div class="col-md-6">
+ <input type="text" class="form-control" id="username" name="username" value="[% params.username %]" placeholder="username">
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="col-md-2 control-label" for="email">Email</label>
+ <div class="col-md-6">
+ <input type="email" class="col-md-4 form-control" id="email" name="email" value="[% params.email %]" placeholder="email">
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="col-md-2 control-label" for="name">Name</label>
+ <div class="col-md-6">
+ <input type="text" class="col-md-4 form-control" id="name" name="name" value="[% params.name %]" placeholder="name">
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="col-md-2 control-label" for="password">Password</label>
+ <div class="col-md-6">
+ <input type="password" class="col-md-4 form-control" id="password" name="password" value="[% params.password %]" placeholder="password">
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="col-md-2 control-label" for="password2">Confirm Password</label>
+ <div class="col-md-6">
+ <input type="password" class="col-md-4 form-control" id="password2" name="password2" value="[% params.password2 %]" placeholder="confirm password">
+ </div>
+ </div>
+ <div class="form-group">
+ <div class="col-md-offset-2 col-md-4">
+ <button type="submit" class="btn btn-primary btn-block">Register</button>
+ </div>
+ </div>
+ </form>
+</div>
Please sign in to comment.
Something went wrong with that request. Please try again.