mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-31 23:11:15 +00:00
move routes, comment out gcal until we can get it working
This commit is contained in:
parent
744c14d73f
commit
30b52d392e
3 changed files with 6 additions and 7 deletions
|
|
@ -27,6 +27,6 @@ module.exports.viewHelpers = (view) ->
|
|||
|
||||
view.fn "encodeiCalLink", (uid, apiToken) ->
|
||||
loc = window?.location.origin or process.env.BASE_URL
|
||||
encodeURIComponent "#{loc}/users/#{uid}/tasks.ics?apiToken=#{apiToken}"
|
||||
encodeURIComponent "#{loc}/v1/users/#{uid}/calendar.ics?apiToken=#{apiToken}"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -14,8 +14,7 @@ module.exports = (expressApp, root, derby) ->
|
|||
expressApp.get '/terms', (req, res) ->
|
||||
staticPages.render 'terms', res
|
||||
|
||||
# localhost:3000/users/9/tasks.ics?apiToken=ae164366-f1ad-4a7d-83ef-b1d1085a96b6
|
||||
expressApp.get '/users/:uid/tasks.ics', (req, res, next) ->
|
||||
expressApp.get '/v1/users/:uid/calendar.ics', (req, res) ->
|
||||
{uid} = req.params
|
||||
{apiToken} = req.query
|
||||
|
||||
|
|
@ -23,10 +22,9 @@ module.exports = (expressApp, root, derby) ->
|
|||
# query = model.query('users').withIdAndToken(uid, apiToken)
|
||||
# model.fetch query, (err, result) ->
|
||||
db.collection('users').find({_id:uid, apiToken:apiToken}).toArray (err, result) ->
|
||||
return next(err) if err
|
||||
return res.send(500, err) if err
|
||||
# tasks = result.at(0).get('tasks')
|
||||
tasks = result[0].tasks
|
||||
return next "No tasks found for user #{uid}" unless tasks?
|
||||
tasksWithDates = _.filter tasks, (task) -> !!task.date
|
||||
|
||||
ical = new icalendar.iCalendar()
|
||||
|
|
|
|||
|
|
@ -340,8 +340,9 @@ do a find for the string after "→"
|
|||
{#if _user.history.todos}
|
||||
<a x-bind=click:toggleChart data-toggle-id="todos-chart" data-history-path="_user.history.todos" rel=tooltip title="Progress"><i class=icon-signal></i></a>
|
||||
{/}
|
||||
<a href="/users/{{_user.id}}/tasks.ics?apiToken={{_user.apiToken}}"><img src='/img/calendar_ical.png' title="iCal" alt="iCal" rel=tooltip /></a>
|
||||
<a target="_blank" href="https://www.google.com/calendar/render?cid={{encodeiCalLink(_user.id, _user.apiToken)}}"><img src='/img/calendar_google.png' title="Google Calendar" alt="Googl Calendar" rel=tooltip /></a>
|
||||
<a href="/v1/users/{{_user.id}}/calendar.ics?apiToken={{_user.apiToken}}"><img src='/img/calendar_ical.png' title="iCal" alt="iCal" rel=tooltip /></a>
|
||||
<!-- comment out gcal until we can get it working -->
|
||||
<!-- <a target="_blank" href="https://www.google.com/calendar/render?cid={{encodeiCalLink(_user.id, _user.apiToken)}}"><img src='/img/calendar_google.png' title="Google Calendar" alt="Google Calendar" rel=tooltip /></a>-->
|
||||
</span>
|
||||
<div id="todos-chart" style="display:none;"></div>
|
||||
<ul class="nav nav-tabs">
|
||||
|
|
|
|||
Loading…
Reference in a new issue