Skip to content

Commit 7996dcc

Browse files
committed
Rails 4 forums
0 parents  commit 7996dcc

File tree

106 files changed

+8134
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+8134
-0
lines changed

.gitignore

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
#
3+
# If you find yourself ignoring temporary files generated by your text editor
4+
# or operating system, you probably want to add a global ignore instead:
5+
# git config --global core.excludesfile '~/.gitignore_global'
6+
7+
# Ignore bundler config.
8+
/.bundle
9+
10+
# Ignore the default SQLite database.
11+
/db/*.sqlite3
12+
/db/*.sqlite3-journal
13+
14+
# Ignore all logfiles and tempfiles.
15+
/log/*.log
16+
/tmp

Gemfile

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'rails', '4.0.0'
4+
gem 'pg'
5+
6+
gem 'sass-rails', '~> 4.0.0'
7+
gem 'uglifier', '>= 1.3.0'
8+
gem 'coffee-rails', '~> 4.0.0'
9+
10+
gem 'jquery-rails'
11+
12+
gem 'turbolinks'
13+
gem 'forem', :github => "radar/forem", :branch => "rails4"
14+
15+
gem 'devise', '3.0.0'
16+
gem 'kaminari'
17+
gem 'friendly_id', github: "FriendlyId/friendly_id"
18+
gem 'cancan', git: "https://github.com/nukturnal/cancan.git"

Gemfile.lock

+173
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
GIT
2+
remote: git://github.com/FriendlyId/friendly_id.git
3+
revision: cc5ce00077b168523a95b195d9911e5576e6489f
4+
specs:
5+
friendly_id (5.0.0.alpha1)
6+
7+
GIT
8+
remote: git://github.com/radar/forem.git
9+
revision: 2e051fbe45dae301c4d2f357b294e0a81e0e0d28
10+
branch: rails4
11+
specs:
12+
forem (1.0.0.beta1)
13+
bootstrap-sass (= 2.3.2.1)
14+
decorators (~> 1.0.2)
15+
gemoji (= 1.1.2)
16+
localeapp
17+
rails (~> 4.0.0)
18+
simple_form (~> 3.0.0.rc)
19+
workflow (= 0.8.0)
20+
21+
GIT
22+
remote: https://github.com/nukturnal/cancan.git
23+
revision: a606378912e75d6b62f8257ffa5b4c5f2023760b
24+
specs:
25+
cancan (1.6.10)
26+
27+
GEM
28+
remote: https://rubygems.org/
29+
specs:
30+
actionmailer (4.0.0)
31+
actionpack (= 4.0.0)
32+
mail (~> 2.5.3)
33+
actionpack (4.0.0)
34+
activesupport (= 4.0.0)
35+
builder (~> 3.1.0)
36+
erubis (~> 2.7.0)
37+
rack (~> 1.5.2)
38+
rack-test (~> 0.6.2)
39+
activemodel (4.0.0)
40+
activesupport (= 4.0.0)
41+
builder (~> 3.1.0)
42+
activerecord (4.0.0)
43+
activemodel (= 4.0.0)
44+
activerecord-deprecated_finders (~> 1.0.2)
45+
activesupport (= 4.0.0)
46+
arel (~> 4.0.0)
47+
activerecord-deprecated_finders (1.0.3)
48+
activesupport (4.0.0)
49+
i18n (~> 0.6, >= 0.6.4)
50+
minitest (~> 4.2)
51+
multi_json (~> 1.3)
52+
thread_safe (~> 0.1)
53+
tzinfo (~> 0.3.37)
54+
arel (4.0.0)
55+
atomic (1.1.10)
56+
bcrypt-ruby (3.1.1)
57+
bootstrap-sass (2.3.2.1)
58+
sass (~> 3.2)
59+
builder (3.1.4)
60+
coffee-rails (4.0.0)
61+
coffee-script (>= 2.2.0)
62+
railties (>= 4.0.0.beta, < 5.0)
63+
coffee-script (2.2.0)
64+
coffee-script-source
65+
execjs
66+
coffee-script-source (1.6.3)
67+
decorators (1.0.3)
68+
railties (>= 3.0.19, != 3.2.9, != 3.2.8, != 3.2.7, != 3.2.6, != 3.2.5, != 3.2.4, != 3.2.3, != 3.2.2, != 3.2.10, != 3.2.1, != 3.2.0, != 3.1.9, != 3.1.8, != 3.1.7, != 3.1.6, != 3.1.5, != 3.1.4, != 3.1.3, != 3.1.2, != 3.1.1, != 3.1.0)
69+
devise (3.0.0)
70+
bcrypt-ruby (~> 3.0)
71+
orm_adapter (~> 0.1)
72+
railties (>= 3.2.6, < 5)
73+
warden (~> 1.2.3)
74+
erubis (2.7.0)
75+
execjs (1.4.0)
76+
multi_json (~> 1.0)
77+
gemoji (1.1.2)
78+
gli (2.7.0)
79+
hike (1.2.3)
80+
i18n (0.6.4)
81+
jquery-rails (3.0.4)
82+
railties (>= 3.0, < 5.0)
83+
thor (>= 0.14, < 2.0)
84+
json (1.8.0)
85+
kaminari (0.14.1)
86+
actionpack (>= 3.0.0)
87+
activesupport (>= 3.0.0)
88+
localeapp (0.6.10)
89+
gli
90+
i18n
91+
json
92+
rack
93+
rest-client
94+
ya2yaml
95+
mail (2.5.4)
96+
mime-types (~> 1.16)
97+
treetop (~> 1.4.8)
98+
mime-types (1.23)
99+
minitest (4.7.5)
100+
multi_json (1.7.7)
101+
orm_adapter (0.4.0)
102+
pg (0.15.1)
103+
polyglot (0.3.3)
104+
rack (1.5.2)
105+
rack-test (0.6.2)
106+
rack (>= 1.0)
107+
rails (4.0.0)
108+
actionmailer (= 4.0.0)
109+
actionpack (= 4.0.0)
110+
activerecord (= 4.0.0)
111+
activesupport (= 4.0.0)
112+
bundler (>= 1.3.0, < 2.0)
113+
railties (= 4.0.0)
114+
sprockets-rails (~> 2.0.0)
115+
railties (4.0.0)
116+
actionpack (= 4.0.0)
117+
activesupport (= 4.0.0)
118+
rake (>= 0.8.7)
119+
thor (>= 0.18.1, < 2.0)
120+
rake (10.1.0)
121+
rest-client (1.6.7)
122+
mime-types (>= 1.16)
123+
sass (3.2.9)
124+
sass-rails (4.0.0)
125+
railties (>= 4.0.0.beta, < 5.0)
126+
sass (>= 3.1.10)
127+
sprockets-rails (~> 2.0.0)
128+
simple_form (3.0.0.rc)
129+
actionpack (>= 4.0.0.rc1, < 4.1)
130+
activemodel (>= 4.0.0.rc1, < 4.1)
131+
sprockets (2.10.0)
132+
hike (~> 1.2)
133+
multi_json (~> 1.0)
134+
rack (~> 1.0)
135+
tilt (~> 1.1, != 1.3.0)
136+
sprockets-rails (2.0.0)
137+
actionpack (>= 3.0)
138+
activesupport (>= 3.0)
139+
sprockets (~> 2.8)
140+
thor (0.18.1)
141+
thread_safe (0.1.0)
142+
atomic
143+
tilt (1.4.1)
144+
treetop (1.4.14)
145+
polyglot
146+
polyglot (>= 0.3.1)
147+
turbolinks (1.3.0)
148+
coffee-rails
149+
tzinfo (0.3.37)
150+
uglifier (2.1.2)
151+
execjs (>= 0.3.0)
152+
multi_json (~> 1.0, >= 1.0.2)
153+
warden (1.2.3)
154+
rack (>= 1.0)
155+
workflow (0.8.0)
156+
ya2yaml (0.31)
157+
158+
PLATFORMS
159+
ruby
160+
161+
DEPENDENCIES
162+
cancan!
163+
coffee-rails (~> 4.0.0)
164+
devise (= 3.0.0)
165+
forem!
166+
friendly_id!
167+
jquery-rails
168+
kaminari
169+
pg
170+
rails (= 4.0.0)
171+
sass-rails (~> 4.0.0)
172+
turbolinks
173+
uglifier (>= 1.3.0)

README.rdoc

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
== README
2+
3+
This README would normally document whatever steps are necessary to get the
4+
application up and running.
5+
6+
Things you may want to cover:
7+
8+
* Ruby version
9+
10+
* System dependencies
11+
12+
* Configuration
13+
14+
* Database creation
15+
16+
* Database initialization
17+
18+
* How to run the test suite
19+
20+
* Services (job queues, cache servers, search engines, etc.)
21+
22+
* Deployment instructions
23+
24+
* ...
25+
26+
27+
Please feel free to use a different markup language if you do not plan to run
28+
<tt>rake doc:app</tt>.

Rakefile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Add your own tasks in files placed in lib/tasks ending in .rake,
2+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3+
4+
require File.expand_path('../config/application', __FILE__)
5+
6+
Forums::Application.load_tasks

app/assets/images/.keep

Whitespace-only changes.

app/assets/javascripts/application.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This is a manifest file that'll be compiled into application.js, which will include all the files
2+
// listed below.
3+
//
4+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6+
//
7+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8+
// compiled file.
9+
//
10+
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11+
// about supported directives.
12+
//
13+
//= require jquery
14+
//= require jquery_ujs
15+
//= require turbolinks
16+
//= require_tree .
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#groups thead th {
2+
background: #0088cc;
3+
color: white;
4+
padding: 10px;
5+
border-bottom: 3px solid #232323;
6+
font-size: 110%;
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
*= require bootstrap
3+
*= require forums
4+
*= require topics
5+
*= require posts
6+
*= require admin/groups
7+
*= require_self
8+
*/
9+
10+
nav {
11+
margin-top: 10px;
12+
}
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.forum .title {
2+
font-size: 25px;
3+
}
4+
5+
.forums thead th {
6+
background: #0088cc;
7+
color: white;
8+
padding: 10px;
9+
border-bottom: 3px solid #232323;
10+
font-size: 110%;
11+
}
12+
13+
.forums .last_post {
14+
font-style: italic;
15+
16+
time {
17+
color: #aaa;
18+
font-size: 75%;
19+
}
20+
}
21+
22+
#forum #forum_topic_links {
23+
margin-bottom: 10px;
24+
}

app/assets/stylesheets/posts.css.scss

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.post {
2+
border: 1px solid #dedede;
3+
margin-bottom: 10px;
4+
border-radius: 5px;
5+
6+
.alert {
7+
margin: 10px;
8+
}
9+
10+
.contents {
11+
border-left: 1px solid #ddd;
12+
padding-left: 10px;
13+
padding-bottom: 10px;
14+
15+
time {
16+
font-size: 75%;
17+
font-style: italic;
18+
}
19+
}
20+
21+
.in-reply-to {
22+
font-size: 85%;
23+
}
24+
}
25+
26+
.new_post textarea {
27+
width: 50%;
28+
min-height: 250px;
29+
}
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.topics thead th {
2+
background: #0088cc;
3+
color: white;
4+
padding: 5px;
5+
border-bottom: 3px solid #232323;
6+
font-size: 110%;
7+
}
8+
9+
.topic td.byline {
10+
padding: 10px;
11+
}
12+
13+
.topic .subject {
14+
font-size: 20px;
15+
}
16+
17+
.new_topic textarea {
18+
width: 50%;
19+
min-height: 250px;
20+
}
21+
22+
#topic #menu {
23+
margin-bottom: 10px;
24+
}
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class ApplicationController < ActionController::Base
2+
3+
def forem_user
4+
current_user
5+
end
6+
helper_method :forem_user
7+
8+
# Prevent CSRF attacks by raising an exception.
9+
# For APIs, you may want to use :null_session instead.
10+
protect_from_forgery with: :exception
11+
end

app/controllers/concerns/.keep

Whitespace-only changes.

app/helpers/application_helper.rb

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module ApplicationHelper
2+
end

app/mailers/.keep

Whitespace-only changes.

app/models/.keep

Whitespace-only changes.

app/models/concerns/.keep

Whitespace-only changes.

app/models/user.rb

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class User < ActiveRecord::Base
2+
# Include default devise modules. Others available are:
3+
# :token_authenticatable, :confirmable,
4+
# :lockable, :timeoutable and :omniauthable
5+
devise :database_authenticatable, :registerable,
6+
:recoverable, :rememberable, :trackable, :validatable
7+
8+
def to_s
9+
email
10+
end
11+
end

0 commit comments

Comments
 (0)