-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
加入 Google Calendar 支持,并完成了一个包含前端逻辑的日程页面 #1167
Conversation
建议将其默认设定改为 inactive 的状态,用户可以根据自己的需要开启。 |
样式挺棒的 |
默认设定应该是disable的,我这两天还会继续改进。这其实是我第一次提交 pull request,希望你能帮我 review 一下,谢谢啦。 On Fri, Oct 14, 2016, 2:39 AM Vi [email protected] wrote:
|
@@ -33,6 +33,7 @@ menu: | |||
#about: /about | |||
archives: /archives | |||
tags: /tags | |||
schedule: /schedule |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Menu 这边默认是开启的,这个可以在 template 里面去判断是否 enable,然后显示隐藏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, 好的。我在本地又做了大量优化,但没这两天太忙,没时间拆分支重新 commit,我可能下周再推一个 commit。这个会在下次改过来的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Nice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我看了一下,这个 Menu 的 template 没有对其他的 menu-item 做判断,我觉得判断也有点冗余,我会默认注释掉这个菜单项,但不做逻辑判断了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
请到 http://blog.zealoft.com/schedule/ 查看实际效果 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice,有一些小调整。希望能调整下,Thanks
@@ -47,6 +48,7 @@ menu_icons: | |||
home: home | |||
about: user | |||
categories: th | |||
#schedule: calendar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Menu Icon 不注释没有关系
|
||
{% block title %} {{ __('title.schedule') }} | {{ config.title }} {% endblock %} | ||
|
||
{% block page_class %}page-post-detail{% endblock %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Page class 可以改成 page-calendar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我其实不知道这个是什么,只是个 block name?
# API Documentation: | ||
# https://developers.google.com/google-apps/calendar/v3/reference/events/list | ||
calendar: | ||
enable: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enable 为 false 之后,底下那些字段都可以 不用注释
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, ok. 我忘了把它关掉了。
@@ -33,6 +33,7 @@ menu: | |||
#about: /about | |||
archives: /archives | |||
tags: /tags | |||
schedule: /schedule |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
还有一个问题,就是因为我调用了 Google Calendar API,这导致了国内打开这个页面可能是空白的(仅仅是日程部分)。 |
@@ -3,7 +3,7 @@ | |||
|
|||
{% block title %} {{ __('title.schedule') }} | {{ config.title }} {% endblock %} | |||
|
|||
{% block page_class %}page-post-detail{% endblock %} | |||
{% block page_calendar %}page-post-detail{% endblock %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{% block page_class %}page-calendar{% endblock %}
仅在这个页面调用就没有关系 |
没有问题的话,merge 入 5.1.0 吧~ |
Thanks. Good job. |
关注一下这个功能 |
加入 Google Calendar 支持,并完成了一个包含前端逻辑的日程页面
同关注! |
这个功能暂时处于 broken 的状态,我现在比较忙,没有时间维护。未来可能会重新支持。 |
这是一个可以实时显示一定时间范围内的日程的插件(比如4小时前~24小时后)。
我写了
layout/_scripts/third-party/schedule.swig
这个文件,可以在前端读取一个公开的 Google Calendar,并将一定时间范围内的日程展示在 schedule 页面上。只需要有 Google Calendar 的 api_key 和对应 calendar 的 calendar_id 即可。获取的数据暂时存储在 cal_data 这个变量中,merge 到 master 的时候可以去掉。我没有做美化完全就是个骨架,我相信你对主题更了解,如果你喜欢,你能帮我完成吗?
相关的 API Doc:https://developers.google.com/google-apps/calendar/v3/reference/events/list
获取 API_KEY:https://console.developers.google.com/
如何设置公开的 Google 日历:https://support.google.com/calendar/answer/37083?hl=en
目前的效果

http://blog.zealoft.com/schedule/
TODO: