mirror of
https://github.com/fazo96/markcloud.git
synced 2025-01-24 13:14:21 +01:00
bug fixes and improvements
This commit is contained in:
parent
66f31be280
commit
be8309d014
@ -25,7 +25,8 @@ docController = RouteController.extend
|
||||
else @render 'loading'
|
||||
|
||||
loggedOutController = RouteController.extend
|
||||
onBeforeAction: -> if Meteor.user() then Router.go 'profile'
|
||||
onBeforeAction: ->
|
||||
if Meteor.user() then Router.go 'profile', user: Meteor.user().username
|
||||
action: ->
|
||||
@render()
|
||||
if Meteor.loggingIn() then @render 'spinner', to: 'outside'
|
||||
@ -41,6 +42,9 @@ Router.map ->
|
||||
@route 'doc',
|
||||
path: '/d/:_id'
|
||||
controller: docController
|
||||
@route 'userDoc',
|
||||
path: '/@:owner/:_id'
|
||||
controller: docController
|
||||
@route 'src',
|
||||
path:'/src/:_id'
|
||||
controller: docController
|
||||
@ -49,7 +53,8 @@ Router.map ->
|
||||
template: 'loading'
|
||||
onBeforeAction: ->
|
||||
Accounts.verifyEmail @params.token, (err) ->
|
||||
if err then errCallback err else Router.go 'profile'
|
||||
if err then errCallback err
|
||||
else Router.go 'profile', user: Meteor.user().username
|
||||
@route 'edit',
|
||||
path: '/edit/:_id'
|
||||
template: 'editor'
|
||||
@ -64,12 +69,10 @@ Router.map ->
|
||||
data: -> Meteor.users.findOne()
|
||||
onBeforeAction: ->
|
||||
if Meteor.user() and !@params.user
|
||||
@params.user = Meteor.user()._id
|
||||
@params.user = Meteor.user().username
|
||||
action: ->
|
||||
console.log @data()
|
||||
if !@data() then @render '404'
|
||||
else if @ready() then @render()
|
||||
else @render 'loading'
|
||||
if !@ready() or Meteor.loggingIn() then @render 'loading'
|
||||
else if !@data() then @render '404' else @render()
|
||||
@route 'new', template: 'editor'
|
||||
@route 'signup',
|
||||
controller: loggedOutController
|
||||
|
@ -36,9 +36,7 @@
|
||||
}
|
||||
#editor {
|
||||
margin-top: 1em;
|
||||
}
|
||||
#upload {
|
||||
margin-top: 1em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
// Viewer
|
||||
|
@ -94,6 +94,8 @@ You will be able to delete your account and all your data whenever you want.
|
||||
<input type="checkbox" id="make-public" {{isPublic}}>
|
||||
Make document visible on your profile
|
||||
<textarea id="editor" class="form-control" rows="10" placeholder="Write your markdown :)" autofocus>{{text}}</textarea>
|
||||
<p>Remember that this app is still in development so you should keep a backup
|
||||
of your text somewhere else in case something goes wrong!</p>
|
||||
<button id="upload" class="btn btn-primary">
|
||||
<i class="fa fa-upload"></i> {{#if _id}}Update{{else}}Create{{/if}}</button>
|
||||
</template>
|
||||
|
Loading…
Reference in New Issue
Block a user