mirror of
https://github.com/fazo96/markcloud.git
synced 2025-04-08 01:18:37 +02:00
many improvements
This commit is contained in:
parent
af170ef553
commit
0189dec725
@ -9,3 +9,5 @@ mizzao:bootstrap-3
|
|||||||
coffeescript
|
coffeescript
|
||||||
less
|
less
|
||||||
perak:markdown
|
perak:markdown
|
||||||
|
natestrauser:font-awesome
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ minimongo@1.0.3
|
|||||||
mizzao:bootstrap-3@3.2.0_1
|
mizzao:bootstrap-3@3.2.0_1
|
||||||
mobile-status-bar@1.0.0
|
mobile-status-bar@1.0.0
|
||||||
mongo@1.0.6
|
mongo@1.0.6
|
||||||
|
natestrauser:font-awesome@4.2.0
|
||||||
observe-sequence@1.0.2
|
observe-sequence@1.0.2
|
||||||
ordered-dict@1.0.0
|
ordered-dict@1.0.0
|
||||||
perak:markdown@1.0.4
|
perak:markdown@1.0.4
|
||||||
|
@ -4,14 +4,21 @@ Router.configure
|
|||||||
layoutTemplate: 'layout'
|
layoutTemplate: 'layout'
|
||||||
|
|
||||||
Router.map ->
|
Router.map ->
|
||||||
@route 'home', path: '/'
|
@route 'home',
|
||||||
|
path: '/'
|
||||||
|
waitOn: -> Meteor.subscribe 'docs'
|
||||||
@route 'doc',
|
@route 'doc',
|
||||||
path: '/d/:_id'
|
path: '/d/:_id'
|
||||||
layoutTemplate: 'docLayout'
|
layoutTemplate: 'docLayout'
|
||||||
waitOn: -> @docHandle = Meteor.subscribe 'doc', @params._id
|
waitOn: -> @docHandle = Meteor.subscribe 'doc', @params._id
|
||||||
data: -> docs.findOne @params._id
|
data: -> docs.findOne @params._id
|
||||||
|
action: ->
|
||||||
|
if @ready()
|
||||||
|
@render()
|
||||||
|
else @render 'loading'
|
||||||
@route 'new'
|
@route 'new'
|
||||||
|
|
||||||
|
Template.home.ndocs = -> docs.find().count()
|
||||||
Template.new.events
|
Template.new.events
|
||||||
'click #new-btn': (e,t) ->
|
'click #new-btn': (e,t) ->
|
||||||
id = docs.insert
|
id = docs.insert
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
.container {
|
||||||
|
max-width: 40em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#new-btn {
|
||||||
|
margin-top: 1em;
|
||||||
|
}
|
@ -9,13 +9,15 @@
|
|||||||
<template name="home">
|
<template name="home">
|
||||||
<p>This is a demo app. Click <a href="new">here</a> to create a new document.</p>
|
<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>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>
|
||||||
|
|
||||||
<template name="new">
|
<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>
|
<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>
|
<textarea id="editor" class="form-control" rows="10" autofocus></textarea>
|
||||||
<button id="new-btn" class="btn btn-primary">submit</button>
|
<button id="new-btn" class="btn btn-primary">
|
||||||
|
<i class="fa fa-upload"></i> Upload</button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template name="docLayout">
|
<template name="docLayout">
|
||||||
@ -25,5 +27,11 @@
|
|||||||
<template name="doc">
|
<template name="doc">
|
||||||
{{#markdown}}{{text}}{{/markdown}}
|
{{#markdown}}{{text}}{{/markdown}}
|
||||||
<hr>
|
<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>
|
</template>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
docs = new Meteor.Collection 'docs'
|
docs = new Meteor.Collection 'docs'
|
||||||
|
|
||||||
Meteor.publish 'doc', (id) -> docs.find _id: id
|
Meteor.publish 'doc', (id) -> docs.find _id: id
|
||||||
|
Meteor.publish 'docs', -> docs.find()
|
||||||
|
|
||||||
docs.allow
|
docs.allow
|
||||||
insert: -> yes
|
insert: -> yes
|
||||||
|
Loading…
Reference in New Issue
Block a user