cornerstone 0.0.1 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -0
- data/.rspec +1 -0
- data/Gemfile +23 -0
- data/Gemfile.lock +168 -0
- data/Guardfile +22 -0
- data/README.rdoc +4 -1
- data/Rakefile +11 -1
- data/TODO +11 -0
- data/VERSION +1 -0
- data/app/assets/images/.gitkeep +0 -0
- data/app/assets/javascripts/.gitkeep +0 -0
- data/app/assets/javascripts/cornerstone.js +11 -0
- data/app/assets/javascripts/cornerstone/discussions.js +2 -0
- data/app/assets/javascripts/cornerstone/help.js +2 -0
- data/app/assets/stylesheets/.gitkeep +0 -0
- data/app/assets/stylesheets/cornerstone.css +8 -0
- data/app/assets/stylesheets/cornerstone/discussions.css +4 -0
- data/app/assets/stylesheets/cornerstone/help.css +4 -0
- data/app/controllers/.gitkeep +0 -0
- data/app/controllers/cornerstone/admin/application_controller.rb +7 -0
- data/app/controllers/cornerstone/admin/articles_controller.rb +61 -0
- data/app/controllers/cornerstone/admin/categories_controller.rb +46 -0
- data/app/controllers/cornerstone/admin/discussions_controller.rb +32 -0
- data/app/controllers/cornerstone/application_controller.rb +6 -0
- data/app/controllers/cornerstone/discussions_controller.rb +58 -0
- data/app/controllers/cornerstone/help_controller.rb +11 -0
- data/app/controllers/cornerstone/posts_controller.rb +66 -0
- data/app/helpers/.gitkeep +0 -0
- data/app/helpers/cornerstone/application_helper.rb +5 -0
- data/app/helpers/cornerstone/discussions_helper.rb +16 -0
- data/app/helpers/cornerstone/help_helper.rb +4 -0
- data/app/mailers/cornerstone/cornerstone_mailer.rb +31 -0
- data/app/models/.gitkeep +0 -0
- data/app/models/cornerstone/article.rb +20 -0
- data/app/models/cornerstone/category.rb +45 -0
- data/app/models/cornerstone/discussion.rb +90 -0
- data/app/models/cornerstone/post.rb +103 -0
- data/app/models/cornerstone/post_observer.rb +23 -0
- data/app/views/.gitkeep +0 -0
- data/app/views/cornerstone/admin/articles/_article.html.erb +9 -0
- data/app/views/cornerstone/admin/articles/_form.html.erb +22 -0
- data/app/views/cornerstone/admin/articles/edit.html.erb +7 -0
- data/app/views/cornerstone/admin/articles/index.html.erb +25 -0
- data/app/views/cornerstone/admin/articles/new.html.erb +6 -0
- data/app/views/cornerstone/admin/articles/show.html.erb +4 -0
- data/app/views/cornerstone/admin/categories/_category.html.erb +12 -0
- data/app/views/cornerstone/admin/categories/_form.html.erb +17 -0
- data/app/views/cornerstone/admin/categories/edit.html.erb +6 -0
- data/app/views/cornerstone/admin/categories/index.html.erb +11 -0
- data/app/views/cornerstone/admin/categories/new.html.erb +6 -0
- data/app/views/cornerstone/admin/discussions/edit.html.erb +7 -0
- data/app/views/cornerstone/cornerstone_mailer/new_discussion.html.erb +14 -0
- data/app/views/cornerstone/cornerstone_mailer/new_discussion.text.erb +5 -0
- data/app/views/cornerstone/cornerstone_mailer/new_discussion_user.html.erb +7 -0
- data/app/views/cornerstone/cornerstone_mailer/new_post.html.erb +7 -0
- data/app/views/cornerstone/cornerstone_mailer/new_post.text.erb +8 -0
- data/app/views/cornerstone/discussions/_discussion.html.erb +12 -0
- data/app/views/cornerstone/discussions/_discussion_category.html.erb +14 -0
- data/app/views/cornerstone/discussions/_form.html.erb +33 -0
- data/app/views/cornerstone/discussions/_latest_discussion.html.erb +4 -0
- data/app/views/cornerstone/discussions/categorical_index.html.erb +27 -0
- data/app/views/cornerstone/discussions/index.html.erb +25 -0
- data/app/views/cornerstone/discussions/new.html.erb +6 -0
- data/app/views/cornerstone/discussions/show.html.erb +19 -0
- data/app/views/cornerstone/help/index.html.erb +7 -0
- data/app/views/cornerstone/posts/_fields.html.erb +44 -0
- data/app/views/cornerstone/posts/_form.html.erb +19 -0
- data/app/views/cornerstone/posts/_post.html.erb +17 -0
- data/app/views/cornerstone/posts/edit.html.erb +9 -0
- data/app/views/cornerstone/shared/_errors.html.erb +11 -0
- data/app/views/cornerstone/shared/_flash_messages.html.erb +15 -0
- data/app/views/layouts/cornerstone/application.html.erb +16 -0
- data/config/cucumber.yml +8 -0
- data/config/locales/cornerstone.action_mailer.en.yml +9 -0
- data/config/routes.rb +24 -0
- data/cornerstone-0.0.1.gem +0 -0
- data/cornerstone.gemspec +33 -0
- data/db/migrate/20110723004024_create_cornerstone_discussions.rb +17 -0
- data/db/migrate/20110804190853_create_cornerstone_categories.rb +15 -0
- data/db/migrate/20110809233551_create_cornerstone_posts.rb +13 -0
- data/db/migrate/20111006172857_create_cornerstone_articles.rb +12 -0
- data/lib/cornerstone.rb +6 -0
- data/lib/cornerstone/acts_as_cornerstone_user.rb +79 -0
- data/lib/cornerstone/config.rb +33 -0
- data/lib/cornerstone/controller_additions.rb +25 -0
- data/lib/cornerstone/engine.rb +8 -1
- data/lib/cornerstone/exceptions.rb +16 -0
- data/lib/cornerstone/helpers.rb +35 -0
- data/lib/tasks/cucumber.rake +65 -0
- data/lib/templates/cornerstone_config.rb +31 -0
- data/script/cucumber +10 -0
- data/script/rails +7 -0
- data/spec/controllers/cornerstone/admin/articles_controller_spec.rb +250 -0
- data/spec/controllers/cornerstone/admin/categories_controller_spec.rb +205 -0
- data/spec/controllers/cornerstone/admin/discussions_controller_spec.rb +95 -0
- data/spec/controllers/cornerstone/application_controller_spec.rb +34 -0
- data/spec/controllers/cornerstone/discussions_controller_spec.rb +157 -0
- data/spec/controllers/cornerstone/help_controller_spec.rb +20 -0
- data/spec/controllers/cornerstone/posts_controller_spec.rb +212 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +9 -0
- data/spec/dummy/app/assets/javascripts/tester.js +2 -0
- data/spec/dummy/app/assets/stylesheets/application.css +7 -0
- data/spec/dummy/app/assets/stylesheets/tester.css +4 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/controllers/tester_controller.rb +7 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/helpers/tester_helper.rb +6 -0
- data/spec/dummy/app/mailers/.gitkeep +0 -0
- data/spec/dummy/app/models/.gitkeep +0 -0
- data/spec/dummy/app/models/user.rb +23 -0
- data/spec/dummy/app/views/devise/confirmations/new.html.erb +12 -0
- data/spec/dummy/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/spec/dummy/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/spec/dummy/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/spec/dummy/app/views/devise/passwords/edit.html.erb +16 -0
- data/spec/dummy/app/views/devise/passwords/new.html.erb +12 -0
- data/spec/dummy/app/views/devise/registrations/edit.html.erb +29 -0
- data/spec/dummy/app/views/devise/registrations/new.html.erb +22 -0
- data/spec/dummy/app/views/devise/sessions/new.html.erb +19 -0
- data/spec/dummy/app/views/devise/shared/_links.erb +25 -0
- data/spec/dummy/app/views/devise/unlocks/new.html.erb +12 -0
- data/spec/dummy/app/views/layouts/application.html.erb +15 -0
- data/spec/dummy/app/views/tester/index.html.erb +14 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +42 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +28 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +31 -0
- data/spec/dummy/config/environments/production.rb +54 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cornerstone_config.rb +30 -0
- data/spec/dummy/config/initializers/devise.rb +204 -0
- data/spec/dummy/config/initializers/inflections.rb +10 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +12 -0
- data/spec/dummy/config/locales/devise.en.yml +53 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +65 -0
- data/spec/dummy/db/migrate/20110724011421_create_user.rb +11 -0
- data/spec/dummy/db/migrate/20110724194307_devise_create_users.rb +41 -0
- data/spec/dummy/db/migrate/20110804174004_add_name_to_user.rb +5 -0
- data/spec/dummy/db/schema.rb +76 -0
- data/spec/dummy/log/.gitkeep +0 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +26 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/dummy/test/functional/tester_controller_test.rb +9 -0
- data/spec/dummy/test/unit/helpers/tester_helper_test.rb +4 -0
- data/spec/fixtures/cornerstone/cornerstone_mailer/new_discussion +3 -0
- data/spec/lib/cornerstone/acts_as_cornerstone_user_spec.rb +56 -0
- data/spec/lib/cornerstone/helpers_spec.rb +32 -0
- data/spec/mailers/cornerstone/cornerstone_mailer_spec.rb +55 -0
- data/spec/models/cornerstone/article_spec.rb +25 -0
- data/spec/models/cornerstone/category_spec.rb +97 -0
- data/spec/models/cornerstone/discussion_spec.rb +243 -0
- data/spec/models/cornerstone/post_observer_spec.rb +65 -0
- data/spec/models/cornerstone/post_spec.rb +210 -0
- data/spec/requests/emails_spec.rb +51 -0
- data/spec/requests/interact_discussions_spec.rb +103 -0
- data/spec/requests/manage_articles_spec.rb +59 -0
- data/spec/requests/manage_categories_spec.rb +64 -0
- data/spec/requests/view_home_spec.rb +26 -0
- data/spec/spec_helper.rb +40 -0
- data/spec/support/devise.rb +4 -0
- data/spec/support/factories.rb +62 -0
- data/spec/support/general_helper_methods.rb +20 -0
- data/spec/support/mailer_macros.rb +15 -0
- data/spec/support/mass_assignment.rb +46 -0
- data/tmp/log/development.log +0 -0
- metadata +301 -20
data/.gitignore
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--colour
|
data/Gemfile
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
|
3
|
+
gemspec
|
4
|
+
|
5
|
+
#gem 'rails', '3.1.0.rc4'
|
6
|
+
|
7
|
+
# Bundle edge Rails instead:
|
8
|
+
#gem 'rails', :git => 'git://github.com/rails/rails.git',
|
9
|
+
# :branch => '3-1-stable'
|
10
|
+
|
11
|
+
|
12
|
+
# must be stated here for dummy app
|
13
|
+
# can not state in dev. group or as dev_dependency in gemspec
|
14
|
+
gem "jquery-rails"
|
15
|
+
|
16
|
+
|
17
|
+
if RUBY_VERSION < '1.9'
|
18
|
+
gem "ruby-debug", ">= 0.10.3"
|
19
|
+
end
|
20
|
+
|
21
|
+
group :development, :test do
|
22
|
+
end
|
23
|
+
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,168 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
cornerstone (0.0.1)
|
5
|
+
i18n
|
6
|
+
rails (>= 3.1.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: http://rubygems.org/
|
10
|
+
specs:
|
11
|
+
actionmailer (3.1.0)
|
12
|
+
actionpack (= 3.1.0)
|
13
|
+
mail (~> 2.3.0)
|
14
|
+
actionpack (3.1.0)
|
15
|
+
activemodel (= 3.1.0)
|
16
|
+
activesupport (= 3.1.0)
|
17
|
+
builder (~> 3.0.0)
|
18
|
+
erubis (~> 2.7.0)
|
19
|
+
i18n (~> 0.6)
|
20
|
+
rack (~> 1.3.2)
|
21
|
+
rack-cache (~> 1.0.3)
|
22
|
+
rack-mount (~> 0.8.2)
|
23
|
+
rack-test (~> 0.6.1)
|
24
|
+
sprockets (~> 2.0.0)
|
25
|
+
activemodel (3.1.0)
|
26
|
+
activesupport (= 3.1.0)
|
27
|
+
bcrypt-ruby (~> 3.0.0)
|
28
|
+
builder (~> 3.0.0)
|
29
|
+
i18n (~> 0.6)
|
30
|
+
activerecord (3.1.0)
|
31
|
+
activemodel (= 3.1.0)
|
32
|
+
activesupport (= 3.1.0)
|
33
|
+
arel (~> 2.2.1)
|
34
|
+
tzinfo (~> 0.3.29)
|
35
|
+
activeresource (3.1.0)
|
36
|
+
activemodel (= 3.1.0)
|
37
|
+
activesupport (= 3.1.0)
|
38
|
+
activesupport (3.1.0)
|
39
|
+
multi_json (~> 1.0)
|
40
|
+
addressable (2.2.6)
|
41
|
+
arel (2.2.1)
|
42
|
+
bcrypt-ruby (3.0.1)
|
43
|
+
builder (3.0.0)
|
44
|
+
capybara (1.1.1)
|
45
|
+
mime-types (>= 1.16)
|
46
|
+
nokogiri (>= 1.3.3)
|
47
|
+
rack (>= 1.0.0)
|
48
|
+
rack-test (>= 0.5.4)
|
49
|
+
selenium-webdriver (~> 2.0)
|
50
|
+
xpath (~> 0.1.4)
|
51
|
+
childprocess (0.2.2)
|
52
|
+
ffi (~> 1.0.6)
|
53
|
+
database_cleaner (0.6.7)
|
54
|
+
devise (1.4.7)
|
55
|
+
bcrypt-ruby (~> 3.0)
|
56
|
+
orm_adapter (~> 0.0.3)
|
57
|
+
warden (~> 1.0.3)
|
58
|
+
diff-lcs (1.1.3)
|
59
|
+
erubis (2.7.0)
|
60
|
+
factory_girl (2.1.2)
|
61
|
+
activesupport
|
62
|
+
factory_girl_rails (1.2.0)
|
63
|
+
factory_girl (~> 2.1.0)
|
64
|
+
railties (>= 3.0.0)
|
65
|
+
ffi (1.0.9)
|
66
|
+
guard (0.8.8)
|
67
|
+
thor (~> 0.14.6)
|
68
|
+
guard-rspec (0.5.5)
|
69
|
+
guard (>= 0.8.4)
|
70
|
+
hike (1.2.1)
|
71
|
+
i18n (0.6.0)
|
72
|
+
jquery-rails (1.0.14)
|
73
|
+
railties (~> 3.0)
|
74
|
+
thor (~> 0.14)
|
75
|
+
json_pure (1.6.1)
|
76
|
+
launchy (2.0.5)
|
77
|
+
addressable (~> 2.2.6)
|
78
|
+
libnotify (0.5.9)
|
79
|
+
ffi (~> 1.0.0)
|
80
|
+
mail (2.3.0)
|
81
|
+
i18n (>= 0.4.0)
|
82
|
+
mime-types (~> 1.16)
|
83
|
+
treetop (~> 1.4.8)
|
84
|
+
mime-types (1.16)
|
85
|
+
multi_json (1.0.3)
|
86
|
+
nokogiri (1.5.0)
|
87
|
+
orm_adapter (0.0.5)
|
88
|
+
polyglot (0.3.2)
|
89
|
+
rack (1.3.4)
|
90
|
+
rack-cache (1.0.3)
|
91
|
+
rack (>= 0.4)
|
92
|
+
rack-mount (0.8.3)
|
93
|
+
rack (>= 1.0.0)
|
94
|
+
rack-ssl (1.3.2)
|
95
|
+
rack
|
96
|
+
rack-test (0.6.1)
|
97
|
+
rack (>= 1.0)
|
98
|
+
rails (3.1.0)
|
99
|
+
actionmailer (= 3.1.0)
|
100
|
+
actionpack (= 3.1.0)
|
101
|
+
activerecord (= 3.1.0)
|
102
|
+
activeresource (= 3.1.0)
|
103
|
+
activesupport (= 3.1.0)
|
104
|
+
bundler (~> 1.0)
|
105
|
+
railties (= 3.1.0)
|
106
|
+
railties (3.1.0)
|
107
|
+
actionpack (= 3.1.0)
|
108
|
+
activesupport (= 3.1.0)
|
109
|
+
rack-ssl (~> 1.3.2)
|
110
|
+
rake (>= 0.8.7)
|
111
|
+
rdoc (~> 3.4)
|
112
|
+
thor (~> 0.14.6)
|
113
|
+
rake (0.9.2)
|
114
|
+
rb-inotify (0.8.8)
|
115
|
+
ffi (>= 0.5.0)
|
116
|
+
rdoc (3.9.4)
|
117
|
+
rspec (2.6.0)
|
118
|
+
rspec-core (~> 2.6.0)
|
119
|
+
rspec-expectations (~> 2.6.0)
|
120
|
+
rspec-mocks (~> 2.6.0)
|
121
|
+
rspec-core (2.6.4)
|
122
|
+
rspec-expectations (2.6.0)
|
123
|
+
diff-lcs (~> 1.1.2)
|
124
|
+
rspec-mocks (2.6.0)
|
125
|
+
rspec-rails (2.6.1)
|
126
|
+
actionpack (~> 3.0)
|
127
|
+
activesupport (~> 3.0)
|
128
|
+
railties (~> 3.0)
|
129
|
+
rspec (~> 2.6.0)
|
130
|
+
rubyzip (0.9.4)
|
131
|
+
selenium-webdriver (2.8.0)
|
132
|
+
childprocess (>= 0.2.1)
|
133
|
+
ffi (>= 1.0.7)
|
134
|
+
json_pure
|
135
|
+
rubyzip
|
136
|
+
sprockets (2.0.2)
|
137
|
+
hike (~> 1.2)
|
138
|
+
rack (~> 1.0)
|
139
|
+
tilt (~> 1.1, != 1.3.0)
|
140
|
+
sqlite3 (1.3.4)
|
141
|
+
thor (0.14.6)
|
142
|
+
tilt (1.3.3)
|
143
|
+
treetop (1.4.10)
|
144
|
+
polyglot
|
145
|
+
polyglot (>= 0.3.1)
|
146
|
+
tzinfo (0.3.30)
|
147
|
+
warden (1.0.5)
|
148
|
+
rack (>= 1.0)
|
149
|
+
xpath (0.1.4)
|
150
|
+
nokogiri (~> 1.3)
|
151
|
+
|
152
|
+
PLATFORMS
|
153
|
+
ruby
|
154
|
+
|
155
|
+
DEPENDENCIES
|
156
|
+
bundler (~> 1.0.0)
|
157
|
+
capybara
|
158
|
+
cornerstone!
|
159
|
+
database_cleaner
|
160
|
+
devise
|
161
|
+
factory_girl_rails
|
162
|
+
guard-rspec
|
163
|
+
jquery-rails
|
164
|
+
launchy
|
165
|
+
libnotify
|
166
|
+
rb-inotify
|
167
|
+
rspec-rails
|
168
|
+
sqlite3
|
data/Guardfile
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
guard 'rspec', :version => 2 do
|
5
|
+
watch(%r{^spec/.+_spec\.rb$})
|
6
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
7
|
+
watch('spec/spec_helper.rb') { "spec" }
|
8
|
+
|
9
|
+
# Rails example
|
10
|
+
watch(%r{^spec/.+_spec\.rb$})
|
11
|
+
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
12
|
+
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
|
13
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
14
|
+
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
|
15
|
+
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
|
16
|
+
watch('spec/spec_helper.rb') { "spec" }
|
17
|
+
watch('config/routes.rb') { "spec/routing" }
|
18
|
+
watch('app/controllers/application_controller.rb') { "spec/controllers" }
|
19
|
+
# Capybara request specs
|
20
|
+
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
|
21
|
+
end
|
22
|
+
|
data/README.rdoc
CHANGED
data/Rakefile
CHANGED
@@ -20,7 +20,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
20
20
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
21
21
|
end
|
22
22
|
|
23
|
-
APP_RAKEFILE = File.expand_path("../
|
23
|
+
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
24
24
|
load 'rails/tasks/engine.rake'
|
25
25
|
|
26
26
|
require 'rake/testtask'
|
@@ -34,3 +34,13 @@ end
|
|
34
34
|
|
35
35
|
|
36
36
|
task :default => :test
|
37
|
+
|
38
|
+
# Display routes
|
39
|
+
task :routes => 'app:environment' do
|
40
|
+
Rails.application.reload_routes!
|
41
|
+
puts Cornerstone::Engine.routes.routes
|
42
|
+
# all_routes = Cornerstone::Engine.routes.routes
|
43
|
+
end
|
44
|
+
|
45
|
+
Bundler::GemHelper.install_tasks
|
46
|
+
|
data/TODO
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
TODO:
|
2
|
+
|
3
|
+
* Admin dashboard
|
4
|
+
* Admin discussion list - sort by date and status, includes private discussions
|
5
|
+
* Footers
|
6
|
+
* General styling
|
7
|
+
* Flash messages not working in admin namespace
|
8
|
+
-- perhaps switch to responder gem with locales
|
9
|
+
* Spec coverage
|
10
|
+
* Generater for views, javascript, stylesheets, locales, etc...
|
11
|
+
* README
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.5
|
File without changes
|
File without changes
|
@@ -0,0 +1,11 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into including all the files listed below.
|
2
|
+
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
|
3
|
+
// be included in the compiled file accessible from http://example.com/assets/application.js
|
4
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
5
|
+
// the compiled file.
|
6
|
+
//
|
7
|
+
|
8
|
+
//= require jquery
|
9
|
+
//= require jquery_ujs
|
10
|
+
//= require_tree .
|
11
|
+
|
File without changes
|
@@ -0,0 +1,8 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll automatically include all the stylesheets available in this directory
|
3
|
+
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
|
4
|
+
* the top of the compiled file, but it's generally better to create a new file per style scope.
|
5
|
+
*= require_self
|
6
|
+
*= require_tree .
|
7
|
+
*/
|
8
|
+
|
File without changes
|
@@ -0,0 +1,61 @@
|
|
1
|
+
module Cornerstone
|
2
|
+
class Admin::ArticlesController < Admin::ApplicationController
|
3
|
+
|
4
|
+
respond_to :html
|
5
|
+
|
6
|
+
def index
|
7
|
+
@articles = Article.all
|
8
|
+
respond_with(:admin, @articles)
|
9
|
+
end
|
10
|
+
|
11
|
+
def show
|
12
|
+
@article = Article.find(params[:id])
|
13
|
+
respond_with(:admin, @article)
|
14
|
+
end
|
15
|
+
|
16
|
+
# GET /cornerstone/admin/articles/new
|
17
|
+
def new
|
18
|
+
@article = Article.new
|
19
|
+
@categories = Category.articles
|
20
|
+
respond_with(:admin, @articles)
|
21
|
+
end
|
22
|
+
|
23
|
+
# POST /cornerstone/admin/articles/
|
24
|
+
def create
|
25
|
+
@article = Article.new(params[:article])
|
26
|
+
if @article.save
|
27
|
+
flash[:notice] = 'Article was successfully created.'
|
28
|
+
else
|
29
|
+
@categories = Category.articles
|
30
|
+
end
|
31
|
+
respond_with(:admin, @article)
|
32
|
+
end
|
33
|
+
|
34
|
+
# GET /cornerstone/admin/articles/:id/edit
|
35
|
+
def edit
|
36
|
+
@article = Article.find(params[:id])
|
37
|
+
@categories = Category.articles
|
38
|
+
respond_with(:admin, @article)
|
39
|
+
end
|
40
|
+
|
41
|
+
# PUT /cornerstone/admin/articles/:id
|
42
|
+
def update
|
43
|
+
@article = Article.find(params[:id])
|
44
|
+
if @article.update_attributes(params[:article])
|
45
|
+
flash[:notice] = 'Article was successfully updated.'
|
46
|
+
else
|
47
|
+
@categories = Category.articles
|
48
|
+
end
|
49
|
+
respond_with(:admin, @article)
|
50
|
+
end
|
51
|
+
|
52
|
+
# DELETE /cornerstone/admin/articles/:id
|
53
|
+
def destroy
|
54
|
+
@article = Article.find(params[:id])
|
55
|
+
flash[:notice] = 'Article was successfully destroyed.' if @article.destroy
|
56
|
+
respond_with(:admin, @article, :location => admin_articles_path)
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module Cornerstone
|
2
|
+
class Admin::CategoriesController < Admin::ApplicationController
|
3
|
+
|
4
|
+
respond_to :html
|
5
|
+
|
6
|
+
def index
|
7
|
+
@discussion_categories = Category.discussions
|
8
|
+
@article_categories = Category.articles
|
9
|
+
end
|
10
|
+
|
11
|
+
# GET /cornerstone/admin/categories/new
|
12
|
+
def new
|
13
|
+
@category = Category.new
|
14
|
+
respond_with(:admin, @category)
|
15
|
+
end
|
16
|
+
|
17
|
+
# POST /cornerstone/admin/categories/
|
18
|
+
def create
|
19
|
+
@category = Category.new(params[:category])
|
20
|
+
flash[:notice] = 'Category was successfully created.' if @category.save
|
21
|
+
respond_with(:admin, @category, :location => admin_categories_path)
|
22
|
+
end
|
23
|
+
|
24
|
+
# GET /cornerstone/admin/categories/:id/edit
|
25
|
+
def edit
|
26
|
+
@category = Category.find(params[:id])
|
27
|
+
respond_with(:admin, @category)
|
28
|
+
end
|
29
|
+
|
30
|
+
# PUT /cornerstone/admin/categories/:id
|
31
|
+
def update
|
32
|
+
@category = Category.find(params[:id])
|
33
|
+
flash[:notice] = 'Category was successfully updated.' if @category.update_attributes(params[:category])
|
34
|
+
respond_with(:admin, @category, :location => admin_categories_path)
|
35
|
+
end
|
36
|
+
|
37
|
+
# DELETE /cornerstone/admin/categories/:id
|
38
|
+
def destroy
|
39
|
+
@category = Category.find(params[:id])
|
40
|
+
flash[:notice] = 'Category was successfully destroyed.' if @category.destroy
|
41
|
+
respond_with([:admin, @category], :location => admin_categories_path)
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module Cornerstone
|
2
|
+
class Admin::DiscussionsController < Admin::ApplicationController
|
3
|
+
|
4
|
+
respond_to :html
|
5
|
+
|
6
|
+
# GET /cornerstone/admin/discussions/:id/edit
|
7
|
+
def edit
|
8
|
+
@discussion = Discussion.includes(:posts => :user).find(params[:id])
|
9
|
+
@categories = Category.discussions
|
10
|
+
respond_with(:admin, @discussion)
|
11
|
+
end
|
12
|
+
|
13
|
+
# PUT /cornersone/admin/discussions/:id
|
14
|
+
def update
|
15
|
+
@discussion = Discussion.includes(:posts => :user).find(params[:id])
|
16
|
+
|
17
|
+
respond_with(@discussion.category, @discussion) do |format|
|
18
|
+
if @discussion.update_attributes(params[:discussion])
|
19
|
+
flash[:notice] = "Discussion was successfully updated."
|
20
|
+
format.html {redirect_to category_discussion_path(@discussion.category, @discussion)}
|
21
|
+
else
|
22
|
+
@categories = Category.discussions
|
23
|
+
format.html {render :edit}
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|