Skip to content
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

为收费课程添加 collaborator 功能 #517

Closed
billie66 opened this issue Mar 22, 2014 · 11 comments
Closed

为收费课程添加 collaborator 功能 #517

billie66 opened this issue Mar 22, 2014 · 11 comments
Assignees

Comments

@billie66
Copy link
Collaborator

这里的 collaborator 可以免费观看课程,但不可以编辑课程

@billie66 billie66 self-assigned this Mar 22, 2014
@billie66
Copy link
Collaborator Author

当课程作者想为课程添加 collaborator 时,可以根据输入的内容来自动匹配已存在的用户名,只有作者从用户名下拉菜单中选择名字后,然后才能添加 collaborator, 正如 github 的操作流程

@happypeter
Copy link
Owner

真要做成跟 github 一样的效果,那难度就很高了

@billie66
Copy link
Collaborator Author

可以试一下, 自动补全功能很实用呀

@luckyyang
Copy link
Collaborator

能做出来那真不错了

@happypeter
Copy link
Owner

加上这个功能的目的,就是让自己的朋友可以方便的看“收费的课程”,而不用掏钱购买。回头等功能发布了,@billie66 可以写一篇博客说明一下这个功能

@billie66
Copy link
Collaborator Author

值得写博客推荐一下

@luckyyang
Copy link
Collaborator

强烈支持

@billie66
Copy link
Collaborator Author

使用下面这个 gem 可以实现需要的效果

https://github.com/crowdint/rails3-jquery-autocomplete

@billie66
Copy link
Collaborator Author

通过使用 rails3-jquery-autocomplete,完成了这个功能。不过此 gem 有些功能还没有实现,比如说

crowdint/rails3-jquery-autocomplete#216

当没有匹配用户时,会提示 'no existing match' 信息条目,且可以选择,虽然不影响使用但减弱了用户体验。

另外,定制自动补全下拉菜单的显示条目也有些局限,这里的菜单条目只有用户名,而我原本还想添加用户的头像,但在 gem 说明文档中没有找到合适的方法。

如果不使用这个 gem,只是使用 jqueryUi autocomplete 插件的话,可以很灵活的自定制下拉菜单显示条目,下面有个实例

http://jsfiddle.net/QzJzW/

@billie66
Copy link
Collaborator Author

现在所有课程都可以添加协作者,实属没有必要,只为收费课程添加此功能,我还得修改下代码

@billie66
Copy link
Collaborator Author

代码已经部署了,发现 bug 可以另提 issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants