1
0
mirror of https://github.com/fazo96/markcloud.git synced 2025-01-26 13:34:19 +01:00

bug fixes and improvements

This commit is contained in:
Enrico Fasoli 2014-10-08 21:21:12 +02:00
parent 66f31be280
commit be8309d014
3 changed files with 13 additions and 10 deletions

View File

@ -25,7 +25,8 @@ docController = RouteController.extend
else @render 'loading' else @render 'loading'
loggedOutController = RouteController.extend loggedOutController = RouteController.extend
onBeforeAction: -> if Meteor.user() then Router.go 'profile' onBeforeAction: ->
if Meteor.user() then Router.go 'profile', user: Meteor.user().username
action: -> action: ->
@render() @render()
if Meteor.loggingIn() then @render 'spinner', to: 'outside' if Meteor.loggingIn() then @render 'spinner', to: 'outside'
@ -41,6 +42,9 @@ Router.map ->
@route 'doc', @route 'doc',
path: '/d/:_id' path: '/d/:_id'
controller: docController controller: docController
@route 'userDoc',
path: '/@:owner/:_id'
controller: docController
@route 'src', @route 'src',
path:'/src/:_id' path:'/src/:_id'
controller: docController controller: docController
@ -49,7 +53,8 @@ Router.map ->
template: 'loading' template: 'loading'
onBeforeAction: -> onBeforeAction: ->
Accounts.verifyEmail @params.token, (err) -> 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', @route 'edit',
path: '/edit/:_id' path: '/edit/:_id'
template: 'editor' template: 'editor'
@ -64,12 +69,10 @@ Router.map ->
data: -> Meteor.users.findOne() data: -> Meteor.users.findOne()
onBeforeAction: -> onBeforeAction: ->
if Meteor.user() and !@params.user if Meteor.user() and !@params.user
@params.user = Meteor.user()._id @params.user = Meteor.user().username
action: -> action: ->
console.log @data() if !@ready() or Meteor.loggingIn() then @render 'loading'
if !@data() then @render '404' else if !@data() then @render '404' else @render()
else if @ready() then @render()
else @render 'loading'
@route 'new', template: 'editor' @route 'new', template: 'editor'
@route 'signup', @route 'signup',
controller: loggedOutController controller: loggedOutController

View File

@ -36,9 +36,7 @@
} }
#editor { #editor {
margin-top: 1em; margin-top: 1em;
} margin-bottom: 1em;
#upload {
margin-top: 1em;
} }
// Viewer // Viewer

View File

@ -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}}> <input type="checkbox" id="make-public" {{isPublic}}>
Make document visible on your profile Make document visible on your profile
<textarea id="editor" class="form-control" rows="10" placeholder="Write your markdown :)" autofocus>{{text}}</textarea> <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"> <button id="upload" class="btn btn-primary">
<i class="fa fa-upload"></i> {{#if _id}}Update{{else}}Create{{/if}}</button> <i class="fa fa-upload"></i> {{#if _id}}Update{{else}}Create{{/if}}</button>
</template> </template>