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.
- checksums.yaml +4 -4
- data/MIT-LICENSE +20 -0
- data/README.md +139 -43
- data/Rakefile +23 -0
- data/app/assets/javascripts/homeland/application.coffee +31 -0
- data/app/assets/javascripts/homeland/bootstrap.min.js +7 -0
- data/{lib/generators/homeland/install/templates/javascripts → app/assets/javascripts/homeland}/jquery.timeago.js +13 -13
- data/app/assets/javascripts/homeland/tether.min.js +1 -0
- data/app/assets/stylesheets/homeland/application.scss +114 -0
- data/app/assets/stylesheets/homeland/bootstrap-theme.scss +165 -0
- data/app/assets/stylesheets/homeland/bootstrap.min.css +5 -0
- data/app/assets/stylesheets/homeland/markdown.scss +13 -0
- data/app/assets/stylesheets/homeland/tether.min.css +1 -0
- data/app/controllers/homeland/application_controller.rb +37 -12
- data/app/controllers/homeland/replies_controller.rb +25 -11
- data/app/controllers/homeland/topics_controller.rb +50 -58
- data/app/helpers/homeland/application_helper.rb +45 -13
- data/app/models/homeland/concerns/markdown_body.rb +17 -0
- data/app/models/homeland/concerns/pagination.rb +14 -0
- data/app/models/homeland/concerns/soft_delete.rb +29 -0
- data/app/models/homeland/concerns/user_methods.rb +23 -0
- data/app/models/homeland/node.rb +10 -25
- data/app/models/homeland/reply.rb +16 -17
- data/app/models/homeland/topic.rb +19 -29
- data/app/views/homeland/replies/_reply.html.erb +35 -0
- data/app/views/homeland/replies/edit.html.erb +17 -27
- data/app/views/homeland/shared/_error_messages.html.erb +2 -4
- data/app/views/homeland/topics/_form.html.erb +21 -24
- data/app/views/homeland/topics/_node_info.html.erb +9 -0
- data/app/views/homeland/topics/_reply_form.html.erb +16 -0
- data/app/views/homeland/topics/_topic.html.erb +17 -26
- data/app/views/homeland/topics/edit.html.erb +6 -10
- data/app/views/homeland/topics/index.html.erb +28 -51
- data/app/views/homeland/topics/new.html.erb +5 -10
- data/app/views/homeland/topics/show.html.erb +16 -89
- data/app/views/layouts/homeland/application.html.erb +42 -0
- data/config/locales/homeland.en.yml +40 -0
- data/config/locales/homeland.zh-CN.yml +8 -0
- data/config/routes.rb +6 -8
- data/db/migrate/20160321125035_create_homeland_nodes.rb +15 -0
- data/db/migrate/20160321125610_create_homeland_topics.rb +25 -0
- data/db/migrate/20160321125920_create_homeland_replies.rb +16 -0
- data/db/migrate/20160322062228_add_reply_to_id_to_replies.rb +7 -0
- data/lib/generators/homeland/controllers_generator.rb +14 -0
- data/lib/generators/homeland/i18n_generator.rb +22 -0
- data/lib/generators/homeland/install_generator.rb +8 -54
- data/lib/generators/homeland/templates/config/initializers/homeland.rb +34 -0
- data/lib/generators/homeland/views_generator.rb +3 -10
- data/lib/homeland.rb +29 -3
- data/lib/homeland/action_view/will_paginate.rb +38 -0
- data/lib/homeland/configuration.rb +66 -0
- data/lib/homeland/engine.rb +4 -27
- data/lib/homeland/markup.rb +17 -0
- data/lib/homeland/markup/base.rb +11 -0
- data/lib/homeland/markup/html.rb +12 -0
- data/lib/homeland/markup/markdown.rb +17 -0
- data/lib/homeland/markup/simple.rb +14 -0
- data/lib/homeland/version.rb +3 -0
- data/lib/tasks/homeland_tasks.rake +4 -0
- metadata +119 -38
- data/Changelogs.md +0 -29
- data/app/assets/images/reply.png +0 -0
- data/app/assets/javascripts/homeland.coffee +0 -51
- data/app/assets/stylesheets/homeland.scss +0 -100
- data/app/helpers/homeland/topics_helper.rb +0 -14
- data/app/models/homeland/section.rb +0 -21
- data/app/views/homeland/topics/_base.html.erb +0 -4
- data/app/views/homeland/topics/_sidebar.html.erb +0 -49
- data/app/views/homeland/topics/feed.builder +0 -20
- data/lib/generators/homeland/install/templates/images/jquery.chosen.png +0 -0
- data/lib/generators/homeland/install/templates/initializer.rb +0 -8
- data/lib/generators/homeland/install/templates/javascripts/jquery.chosen.js +0 -898
- data/lib/generators/homeland/install/templates/javascripts/jquery.hotkeys.js +0 -99
- data/lib/generators/homeland/install/templates/locales/homeland.zh-CN.yml +0 -14
- data/lib/generators/homeland/install/templates/stylesheets/jquery.chosen.scss +0 -367
- data/lib/homeland/setting.rb +0 -37
data/lib/homeland/setting.rb
DELETED
@@ -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
|