Coder Social home page Coder Social logo

ruby-china / homeland Goto Github PK

View Code? Open in Web Editor NEW
3.8K 3.8K 1.2K 28.72 MB

:circus_tent: An open source forum/community system based on Rails, developed based on Ruby China.

Home Page: https://homeland.ruby-china.org

License: MIT License

Ruby 55.49% JavaScript 19.52% HTML 16.75% CSS 0.36% Shell 0.13% Dockerfile 0.10% Makefile 0.06% SCSS 7.59%
community disscusstion forum homeland rails

homeland's Issues

主题列表 API分页功能

目前主题列表API不支持分页,/api/topics/index.json?size=30

我觉得应该给主题列表加上分页,这样方便在客户端上读取更多主题数据。

像这样:
/api/topics/index.json?page=3&per_page=30

@ashchan

这样改了,可能会影响到当前已经使用这个api的客户端。

redirect_to where_i_was after `user#login`

Now:

If I am on a topics#show page, and click the login button and try to login
then I will be redirect_to root_url

Expected:

Bring me back to where I was (aka. topics#show page)

如果回帖内容里面只是下面这些内容的,不允许回复

  • mark
  • 收藏
  • up

以上字典写入 SiteConfig 以便线上可以随时维护。
如回帖内容去掉空白以后等于上面任意一项,那出现 flast[:alert] 提醒,“请勿回复无意义的内容,如你想收藏或赞这篇帖子,请用帖子后面的功能”

增加travis-ci集成测试功能,请参考我的commit

只要ruby-china账号加上travis-ci的key。在加一个.travis.yml就可以了。

xiaods@610531b

效果请看:
https://github.com/xiaods/ruby-china

目前有一个exceptional error. 我建议@huacnlee在review一下。

Failures:

243

244 1) TopicsHelper format_topic_body should right with Chinese neer URL

245 Failure/Error: '<p>此版本并非线上的http://yavaeye.com的源码.</p>'

246 expected: "<p>此版本并非线上的http://yavaeye.com的源码.</p>"

247 got: "<p>此版本并非线上的<a href=\"http://yavaeye.com\" rel=\"nofollow\" target=\"_blank\">http://yavaeye.com</a>的源码.</p>" (using ==)

248 # ./spec/helpers/topics_helper_spec.rb:10:in `block (3 levels) in <top (required)>'

249

250Finished in 35.6 seconds

251294 examples, 1 failure

252

253Failed examples:

254

255rspec ./spec/helpers/topics_helper_spec.rb:6 # TopicsHelper format_topic_body should right with Chinese neer URL

256rake aborted!

TODO: 这行是由于 Redcarpet 的 auto_link 方法转换连起来的会有编码错误

  #  @huacnlee提醒说在某些环境下面,下面测试会Pass。所以有可能在你的测试环境会失败。
  helper.format_topic_body("此版本并非线上的http://yavaeye.com的源码.").should ==
    '<p>此版本并非线上的http://yavaeye.com的源码.</p>'

这个断言上面提醒会auto_link,但expected中确给出不加link的result.我怎么感觉意思不同阿。
这里我们到底想让带连接的一句话返回原文,还是加上链接返回句子

上传Avatar失败。

这个Bug是一位网友反馈的,他上传头像的时候失败,错误信息如下:

第三方应用调用API时需要有一个申请机制

我这些天在思考API的设计时,感觉如果直接开放数据,有泄漏数据和用户隐私的担忧。所以最起码得提供一种申请机制,申请之后,有一个合法的KEY,在调用API时跟上这个KEY。这样可以保证官方的API不会被随意滥用。

忘记密码的邮件发不出

看了下日志和源码,似乎是延时任务出错,反序列化的时候异常。

不过代码太复杂没搞懂怎么修。

重构第三方登录部分的代码

先移除了导致绑定错误的问题之一 01a04f7

目前还有问题:

  1. email 可能为空(已经有空email用户在库里)
  2. user.save(:validate => false) 跳过了校验,可能导致潜在问题
  3. 使用了动态生成方法,其实可以避免

绑定Github有些小问题

绑定Github有些小问题
app/views/account/edit.html.erb
提示应该是一个“点击解除绑定" 一个"点击绑定", 原文是两个“点击解除绑定"

因为那个location问题(http://ruby-china.org/topics/4329 9楼), 会也在解除绑定的时候出错。

另外, 现在解除绑定不能成功,在文件app/controllers/users_controller.rb中, 也要改一下

current_user.authorizations.destroy_all(:conditions => {:provider => provider})

要改为

current_user.authorizations.destroy_all({provider: provider})

参看: http://mongoid.org/en/mongoid/docs/persistence.html

Github issue: #69

评论分页功能

现在很多帖子回复近百或破百。

  1. 帖子打开时非常缓慢,想看最后一条回复要等半天。
  2. 手机上根本不敢打开,坑爹的流量会向火箭一样串上去。
  3. 服务器压力也不小吧?
    So 要不评论分下页呗

修改个人资料报错

新注册用户,在修改完资料(/account/edit),点击“更新资料”后跳转到报错页面(we're sorry, but something ...)。

填写了的表单项包括:email,城市,个人介绍。
其它项留空。

Update: 看情况像是“城市”这一项有时候会触动某些敏感词?

运行 rake spec 出错

我clone出一份 ruby-china 的代码,按照 README 运行命令一切 OK 。包括 rails s 也成功启动了。
_但是当我执行rake spec时,报错了:_

.FFFF.FFF.F.F..FF...........F.......FMarkdownTopicConverter.format ERROR: undefined method 'Py_IsInitialized' for RubyPython::Python:Module
FMarkdownTopicConverter.format ERROR: undefined method 'Py_IsInitialized' for RubyPython::Python:Module
Fruby: markdown.c:2426: sd_markdown_render: Assertion 'md->work_bufs[0].size == 0' failed.

执行
bundle exec rspec spec
也一样报错

我安装了 rubypython

$ gem list | grep python
rubypython (0.5.3)

我的环境

$ ruby -v
ruby 1.9.2p318 (2012-02-14 revision 34678) [i686-linux]

$ rails -v
Rails 3.2.6

$ mongo --version
MongoDB shell version: 2.0.6

$ redis-cli -v
redis-cli 2.4.10

_请各位帮忙分析分析,是不是我少安装了什么东西?_

Large files in repo

发现有一些比较大的, 和项目不相关的文件在里面. 虽然说会改掉所有的commits, 但长痛不如短痛吧.

 2.7M   packages/csft_3.2.13-1_i386.deb (ab1a0ce: 1 year, 4 months ago)
 2.7M   packages/mmseg_3.2.13-1_i386.deb    (ab1a0ce: 1 year, 4 months ago)
 2.3M   coreseek-3.2.13/csft-3.2.13/src/indexer (710437f: 1 year, 6 months ago)
 2.3M   coreseek-3.2.13/csft-3.2.13/src/indextool   (710437f: 1 year, 6 months ago)
 7.2M   coreseek-3.2.13/csft-3.2.13/src/libsphinx.a (710437f: 1 year, 6 months ago)
 2.3M   coreseek-3.2.13/csft-3.2.13/src/search  (710437f: 1 year, 6 months ago)
 2.6M   coreseek-3.2.13/csft-3.2.13/src/searchd (710437f: 1 year, 6 months ago)
 1.6M   coreseek-3.2.13/csft-3.2.13/src/searchd.o   (710437f: 1 year, 6 months ago)
 2.2M   coreseek-3.2.13/csft-3.2.13/src/spelldump   (710437f: 1 year, 6 months ago)
 3.0M   coreseek-3.2.13/csft-3.2.13/src/sphinx.o    (710437f: 1 year, 6 months ago)
 2.2M   coreseek-3.2.13/csft-3.2.13/src/sphinxsort.o    (710437f: 1 year, 6 months ago)
 2.2M   coreseek-3.2.13/csft-3.2.13/src/tests   (710437f: 1 year, 6 months ago)
 3.7M   coreseek-3.2.13/mmseg-3.2.13/data/uni.lib   (710437f: 1 year, 6 months ago)
 1.1M   coreseek-3.2.13/mmseg-3.2.13/data/Lexicon_full_words.txt    (710437f: 1 year, 6 months ago)
 1.8M   coreseek-3.2.13/mmseg-3.2.13/data/unigram.txt   (710437f: 1 year, 6 months ago)
 1.8M   coreseek-3.2.13/mmseg-3.2.13/src/.libs/libmmseg.a   (710437f: 1 year, 6 months ago)

管理员推荐帖子到精品区

由于太多扯淡帖,精品内容容易被掩盖,给帖子实现推荐功能,被推荐的帖子将会出现在精品过滤列表(直接在 默认 / 无人问津 / 最新创建 这个区域增加精品过滤)
仅管理员可推荐,以保证里面出现的内容都是技术讨论的。

需要禁止 Email 修改

目前 Email 修改没有密码存在漏洞,简单点做就禁用 Email 修改吧,这样一来还可以有效防止马甲用户。

@user 错误

回帖的时候输入@跳出来的列表,不能用鼠标选择

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.