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

added version info and fixed homepage

This commit is contained in:
fazo96 2014-09-30 09:22:09 +02:00
parent b38370581e
commit 14131b89d9
2 changed files with 10 additions and 8 deletions

View File

@ -1,4 +1,5 @@
# Homework - Client Side # Homework - Client Side
version = "1.1.3"
# Utilities # Utilities
tick = new Deps.Dependency() tick = new Deps.Dependency()
Meteor.setInterval (-> tick.changed();), 15000 Meteor.setInterval (-> tick.changed();), 15000
@ -13,13 +14,18 @@ amIValid = ->
return yes for mail in getUser().emails when mail.verified is yes; no return yes for mail in getUser().emails when mail.verified is yes; no
# Common Helpers for the Templates # Common Helpers for the Templates
UI.registerHelper "version", -> "1.1.2" UI.registerHelper "version", -> version
UI.registerHelper "status", -> Meteor.status() UI.registerHelper "status", -> Meteor.status()
UI.registerHelper "loading", -> Meteor.loggingIn() or !Meteor.status().connected UI.registerHelper "loading", -> Meteor.loggingIn() or !Meteor.status().connected
UI.registerHelper "email", -> UI.registerHelper "email", ->
if getUser() then return getUser().emails[0].address if getUser() then return getUser().emails[0].address
UI.registerHelper "verified", -> amIValid() UI.registerHelper "verified", -> amIValid()
Meteor.startup ->
console.log "Homework version "+version
console.log "This software is Free Software (MIT License)"
console.log "More information at http://github.com/fazo96/homework"
# Router # Router
### ###
Important: 'home' dispatches the user to the correct landing page. Important: 'home' dispatches the user to the correct landing page.
@ -63,10 +69,7 @@ Router.map ->
@route 'home', @route 'home',
path: '/' path: '/'
template: 'homepage' template: 'homepage'
action: -> action: -> @render 'homepage', to: 'outside'
if Meteor.status().connected is no
@render 'reconnect'
else @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()
@ -104,7 +107,6 @@ Router.map ->
else else
showErr type:'success', msg:'Verification complete' showErr type:'success', msg:'Verification complete'
Router.go 'home' Router.go 'home'
@route 'homepage', action: -> @render '404'
@route '404', path: '*' @route '404', path: '*'
# Client Templates # Client Templates

View File

@ -240,7 +240,7 @@
<!-- Footer (used in 'template') --> <!-- Footer (used in 'template') -->
<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</p> <p>Built by Enrico Fasoli (v{{version}})</p>
<div class="links"> <div class="links">
<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>
@ -263,7 +263,7 @@
<template name="homepage"> <template name="homepage">
<div align="center"><i class="fa fa-book fa-5x"></i></div> <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> <p align="center" style="margin-top: 20px" class="lead">A fast, free, organized way to manage your school tasks.</p>
{{#if loading}}{{> loading}} {{/if}} {{#if loading}}{{> loading}}{{/if}}
<div class="row" align="center"> <div class="row" align="center">
<div class="col-sm-4"> <div class="col-sm-4">
<h2><i class="fa fa-code-fork"></i> Free. <h2><i class="fa fa-code-fork"></i> Free.