mirror of
https://github.com/fazo96/markcloud.git
synced 2025-01-10 11:04:21 +01:00
many improvements
This commit is contained in:
parent
af170ef553
commit
0189dec725
@ -9,3 +9,5 @@ mizzao:bootstrap-3
|
||||
coffeescript
|
||||
less
|
||||
perak:markdown
|
||||
natestrauser:font-awesome
|
||||
|
||||
|
@ -36,6 +36,7 @@ minimongo@1.0.3
|
||||
mizzao:bootstrap-3@3.2.0_1
|
||||
mobile-status-bar@1.0.0
|
||||
mongo@1.0.6
|
||||
natestrauser:font-awesome@4.2.0
|
||||
observe-sequence@1.0.2
|
||||
ordered-dict@1.0.0
|
||||
perak:markdown@1.0.4
|
||||
|
@ -4,14 +4,21 @@ Router.configure
|
||||
layoutTemplate: 'layout'
|
||||
|
||||
Router.map ->
|
||||
@route 'home', path: '/'
|
||||
@route 'home',
|
||||
path: '/'
|
||||
waitOn: -> Meteor.subscribe 'docs'
|
||||
@route 'doc',
|
||||
path: '/d/:_id'
|
||||
layoutTemplate: 'docLayout'
|
||||
waitOn: -> @docHandle = Meteor.subscribe 'doc', @params._id
|
||||
data: -> docs.findOne @params._id
|
||||
action: ->
|
||||
if @ready()
|
||||
@render()
|
||||
else @render 'loading'
|
||||
@route 'new'
|
||||
|
||||
Template.home.ndocs = -> docs.find().count()
|
||||
Template.new.events
|
||||
'click #new-btn': (e,t) ->
|
||||
id = docs.insert
|
||||
|
@ -0,0 +1,7 @@
|
||||
.container {
|
||||
max-width: 40em;
|
||||
}
|
||||
|
||||
#new-btn {
|
||||
margin-top: 1em;
|
||||
}
|
@ -9,13 +9,15 @@
|
||||
<template name="home">
|
||||
<p>This is a demo app. Click <a href="new">here</a> to create a new document.</p>
|
||||
<p>After submitting the document you will be redirected to its permanent link</p>
|
||||
<p>This demo was built by <a href="http://github.com/fazo96">Enrico Fasoli (fazo96)</a> in 45 minutes.</p>
|
||||
<p>There are <b>{{ndocs}}</b> documents in the database</p>
|
||||
<p>This demo was built by <a href="http://github.com/fazo96">Enrico Fasoli (fazo96)</a> in 45 minutes. It's open source, you can find the code <a href="http://github.com/fazo96/markcloud">here</a></p>
|
||||
</template>
|
||||
|
||||
<template name="new">
|
||||
<p>Write your document in <a href="https://help.github.com/articles/github-flavored-markdown/">GitHub Flavored Markdown</a> then submit it with the button. You will be redirected to its permanent link</p>
|
||||
<textarea id="editor" class="form-control"></textarea>
|
||||
<button id="new-btn" class="btn btn-primary">submit</button>
|
||||
<textarea id="editor" class="form-control" rows="10" autofocus></textarea>
|
||||
<button id="new-btn" class="btn btn-primary">
|
||||
<i class="fa fa-upload"></i> Upload</button>
|
||||
</template>
|
||||
|
||||
<template name="docLayout">
|
||||
@ -25,5 +27,11 @@
|
||||
<template name="doc">
|
||||
{{#markdown}}{{text}}{{/markdown}}
|
||||
<hr>
|
||||
<div align="center">Powered by <a href="/">MarkCloud</a></div>
|
||||
<div class="text-center">Powered by <a href="/">MarkCloud</a></div>
|
||||
</template>
|
||||
|
||||
<template name="loading">
|
||||
<div class="text-center">
|
||||
<i class="fa fa-cog fa-spin fa-3x"></i>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -1,6 +1,7 @@
|
||||
docs = new Meteor.Collection 'docs'
|
||||
|
||||
Meteor.publish 'doc', (id) -> docs.find _id: id
|
||||
Meteor.publish 'docs', -> docs.find()
|
||||
|
||||
docs.allow
|
||||
insert: -> yes
|
||||
|
Loading…
Reference in New Issue
Block a user