Skip to content

Commit 7d210e7

Browse files
committed
Merge branch 'master' of github.com:indentlabs/notebook
2 parents 4a53d9b + be38648 commit 7d210e7

File tree

6 files changed

+16
-17
lines changed

6 files changed

+16
-17
lines changed

Gemfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,11 @@ gem 'redcarpet' #markdown formatting
5757
# Analytics
5858
gem 'mixpanel-ruby'
5959
gem 'barnes'
60-
61-
# Sharing
62-
gem 'social-share-button'
60+
gem 'skylight'
6361

6462
# Apps
6563
#gem 'easy_translate'
66-
gem 'levenshtein-ffi'
64+
#gem 'levenshtein-ffi'
6765

6866
# Forum
6967
gem 'thredded'

Gemfile.lock

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,6 @@ GEM
236236
kaminari-core (= 1.1.1)
237237
kaminari-core (1.1.1)
238238
kramdown (1.17.0)
239-
levenshtein-ffi (1.1.0)
240-
ffi (~> 1.9)
241239
libv8 (6.7.288.46.1)
242240
listen (3.1.5)
243241
rb-fsevent (~> 0.9, >= 0.9.4)
@@ -460,9 +458,11 @@ GEM
460458
json (>= 1.8, < 3)
461459
simplecov-html (~> 0.10.0)
462460
simplecov-html (0.10.2)
461+
skylight (3.1.2)
462+
skylight-core (= 3.1.2)
463+
skylight-core (3.1.2)
464+
activesupport (>= 4.2.0)
463465
slack-notifier (2.3.2)
464-
social-share-button (1.1.0)
465-
coffee-rails
466466
sprockets (3.7.2)
467467
concurrent-ruby (~> 1.0)
468468
rack (> 1, < 3)
@@ -562,7 +562,6 @@ DEPENDENCIES
562562
guard
563563
guard-minitest
564564
guard-rubocop
565-
levenshtein-ffi
566565
material_icons
567566
medium-editor-rails
568567
memory_profiler
@@ -596,8 +595,8 @@ DEPENDENCIES
596595
serendipitous!
597596
shoulda-matchers (~> 3.1)
598597
simplecov
598+
skylight
599599
slack-notifier
600-
social-share-button
601600
sqlite3
602601
stackprof
603602
stripe

app/controllers/content_controller.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ def index
4040
def show
4141
content_type = content_type_from_controller(self.class)
4242
return redirect_to root_path unless valid_content_types.map(&:name).include?(content_type.name)
43-
@content = content_type.find(params[:id])
43+
@content = content_type.find_by(id: params[:id])
44+
return redirect_to(root_path, notice: "You don't have permission to view that content.") if @content.nil?
4445
@serialized_content = ContentSerializer.new(@content)
4546

4647
return redirect_to(root_path) if @content.user.nil? # deleted user's content

app/controllers/users_controller.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ def index
44
end
55

66
def show
7-
@user = User.find(params[:id])
7+
@user = User.find_by(id: params[:id])
8+
return redirect_to(root_path, notice: 'That user does not exist.') if @user.nil?
9+
810
@content = @user.public_content.select { |type, list| list.any? }
911
@tabs = @content.keys
1012
@stream = @user.content_change_events.order('updated_at desc').limit(100).group_by do |cce|

config/initializers/social_share_button.rb

Lines changed: 0 additions & 5 deletions
This file was deleted.

config/skylight.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
# The authentication token for the application.
3+
# I think this is actually ignored if the ENV var is set, but this is fine for reference / dummy data.
4+
authentication: ENV['SKYLIGHT_AUTHENTICATION']

0 commit comments

Comments
 (0)