1
0
mirror of https://github.com/fazo96/homework.git synced 2025-01-09 12:10:08 +01:00

new homepage and mobile optimizations. (Fixed #11)

This commit is contained in:
fazo96 2014-06-01 15:42:02 +02:00
parent 736d695a68
commit da964a2a10
4 changed files with 67 additions and 13 deletions

View File

@ -1,12 +1,20 @@
# Homework # Homework
Schoolwork management application for students. Schoolwork management application for students. Built using
[Meteor](http://gihub.com/meteor/meteor), a Web App framework on top of Node.js
and MongoDB.
I built this because I felt like the other apps didn't do it very well.
Also, I learnt a lot and had fun!
### Try it ### Try it
[the app is hosted online!](http://homework.meteor.com) [the app is hosted online!](http://homework.meteor.com)
### Development ### Development
Clone the repo, [install meteor](http://meteor.com) and **meteorite**. Clone the repo, [install meteor](http://meteor.com) and **meteorite**.
Install dependent packages and then run `meteor`. That's it. Install dependent packages with `mrt install` and then run `meteor`. That's it.
If you want to send emails (necessary to confirm users) you need to set the
`MAIL_URL` environment variable, or else the emails will be printed on stdout.
### License ### License
The MIT License (MIT) The MIT License (MIT)

View File

@ -33,11 +33,11 @@ Router.configure
Router.map -> Router.map ->
@route 'home', @route 'home',
path: '/' path: '/'
action: -> @render 'homepage', to: 'outside'
onBeforeAction: -> onBeforeAction: ->
# Dispatch user to the right landing page based on his account status # Dispatch user to the right landing page based on his account status
if getUser() if getUser()
if amIValid() is yes then Router.go 'notes' else Router.go 'verifyEmail' if amIValid() is yes then Router.go 'notes' else Router.go 'verifyEmail'
else Router.go 'login'
@route 'login', @route 'login',
onBeforeAction: -> Router.go 'home' if getUser() onBeforeAction: -> Router.go 'home' if getUser()
@route 'register', @route 'register',
@ -61,6 +61,7 @@ Router.map ->
if err if err
errCallback err; Router.go 'verifyEmail' errCallback err; Router.go 'verifyEmail'
else Router.go 'home' else Router.go 'home'
@route 'homepage', action: -> @render '404'
@route '404', path: '*' @route '404', path: '*'
# You can't set a callback for when the user logs in using a cookie so... # You can't set a callback for when the user logs in using a cookie so...

View File

@ -2,4 +2,7 @@
<head> <head>
<title>Homework</title> <title>Homework</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
</head> </head>

View File

@ -7,6 +7,7 @@
<small>management for students</small> <small>management for students</small>
</h1> </h1>
</div> </div>
{{> yield region='outside'}}
<div class="center-block" id="ui-container"> <div class="center-block" id="ui-container">
{{> yield}} {{> yield}}
</div> </div>
@ -83,7 +84,7 @@
<template name="login"> <template name="login">
<div align="center"> <div align="center">
<h3 class="cool-header"><i class="fa fa-sign-in fa-2x"></i><br>Login</h3> <h3 class="cool-header"><i class="fa fa-sign-in fa-2x"></i><br>Sign In</h3>
{{> error}} {{> error}}
{{#if loggingIn}} {{#if loggingIn}}
{{> loading}} {{> loading}}
@ -92,8 +93,12 @@
<input type="password" id="l-pass" class="form-control login in-bt" placeholder="Password"> <input type="password" id="l-pass" class="form-control login in-bt" placeholder="Password">
{{/if}} {{/if}}
{{#unless loggingIn}} {{#unless loggingIn}}
<a role="button" href="{{pathFor 'register'}}" class="btn-fix btn btn-success">Register</a> <a role="button" href="{{pathFor 'register'}}" class="btn-fix btn btn-success">
<a role="button" id="login-btn" class="btn-fix btn btn-primary">Login</a> <i class="fa fa-user"></i> Sign Up</a>
<a role="button" id="login-btn" class="btn-fix btn btn-primary">
Log In</a>
<a role="button" href="{{pathFor 'home'}}" class="btn-fix btn btn-warning">
<i class="fa fa-home"></i> Home</a>
{{/unless}} {{/unless}}
</div> </div>
</template> </template>
@ -109,8 +114,10 @@
<input type="text" id="r-mail" class="form-control register in-bt" placeholder="Email"> <input type="text" id="r-mail" class="form-control register in-bt" placeholder="Email">
<input type="password" id="r-pass" class="form-control register in-bt" placeholder="Password"> <input type="password" id="r-pass" class="form-control register in-bt" placeholder="Password">
<input type="password" id="r-pass-2" class="form-control register pass-rep in-bt" placeholder="Repeat Password"> <input type="password" id="r-pass-2" class="form-control register pass-rep in-bt" placeholder="Repeat Password">
<button type="button" id="register-btn" class="btn-fix btn btn-primary">Create</button> <button type="button" id="register-btn" class="btn-fix btn btn-primary">
<a role="button" href="{{pathFor 'home'}}" class="btn-fix btn btn-success">Home</a> <i class="fa fa-user"></i> Sign Up</button>
<a role="button" href="{{pathFor 'home'}}" class="btn-fix btn btn-success">
<i class="fa fa-home"></i> Home</a>
{{/if}} {{/if}}
</div> </div>
</template> </template>
@ -121,7 +128,7 @@
{{> menu}} {{> menu}}
<div class="btn-group btns-account"> <div class="btn-group btns-account">
<button type="button" id="btn-logout" class="btn btn-warning"> <button type="button" id="btn-logout" class="btn btn-warning">
<i class="fa fa-sign-out fa-inverse"></i> Logout <i class="fa fa-sign-out fa-inverse"></i> Sign Out
</button> </button>
<button type="button" id="btn-delete-me" class="btn btn-danger"> <button type="button" id="btn-delete-me" class="btn btn-danger">
<i class="fa fa-exclamation-circle fa-inverse"></i> Delete <i class="fa fa-exclamation-circle fa-inverse"></i> Delete
@ -141,7 +148,7 @@
<button type="button" class="btn btn-warning btn-ver" id="btn-resend">Resend Email</button> <button type="button" class="btn btn-warning btn-ver" id="btn-resend">Resend Email</button>
<button type="button" class="btn btn-success btn-ver" id="btn-verify">Verify Token</button> <button type="button" class="btn btn-success btn-ver" id="btn-verify">Verify Token</button>
<button type="button" class="btn btn-danger btn-ver" id="btn-delete">Delete Account</button> <button type="button" class="btn btn-danger btn-ver" id="btn-delete">Delete Account</button>
<br><button type="button" class="btn btn-primary btn-ver" id="btn-logout">Logout</button> <br><button type="button" class="btn btn-primary btn-ver" id="btn-logout">Sign Out</button>
</div> </div>
</div> </div>
</template> </template>
@ -180,7 +187,7 @@
<template name="footer"> <template name="footer">
<p>This app is <a href="https://en.wikipedia.org/wiki/Free_software">Free Software</a>, under the <a href="http://opensource.org/licenses/MIT">MIT License</a></p> <p>This app is <a href="https://en.wikipedia.org/wiki/Free_software">Free Software</a>, under the <a href="http://opensource.org/licenses/MIT">MIT License</a></p>
<p>Built by Enrico Fasoli as a prototype.<br><u>Not ready for daily usage yet!</u></p> <p>Built by Enrico Fasoli</p>
<a class="custom-link" href="http://www.linkedin.com/profile/view?id=292450419"><i class="fa fa-linkedin fa-2x"></i></a> <a class="custom-link" href="http://www.linkedin.com/profile/view?id=292450419"><i class="fa fa-linkedin fa-2x"></i></a>
<a href="http://twitter.com/fazo96"><i class="fa fa-twitter fa-2x footer-center-icon"></i></a> <a href="http://twitter.com/fazo96"><i class="fa fa-twitter fa-2x footer-center-icon"></i></a>
<a class="custom-link" href="http://github.com/fazo96"><i class="fa fa-github fa-2x"></i></a> <a class="custom-link" href="http://github.com/fazo96"><i class="fa fa-github fa-2x"></i></a>
@ -188,7 +195,42 @@
<template name="404"> <template name="404">
<div align="center"> <div align="center">
<h2><i class="fa fa-exclamation-triangle fa-2x"></i><br> <h1><i class="fa fa-exclamation-triangle fa-2x"></i><br>
Acciderbolina!<br><small>Page not found</small></h2> 404<br><small>Page not found</small></h1>
<a style="margin-top:15px" role="button" class="btn btn-success" href="{{pathFor 'home'}}">
<i class="fa fa-home"></i> Home
</a>
</div> </div>
</template> </template>
<template name="homepage">
<div align="center"><i class="fa fa-book fa-5x"></i></div>
<p align="center" style="margin-top: 20px" class="lead">A fast, free, organized way to manage your school tasks.</p>
{{#if loggingIn}}{{> loading}} {{/if}}
<div class="row" align="center">
<div class="col-sm-4">
<h2><i class="fa fa-code-fork"></i> Free.
<small>This app is not only <u>free of charge and ads</u>, it's also <b>Free Software</b>.
Anyone can <a href="http://github.com/fazo96/homework">see the code</a> and contribute.
</small></h2>
</div>
<div class="col-sm-4">
<h2><i class="fa fa-check"></i> Simple.
<small>Just what you need: a homework list organized by date. Nothing more, nothing less.</small></h2>
</div>
<div class="col-sm-4">
<h2><i class="fa fa-bolt"></i> Modern.
<small>Works on all modern <u>Mobile</u> and <u>Desktop</u> browsers.
Your password is safe and <u>not</u> stored online.</small></h2></div>
</div>
{{#unless loggingIn}}
<div align="center" style="margin-top:20px;">
<a href="{{pathFor 'login'}}" role="button" class="btn btn-primary">
<i class="fa fa-sign-in"></i> Sign In
</a>
<a href="{{pathFor 'register'}}" role="button" class="btn btn-success">
<i class="fa fa-user"></i> Sign Up
</a>
</div>
{{/unless}}
</template>