droom 0.2.1 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/app/assets/images/droom/Untitled-1.png +0 -0
- data/app/assets/images/droom/asterisk.png +0 -0
- data/app/assets/images/droom/dropbox_small.png +0 -0
- data/app/assets/images/droom/handle.png +0 -0
- data/app/assets/images/droom/minisymbols.png +0 -0
- data/app/assets/images/droom/revoke_small.png +0 -0
- data/app/assets/images/droom/toggle.png +0 -0
- data/app/assets/javascripts/droom.js.coffee +4 -4
- data/app/assets/javascripts/droom/actions.js.coffee +16 -5
- data/app/assets/javascripts/droom/lib/wysihtml5.js +18 -0
- data/app/assets/javascripts/droom/widgets.js.coffee +72 -111
- data/app/assets/stylesheets/droom.css.sass +195 -119
- data/app/assets/stylesheets/{_definitions.css.sass → droom/_mixins.css.sass} +28 -43
- data/app/assets/stylesheets/{lib → droom}/_popups.css.sass +0 -0
- data/app/assets/stylesheets/{lib → droom}/_toolbar.css.sass +2 -4
- data/app/assets/stylesheets/droom/_variables.css.sass +46 -0
- data/app/assets/stylesheets/lib/_kalendae.css.sass +2 -2
- data/app/controllers/droom/engine_controller.rb +5 -1
- data/app/controllers/droom/events_controller.rb +9 -6
- data/app/controllers/droom/groups_controller.rb +1 -1
- data/app/controllers/droom/organisations_controller.rb +1 -1
- data/app/controllers/droom/people_controller.rb +18 -18
- data/app/controllers/droom/suggestions_controller.rb +0 -1
- data/app/controllers/droom/user_confirmations_controller.rb +55 -0
- data/app/controllers/droom/users_controller.rb +1 -2
- data/app/controllers/droom/youtube_controller.rb +4 -1
- data/app/helpers/droom/droom_helper.rb +3 -3
- data/app/models/droom/document.rb +3 -27
- data/app/models/droom/event.rb +0 -12
- data/app/models/droom/folder.rb +9 -10
- data/app/models/droom/group.rb +0 -7
- data/app/models/droom/person.rb +13 -20
- data/app/models/droom/scrap.rb +2 -12
- data/app/models/droom/user.rb +29 -5
- data/app/models/droom/venue.rb +0 -17
- data/app/views/{droom/users/unwelcome.en.html.haml → devise/confirmations/failure.en.html.haml} +5 -2
- data/app/views/devise/confirmations/new.html.haml +25 -0
- data/app/views/devise/confirmations/show.html.haml +32 -0
- data/app/views/droom/dashboard/_documents.html.haml +9 -0
- data/app/views/droom/dashboard/_folders.html.haml +1 -1
- data/app/views/droom/dashboard/_groups.html.haml +9 -0
- data/app/views/droom/documents/_document.html.haml +1 -1
- data/app/views/droom/documents/_table_document.html.haml +1 -1
- data/app/views/droom/events/_event.html.haml +0 -1
- data/app/views/droom/events/edit.html.haml +1 -1
- data/app/views/droom/events/index.html.haml +6 -4
- data/app/views/droom/events/new.html.haml +1 -1
- data/app/views/droom/events/show.html.haml +1 -1
- data/app/views/droom/folders/_folder.html.haml +2 -2
- data/app/views/droom/folders/edit.html.haml +1 -1
- data/app/views/droom/folders/index.html.haml +3 -1
- data/app/views/droom/folders/new.html.haml +1 -1
- data/app/views/droom/groups/_group.html.haml +6 -3
- data/app/views/droom/groups/edit.html.haml +1 -1
- data/app/views/droom/groups/index.html.haml +20 -1
- data/app/views/droom/groups/new.html.haml +1 -1
- data/app/views/droom/organisations/_action_menu.html.haml +3 -1
- data/app/views/droom/organisations/_organisation.html.haml +0 -1
- data/app/views/droom/organisations/edit.html.haml +1 -1
- data/app/views/droom/organisations/new.html.haml +1 -1
- data/app/views/droom/panels/_dropbox.html.haml +1 -1
- data/app/views/droom/panels/{_search.html.haml → _suggestions.html.haml} +3 -4
- data/app/views/droom/people/_form.html.haml +15 -19
- data/app/views/droom/people/_listing.html.haml +1 -1
- data/app/views/droom/people/_person.html.haml +3 -3
- data/app/views/droom/people/_suggested.html.haml +1 -1
- data/app/views/droom/people/edit.html.haml +1 -1
- data/app/views/droom/people/new.html.haml +1 -1
- data/app/views/droom/people/show.html.haml +31 -1
- data/app/views/droom/scraps/full/_document.html.haml +1 -1
- data/app/views/droom/scraps/thumbs/_document.html.haml +2 -2
- data/app/views/droom/shared/{_search_form.html.haml → _suggestion_form.html.haml} +1 -1
- data/app/views/droom/users/_extra_columns.html.haml +0 -0
- data/app/views/droom/users/_extra_columns_header.html.haml +0 -0
- data/app/views/droom/users/_extra_columns_note.html.haml +0 -0
- data/app/views/droom/users/_form.html.haml +5 -12
- data/app/views/droom/users/_user_or_person.html.haml +24 -15
- data/app/views/droom/users/_users_table.html.haml +24 -6
- data/app/views/droom/users/edit.html.haml +1 -1
- data/app/views/droom/users/index.html.haml +2 -5
- data/config/locales/devise.en.yml +1 -1
- data/config/locales/en.yml +22 -7
- data/config/routes.rb +4 -3
- data/lib/droom.rb +28 -14
- data/lib/droom/engine.rb +2 -0
- data/lib/droom/version.rb +1 -1
- data/spec/dummy/log/dav.log +1 -0
- data/spec/dummy/log/development.log +2 -0
- data/spec/dummy/log/test.log +1 -0
- metadata +29 -33
- data/app/controllers/droom/confirmations_controller.rb +0 -38
- data/app/controllers/droom/search_controller.rb +0 -66
- data/app/views/cropper/uploads/_crop.html.haml +0 -46
- data/app/views/devise/mailer/confirmation_instructions.en.html.haml +0 -24
- data/app/views/devise/mailer/reset_password_instructions.en.html.haml +0 -21
- data/app/views/droom/shared/_search_results.html.haml +0 -9
- data/app/views/droom/shared/search.html.haml +0 -18
|
@@ -1,39 +1,3 @@
|
|
|
1
|
-
$coolgrey0: #f2f0ed
|
|
2
|
-
$coolgrey1: #e2e1dd
|
|
3
|
-
$coolgrey2: #d6d6d4
|
|
4
|
-
$coolgrey3: #cacac8
|
|
5
|
-
$coolgrey4: #bdbdbd
|
|
6
|
-
$coolgrey5: #b3b3b3
|
|
7
|
-
$coolgrey6: #afafaf
|
|
8
|
-
$coolgrey7: #9a9b9d
|
|
9
|
-
$coolgrey8: #8c8d8e
|
|
10
|
-
$coolgrey9: #747679
|
|
11
|
-
$coolgrey10: #616265
|
|
12
|
-
$coolgrey11: #4d4e53
|
|
13
|
-
$black6: #52555f
|
|
14
|
-
$rubine: #d1005d
|
|
15
|
-
$blue: #00afdb
|
|
16
|
-
$green: #74b87a
|
|
17
|
-
$warmred: #ff625b
|
|
18
|
-
$darkred: #b92a23
|
|
19
|
-
$purple: #a27ec3
|
|
20
|
-
$red: #ed1c24
|
|
21
|
-
|
|
22
|
-
$dark: $coolgrey10
|
|
23
|
-
$mid: $coolgrey7
|
|
24
|
-
$pale: #d6d6d4
|
|
25
|
-
$verypale: #ebeae8
|
|
26
|
-
$palest: #f5f5f5
|
|
27
|
-
|
|
28
|
-
$text: $dark
|
|
29
|
-
$link: $rubine
|
|
30
|
-
$hover: lighten($link, 8)
|
|
31
|
-
$input: $mid
|
|
32
|
-
$submit: $green
|
|
33
|
-
$error: $rubine
|
|
34
|
-
$active: #8c8d8e
|
|
35
|
-
$visited: $link
|
|
36
|
-
|
|
37
1
|
=hover
|
|
38
2
|
&:hover
|
|
39
3
|
color: $hover
|
|
@@ -59,13 +23,33 @@ $visited: $link
|
|
|
59
23
|
overflow: hidden
|
|
60
24
|
text-indent: $indent
|
|
61
25
|
|
|
62
|
-
=button($color)
|
|
63
|
-
|
|
26
|
+
=button($color: $mid)
|
|
27
|
+
display: inline-block
|
|
28
|
+
position: relative
|
|
29
|
+
outline: none
|
|
30
|
+
cursor: pointer
|
|
31
|
+
text-align: center
|
|
32
|
+
text-decoration: none
|
|
33
|
+
font-size: 16px
|
|
34
|
+
padding: 12px 16px 9px
|
|
64
35
|
+border-radius(3px)
|
|
36
|
+
+box-shadow(0 1px 2px rgba(0,0,0,0.6))
|
|
37
|
+
color: #fef4e9
|
|
38
|
+
border: solid 1px darken($color, 10)
|
|
39
|
+
+background-image(linear-gradient(lighten($color, 3), $color, darken($color, 10)))
|
|
65
40
|
&:hover
|
|
66
|
-
|
|
41
|
+
text-decoration: none
|
|
42
|
+
+background-image(linear-gradient(lighten($color, 5), darken($color, 8)))
|
|
67
43
|
&:active
|
|
68
|
-
|
|
44
|
+
position: relative
|
|
45
|
+
top: 1px
|
|
46
|
+
+box-shadow(0 1px 2px rgba(0,0,0,0.6) inset)
|
|
47
|
+
+background-image(linear-gradient(darken($color, 10), lighten($color, 3), $color, darken($color, 15)))
|
|
48
|
+
&.unavailable
|
|
49
|
+
border: solid 1px darken($pale, 10)
|
|
50
|
+
color: lighten($pale, 15)
|
|
51
|
+
+background-image(linear-gradient(darken($pale, 10), lighten($pale, 3), $pale, darken($pale, 15)))
|
|
52
|
+
+opacity(0.75)
|
|
69
53
|
|
|
70
54
|
=small
|
|
71
55
|
font-size: 80%
|
|
@@ -94,6 +78,7 @@ $visited: $link
|
|
|
94
78
|
margin-top: 0
|
|
95
79
|
line-height: 14px
|
|
96
80
|
min-height: 16px
|
|
81
|
+
font-size: 14px
|
|
97
82
|
background:
|
|
98
83
|
color: transparent
|
|
99
84
|
position: 0 0
|
|
@@ -113,8 +98,8 @@ $visited: $link
|
|
|
113
98
|
|
|
114
99
|
=big_icon_link($url)
|
|
115
100
|
+icon_link($url)
|
|
116
|
-
text-indent:
|
|
117
|
-
line-height:
|
|
101
|
+
text-indent: 24px
|
|
102
|
+
line-height: 24px
|
|
118
103
|
min-height: 24px
|
|
119
104
|
&:hover
|
|
120
105
|
background-position: 0 -48px
|
|
@@ -150,7 +135,7 @@ $visited: $link
|
|
|
150
135
|
&:hover
|
|
151
136
|
background-position: $x $y - 48px
|
|
152
137
|
&.here
|
|
153
|
-
background-color: $
|
|
138
|
+
background-color: $palest
|
|
154
139
|
background-position: $x $y - 96px
|
|
155
140
|
|
|
156
141
|
=blurred($color: $pale)
|
|
File without changes
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
border: 1px solid $pale
|
|
175
175
|
border-bottom: none
|
|
176
176
|
input[type="text"]
|
|
177
|
-
color: $
|
|
177
|
+
color: $input
|
|
178
178
|
border: 1px solid $pale
|
|
179
179
|
font-size: 14px
|
|
180
180
|
padding: 9px 6px 6px 6px
|
|
@@ -189,10 +189,8 @@
|
|
|
189
189
|
+border-radius(3px)
|
|
190
190
|
|
|
191
191
|
[data-wysihtml5-dialog-action="save"]
|
|
192
|
-
background: $
|
|
192
|
+
background: $submit
|
|
193
193
|
color: #fff
|
|
194
194
|
|
|
195
195
|
[data-wysihtml5-dialog-action="cancel"]
|
|
196
196
|
color: $pale
|
|
197
|
-
&:hover
|
|
198
|
-
color: $hover
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
$coolgrey0: #f2f0ed
|
|
2
|
+
$coolgrey1: #e2e1dd
|
|
3
|
+
$coolgrey2: #d6d6d4
|
|
4
|
+
$coolgrey3: #cacac8
|
|
5
|
+
$coolgrey4: #bdbdbd
|
|
6
|
+
$coolgrey5: #b3b3b3
|
|
7
|
+
$coolgrey6: #afafaf
|
|
8
|
+
$coolgrey7: #9a9b9d
|
|
9
|
+
$coolgrey8: #8c8d8e
|
|
10
|
+
$coolgrey9: #747679
|
|
11
|
+
$coolgrey10: #616265
|
|
12
|
+
$coolgrey11: #4d4e53
|
|
13
|
+
$black6: #52555f
|
|
14
|
+
$rubine: #d1005d
|
|
15
|
+
$blue: #00afdb
|
|
16
|
+
$green: #74b87a
|
|
17
|
+
$warmred: #ff625b
|
|
18
|
+
$darkred: #b92a23
|
|
19
|
+
$purple: #a27ec3
|
|
20
|
+
$red: #ed1c24
|
|
21
|
+
$palered: lighten($red, 30)
|
|
22
|
+
|
|
23
|
+
$dark: #4d4e53
|
|
24
|
+
$mid: #9a9b9d
|
|
25
|
+
$pale: #bdbdbd
|
|
26
|
+
$palest: #f2f0ed !default
|
|
27
|
+
|
|
28
|
+
$page: #ffffff
|
|
29
|
+
$text: $dark
|
|
30
|
+
$link: $red
|
|
31
|
+
$hover: $palered
|
|
32
|
+
$active: #8c8d8e
|
|
33
|
+
$visited: $link
|
|
34
|
+
$input: $dark
|
|
35
|
+
$submit: $green
|
|
36
|
+
$error: $darkred
|
|
37
|
+
$help: #e59811
|
|
38
|
+
|
|
39
|
+
$tag: #7489b8
|
|
40
|
+
$match: $green
|
|
41
|
+
$inst: $coolgrey10
|
|
42
|
+
$person: $link
|
|
43
|
+
|
|
44
|
+
$masthead: #64666f
|
|
45
|
+
$menubg: $link
|
|
46
|
+
$menuitem: $hover
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
background-color: $verypale
|
|
63
63
|
.k-btn-previous-month:active, .k-btn-next-month:active
|
|
64
64
|
color: white
|
|
65
|
-
background-color: $
|
|
65
|
+
background-color: $link
|
|
66
66
|
.k-btn-previous-year:hover, .k-btn-next-year:hover
|
|
67
67
|
color: #6FDF81
|
|
68
68
|
.k-title, .k-header, .k-days
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
&:hover
|
|
95
95
|
background: $verypale
|
|
96
96
|
&.k-selected
|
|
97
|
-
background-color: $
|
|
97
|
+
background-color: $link
|
|
98
98
|
font-weight: bold
|
|
99
99
|
color: white
|
|
100
100
|
&.k-range
|
|
@@ -12,8 +12,12 @@ module Droom
|
|
|
12
12
|
raise Droom::PermissionDenied unless current_user && current_user.admin?
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
+
def current_person
|
|
16
|
+
current_user.person if user_signed_in?
|
|
17
|
+
end
|
|
18
|
+
|
|
15
19
|
def no_layout_if_pjax
|
|
16
|
-
if request.headers['X-PJAX']
|
|
20
|
+
if request.headers['X-PJAX'] || request.format == 'js'
|
|
17
21
|
false
|
|
18
22
|
else
|
|
19
23
|
Droom.layout
|
|
@@ -75,7 +75,7 @@ module Droom
|
|
|
75
75
|
|
|
76
76
|
def build_event
|
|
77
77
|
params[:event] ||= {}
|
|
78
|
-
params[:event][:calendar_id] ||= @calendar.id
|
|
78
|
+
params[:event][:calendar_id] ||= @calendar.id if @calendar
|
|
79
79
|
@event = Droom::Event.new({:start => Time.now.floor(30.minutes)}.merge(params[:event]))
|
|
80
80
|
end
|
|
81
81
|
|
|
@@ -84,16 +84,19 @@ module Droom
|
|
|
84
84
|
end
|
|
85
85
|
|
|
86
86
|
def find_events
|
|
87
|
-
@events = @calendar.events
|
|
88
87
|
if params[:direction] == 'past'
|
|
89
|
-
@events = @events.past.order('start DESC')
|
|
88
|
+
@events = @calendar.events.past.order('start DESC')
|
|
90
89
|
@direction = "past"
|
|
91
90
|
else
|
|
92
|
-
@events = @events.future_and_current.order('start ASC')
|
|
91
|
+
@events = @calendar.events.future_and_current.order('start ASC')
|
|
93
92
|
@direction = "future"
|
|
94
93
|
end
|
|
95
94
|
unless current_user.admin?
|
|
96
|
-
|
|
95
|
+
if current_person
|
|
96
|
+
@events = @events.visible_to(current_person)
|
|
97
|
+
else
|
|
98
|
+
@events = @events.all_public
|
|
99
|
+
end
|
|
97
100
|
end
|
|
98
101
|
|
|
99
102
|
@show = params[:show] || 10
|
|
@@ -102,7 +105,7 @@ module Droom
|
|
|
102
105
|
end
|
|
103
106
|
|
|
104
107
|
def get_calendar
|
|
105
|
-
@calendar = Droom::Calendar.find_by_id(params[:calendar_id]) ||
|
|
108
|
+
@calendar = Droom::Calendar.find_by_id(params[:calendar_id]) || find_or_create_calendar
|
|
106
109
|
end
|
|
107
110
|
|
|
108
111
|
def find_or_create_calendar
|
|
@@ -4,7 +4,6 @@ module Droom
|
|
|
4
4
|
layout :no_layout_if_pjax
|
|
5
5
|
|
|
6
6
|
before_filter :authenticate_user!
|
|
7
|
-
before_filter :scale_image_params, :only => [:create, :update]
|
|
8
7
|
before_filter :find_people, :only => :index
|
|
9
8
|
before_filter :get_groups
|
|
10
9
|
before_filter :get_person, :only => [:show, :edit, :update, :destroy, :invite]
|
|
@@ -26,17 +25,27 @@ module Droom
|
|
|
26
25
|
}
|
|
27
26
|
end
|
|
28
27
|
end
|
|
29
|
-
|
|
28
|
+
|
|
30
29
|
def create
|
|
31
|
-
@person.update_attributes(params[:person])
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
if @person.update_attributes(params[:person])
|
|
31
|
+
respond_with @person do |format|
|
|
32
|
+
format.js { render :partial => "droom/users/user_or_person" }
|
|
33
|
+
format.html { render :partial => "droom/people/person" }
|
|
34
|
+
end
|
|
35
|
+
else
|
|
36
|
+
respond_with @person
|
|
34
37
|
end
|
|
35
38
|
end
|
|
36
39
|
|
|
37
40
|
def update
|
|
38
|
-
@person.update_attributes(params[:person])
|
|
39
|
-
|
|
41
|
+
if @person.update_attributes(params[:person])
|
|
42
|
+
respond_with @person do |format|
|
|
43
|
+
format.js { render :partial => "droom/users/user_or_person" }
|
|
44
|
+
format.html { render :partial => "droom/people/person" }
|
|
45
|
+
end
|
|
46
|
+
else
|
|
47
|
+
respond_with @person
|
|
48
|
+
end
|
|
40
49
|
end
|
|
41
50
|
|
|
42
51
|
def destroy
|
|
@@ -60,7 +69,9 @@ module Droom
|
|
|
60
69
|
protected
|
|
61
70
|
|
|
62
71
|
def build_person
|
|
72
|
+
@organisation = Droom::Organisation.find(params[:organisation_id]) if params[:organisation_id]
|
|
63
73
|
@person = Droom::Person.new(params[:person])
|
|
74
|
+
@person.organisation = @organisation if @organisation
|
|
64
75
|
end
|
|
65
76
|
|
|
66
77
|
def get_person
|
|
@@ -95,17 +106,6 @@ module Droom
|
|
|
95
106
|
def confine_to_self
|
|
96
107
|
@person = current_user.person unless current_user.admin?
|
|
97
108
|
end
|
|
98
|
-
|
|
99
|
-
def scale_image_params
|
|
100
|
-
multiplier = params[:multiplier] || 4
|
|
101
|
-
Rails.logger.warn ">>> before scale_image_params (with multiplier #{multiplier}), params for person: #{params[:person].inspect}"
|
|
102
|
-
if params[:person]
|
|
103
|
-
[:image_scale_width, :image_scale_height, :image_offset_left, :image_offset_top].each do |p|
|
|
104
|
-
params[:person][p] = (params[:person][p].to_i * multiplier.to_i) unless params[:person][p].blank?
|
|
105
|
-
end
|
|
106
|
-
end
|
|
107
|
-
Rails.logger.warn ">>> after scale_image_params, params for person: #{params[:person].inspect}"
|
|
108
|
-
end
|
|
109
109
|
|
|
110
110
|
end
|
|
111
111
|
end
|
|
@@ -16,7 +16,6 @@ module Droom
|
|
|
16
16
|
@title = span.width > 86400 ? "Events in #{fragment}" : "Events on #{fragment}"
|
|
17
17
|
else
|
|
18
18
|
@suggestions = @klasses.collect {|klass|
|
|
19
|
-
logger.warn ">>> getting #{klass}"
|
|
20
19
|
klass.constantize.visible_to(current_user.person).matching(fragment).limit(max.to_i)
|
|
21
20
|
}.flatten.sort_by(&:name).slice(0, max.to_i)
|
|
22
21
|
end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
module Droom
|
|
2
|
+
class UserConfirmationsController < Devise::ConfirmationsController
|
|
3
|
+
|
|
4
|
+
# If user not yet confirmed, show password form (rather than just confirming, as is normal)
|
|
5
|
+
# If already confirmed, allow devise to do whatever a devise does.
|
|
6
|
+
#
|
|
7
|
+
def show
|
|
8
|
+
if self.resource = resource_class.find_by_id_and_confirmation_token(params[:id], params[:confirmation_token])
|
|
9
|
+
redirect_to after_sign_in_path_for(resource) if resource.confirmed?
|
|
10
|
+
# or we render user_confirmations/show
|
|
11
|
+
elsif user_signed_in?
|
|
12
|
+
redirect_to after_sign_in_path_for(current_user)
|
|
13
|
+
else
|
|
14
|
+
render :template => "devise/confirmations/failure"
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# the purpose of this is to add another step between user creation and user confirmation, such that
|
|
19
|
+
# we perform the confirmation only if a password is supplied and validates.
|
|
20
|
+
#
|
|
21
|
+
# NB. in the tortured RESTfulness of devise, that means turning confirmation#show into a password form
|
|
22
|
+
# and using confirmations#update to update the user object accordingly.
|
|
23
|
+
#
|
|
24
|
+
def update
|
|
25
|
+
if self.resource = resource_class.where(id: params[:id], confirmation_token: params[resource_name][:confirmation_token]).first
|
|
26
|
+
result = resource.update_attributes(permitted_params)
|
|
27
|
+
if result && resource.password_match?
|
|
28
|
+
set_flash_message :notice, :confirmed
|
|
29
|
+
resource.confirm!
|
|
30
|
+
sign_in(resource_name, resource)
|
|
31
|
+
respond_with_navigational(resource){ redirect_to after_confirmation_path_for(resource_name, resource) }
|
|
32
|
+
else
|
|
33
|
+
# back to the password form
|
|
34
|
+
set_flash_message :error, :password_error
|
|
35
|
+
render :action => "show"
|
|
36
|
+
end
|
|
37
|
+
else
|
|
38
|
+
render :template => "devise/confirmations/failure"
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def after_confirmation_path_for(resource_name, resource)
|
|
43
|
+
dashboard_url
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
protected
|
|
47
|
+
|
|
48
|
+
def permitted_params
|
|
49
|
+
params[:user].slice(:forename, :name, :password, :password_confirmation)
|
|
50
|
+
# for rails 4
|
|
51
|
+
#params.require(:user).permit(:first_name, :last_name, :password, :password_confirmation)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -5,10 +5,9 @@ module Droom
|
|
|
5
5
|
layout :no_layout_if_pjax
|
|
6
6
|
before_filter :authenticate_user!
|
|
7
7
|
before_filter :require_admin!, :only => [:index, :new, :create, :destroy]
|
|
8
|
+
before_filter :get_user, :only => [:show, :edit, :update, :destroy, :welcome]
|
|
8
9
|
before_filter :require_self_or_admin!, :only => [:edit, :update]
|
|
9
10
|
before_filter :remember_token_auth
|
|
10
|
-
before_filter :get_user, :only => :edit
|
|
11
|
-
before_filter :get_user, :only => [:show, :edit, :update, :destroy, :welcome]
|
|
12
11
|
|
|
13
12
|
def index
|
|
14
13
|
@everyone = Droom::Person.all + Droom::User.unpersoned
|
|
@@ -14,7 +14,10 @@ module Droom
|
|
|
14
14
|
max = params[:limit] || 10
|
|
15
15
|
@suggestions = []
|
|
16
16
|
unless fragment.blank?
|
|
17
|
-
|
|
17
|
+
videos = Droom.yt_client.videos_by(:query => fragment, :per_page => max).videos.to_a
|
|
18
|
+
@suggestions = videos.map { |vid|
|
|
19
|
+
vid.as_json.slice('unique_id', 'title', 'description', 'thumbnails').merge({"type" => "video"})
|
|
20
|
+
}
|
|
18
21
|
end
|
|
19
22
|
respond_with @suggestions
|
|
20
23
|
end
|
|
@@ -35,11 +35,11 @@ module Droom
|
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
def current_person
|
|
38
|
-
current_user.person if
|
|
38
|
+
current_user.person if user_signed_in?
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
def admin?
|
|
42
|
-
current_user
|
|
42
|
+
current_user && current_user.admin?
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
def pageclass
|
|
@@ -91,7 +91,7 @@ module Droom
|
|
|
91
91
|
|
|
92
92
|
def nav_link_to(name, url, options={})
|
|
93
93
|
options[:class] ||= ""
|
|
94
|
-
options[:class] << "here" if (request.path == url) || (request.path =~ /^#{url}/
|
|
94
|
+
options[:class] << "here" if (request.path == url) || (request.path =~ /^#{url}/)
|
|
95
95
|
link_to name, url, options
|
|
96
96
|
end
|
|
97
97
|
|