homeland 0.0.9 → 1.0.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +139 -43
  4. data/Rakefile +23 -0
  5. data/app/assets/javascripts/homeland/application.coffee +31 -0
  6. data/app/assets/javascripts/homeland/bootstrap.min.js +7 -0
  7. data/{lib/generators/homeland/install/templates/javascripts → app/assets/javascripts/homeland}/jquery.timeago.js +13 -13
  8. data/app/assets/javascripts/homeland/tether.min.js +1 -0
  9. data/app/assets/stylesheets/homeland/application.scss +114 -0
  10. data/app/assets/stylesheets/homeland/bootstrap-theme.scss +165 -0
  11. data/app/assets/stylesheets/homeland/bootstrap.min.css +5 -0
  12. data/app/assets/stylesheets/homeland/markdown.scss +13 -0
  13. data/app/assets/stylesheets/homeland/tether.min.css +1 -0
  14. data/app/controllers/homeland/application_controller.rb +37 -12
  15. data/app/controllers/homeland/replies_controller.rb +25 -11
  16. data/app/controllers/homeland/topics_controller.rb +50 -58
  17. data/app/helpers/homeland/application_helper.rb +45 -13
  18. data/app/models/homeland/concerns/markdown_body.rb +17 -0
  19. data/app/models/homeland/concerns/pagination.rb +14 -0
  20. data/app/models/homeland/concerns/soft_delete.rb +29 -0
  21. data/app/models/homeland/concerns/user_methods.rb +23 -0
  22. data/app/models/homeland/node.rb +10 -25
  23. data/app/models/homeland/reply.rb +16 -17
  24. data/app/models/homeland/topic.rb +19 -29
  25. data/app/views/homeland/replies/_reply.html.erb +35 -0
  26. data/app/views/homeland/replies/edit.html.erb +17 -27
  27. data/app/views/homeland/shared/_error_messages.html.erb +2 -4
  28. data/app/views/homeland/topics/_form.html.erb +21 -24
  29. data/app/views/homeland/topics/_node_info.html.erb +9 -0
  30. data/app/views/homeland/topics/_reply_form.html.erb +16 -0
  31. data/app/views/homeland/topics/_topic.html.erb +17 -26
  32. data/app/views/homeland/topics/edit.html.erb +6 -10
  33. data/app/views/homeland/topics/index.html.erb +28 -51
  34. data/app/views/homeland/topics/new.html.erb +5 -10
  35. data/app/views/homeland/topics/show.html.erb +16 -89
  36. data/app/views/layouts/homeland/application.html.erb +42 -0
  37. data/config/locales/homeland.en.yml +40 -0
  38. data/config/locales/homeland.zh-CN.yml +8 -0
  39. data/config/routes.rb +6 -8
  40. data/db/migrate/20160321125035_create_homeland_nodes.rb +15 -0
  41. data/db/migrate/20160321125610_create_homeland_topics.rb +25 -0
  42. data/db/migrate/20160321125920_create_homeland_replies.rb +16 -0
  43. data/db/migrate/20160322062228_add_reply_to_id_to_replies.rb +7 -0
  44. data/lib/generators/homeland/controllers_generator.rb +14 -0
  45. data/lib/generators/homeland/i18n_generator.rb +22 -0
  46. data/lib/generators/homeland/install_generator.rb +8 -54
  47. data/lib/generators/homeland/templates/config/initializers/homeland.rb +34 -0
  48. data/lib/generators/homeland/views_generator.rb +3 -10
  49. data/lib/homeland.rb +29 -3
  50. data/lib/homeland/action_view/will_paginate.rb +38 -0
  51. data/lib/homeland/configuration.rb +66 -0
  52. data/lib/homeland/engine.rb +4 -27
  53. data/lib/homeland/markup.rb +17 -0
  54. data/lib/homeland/markup/base.rb +11 -0
  55. data/lib/homeland/markup/html.rb +12 -0
  56. data/lib/homeland/markup/markdown.rb +17 -0
  57. data/lib/homeland/markup/simple.rb +14 -0
  58. data/lib/homeland/version.rb +3 -0
  59. data/lib/tasks/homeland_tasks.rake +4 -0
  60. metadata +119 -38
  61. data/Changelogs.md +0 -29
  62. data/app/assets/images/reply.png +0 -0
  63. data/app/assets/javascripts/homeland.coffee +0 -51
  64. data/app/assets/stylesheets/homeland.scss +0 -100
  65. data/app/helpers/homeland/topics_helper.rb +0 -14
  66. data/app/models/homeland/section.rb +0 -21
  67. data/app/views/homeland/topics/_base.html.erb +0 -4
  68. data/app/views/homeland/topics/_sidebar.html.erb +0 -49
  69. data/app/views/homeland/topics/feed.builder +0 -20
  70. data/lib/generators/homeland/install/templates/images/jquery.chosen.png +0 -0
  71. data/lib/generators/homeland/install/templates/initializer.rb +0 -8
  72. data/lib/generators/homeland/install/templates/javascripts/jquery.chosen.js +0 -898
  73. data/lib/generators/homeland/install/templates/javascripts/jquery.hotkeys.js +0 -99
  74. data/lib/generators/homeland/install/templates/locales/homeland.zh-CN.yml +0 -14
  75. data/lib/generators/homeland/install/templates/stylesheets/jquery.chosen.scss +0 -367
  76. data/lib/homeland/setting.rb +0 -37
@@ -1,37 +0,0 @@
1
- # coding: utf-8
2
- require 'active_support/core_ext/kernel/singleton_class'
3
-
4
- module Homeland
5
- mattr_accessor :app_name, :per_page, :user_class, :current_user_method, :require_user_method,
6
- :user_path_method, :user_avatar_method
7
-
8
- class << self
9
- def app_name
10
- @@app_name || "Forum"
11
- end
12
-
13
- def per_page
14
- @@per_page || 20
15
- end
16
-
17
- def user_class
18
- (@@user_class || "User").constantize
19
- end
20
-
21
- def current_user_method
22
- @@current_user_method || "current_user"
23
- end
24
-
25
- def require_user_method
26
- @@require_user_method || "require_user"
27
- end
28
-
29
- def user_path_method
30
- @@user_path_method || "user_path"
31
- end
32
-
33
- def user_avatar_method
34
- @@user_avatar_method || "avatar"
35
- end
36
- end
37
- end