Skip to content

Commit bf17251

Browse files
committed
Merge remote-tracking branch 'mleung/master'
2 parents cd1cec8 + f2e2de8 commit bf17251

17 files changed

Lines changed: 157 additions & 45 deletions

File tree

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ gem 'simple_form', git: "https://github.com/bitzesty/bootstrap_form.git"
3434
gem "semantic_menu", git: "git://github.com/michaek/semantic_menu.git"
3535

3636
gem 'will_paginate' # Pagination
37-
gem 'rdiscount' # Markdown
37+
gem 'redcarpet', '~> 3.0' # Markdown
3838

3939
group :development do
4040
# Use unicorn as the web server

Gemfile.lock

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,9 @@ GEM
181181
thor (~> 0.14.6)
182182
raindrops (0.8.0)
183183
rake (10.1.0)
184-
rdiscount (1.6.8)
185184
rdoc (3.12.2)
186185
json (~> 1.4)
187-
redcarpet (2.1.0)
186+
redcarpet (3.0.0)
188187
responders (0.6.5)
189188
rest-client (1.6.7)
190189
mime-types (>= 1.16)
@@ -215,7 +214,7 @@ GEM
215214
multi_json (~> 1.0)
216215
simplecov-html (~> 0.7.1)
217216
simplecov-html (0.7.1)
218-
slop (2.4.3)
217+
slop (2.4.4)
219218
sprockets (2.0.4)
220219
hike (~> 1.2)
221220
rack (~> 1.0)
@@ -268,7 +267,7 @@ DEPENDENCIES
268267
pg
269268
pry
270269
rails (= 3.1.11)
271-
rdiscount
270+
redcarpet (~> 3.0)
272271
rspec-rails
273272
sass-rails (~> 3.1.0)
274273
semantic_menu!

app/controllers/mailer_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
class MailerController < ApplicationController
2+
load_and_authorize_resource class: Message
3+
24
def new
35
@users = Array(params[:user])
46
@emails = User.where(:username => @users).all.map(&:email)

app/helpers/application_helper.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@ module ApplicationHelper
22
def program_path program
33
"/users/#{program.author_username}/programs/#{program.slug}"
44
end
5+
6+
def markdown(text)
7+
Redcarpet::Markdown.new(Redcarpet::Render::HTML.new(hard_wrap: true), autolink: true).render(text).html_safe
8+
end
59
end

app/models/deleted_user.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ def email
1010
def to_param
1111
'deleted_user'
1212
end
13-
end
13+
end

app/views/answers/_list.html.haml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
.meta
44
#{link_to list.user.username, user_path(list.user)} says
55
.description
6-
:markdown
7-
#{list.description}
6+
=markdown(list.description)
87

98
.links
109
- if can? :update, list

app/views/blog/index.html.haml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@
1313
= post.created_at.strftime("Posted %B %d, %Y at %l:%M %p")
1414

1515
.content
16-
:markdown
17-
#{post.content}
16+
=markdown(post.content)
1817

app/views/blog/show.html.haml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@
1111
= @post.created_at.strftime("Posted %B %d, %Y at %l:%M %p")
1212

1313
.content
14-
:markdown
15-
#{@post.content}
14+
=markdown(@post.content)

app/views/lessons/show.html.haml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@
1010
#lesson-content
1111
= lesson_categories @lesson
1212

13-
:markdown
14-
#{@lesson.output}
13+
=markdown(@lesson.output)

app/views/questions/index.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626
%ul.questions
2727
= render :partial => "list", :collection => collection, :as => :question
2828

29-
= will_paginate
29+
= will_paginate(@questions, renderer: @support ? PrefixLinkRenderer.new('/support') : nil)

0 commit comments

Comments
 (0)