This repository was archived by the owner on Jul 15, 2021. It is now read-only.
File tree 8 files changed +72
-4
lines changed
8 files changed +72
-4
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ gem 'rails_12factor'
36
36
37
37
gem 'gemoji'
38
38
39
+ gem 'will_paginate'
40
+
39
41
# Use ActiveModel has_secure_password
40
42
# gem 'bcrypt', '~> 3.1.7'
41
43
Original file line number Diff line number Diff line change 204
204
binding_of_caller (>= 0.7.2 )
205
205
railties (>= 4.0 )
206
206
sprockets-rails (>= 2.0 , < 4.0 )
207
+ will_paginate (3.1.0 )
207
208
208
209
PLATFORMS
209
210
ruby
@@ -229,6 +230,7 @@ DEPENDENCIES
229
230
turbolinks
230
231
uglifier (>= 1.3.0 )
231
232
web-console (~> 2.0 )
233
+ will_paginate
232
234
233
235
RUBY VERSION
234
236
ruby 2.3.4p301
Original file line number Diff line number Diff line change @@ -92,3 +92,52 @@ body, main
92
92
93
93
.well--l
94
94
margin-bottom : $b-space-xl
95
+
96
+ .pagination
97
+ border : 1px solid #e5e5e5
98
+ text-align : center
99
+ margin : 0 0 1em 0
100
+ padding : 1em 0
101
+ cursor : default
102
+
103
+ a , span
104
+ padding : 0 0.4em
105
+
106
+ .disabled
107
+ color : #aaaaaa
108
+
109
+ .current
110
+ font-style : normal
111
+ font-weight : bold
112
+ background-color : $c-primary
113
+ color : $white
114
+ display : inline-block
115
+ width : 1.4em
116
+ height : 1.4em
117
+ line-height : 1.4
118
+ border-radius : $b-borderRadius
119
+
120
+ a
121
+ width : 1.4em
122
+ text-decoration : none
123
+ color : black
124
+ border-radius : $b-borderRadius
125
+ & :hover , & :focus
126
+ background-color : $c-primary
127
+ color : white
128
+
129
+ .previous_page , .next_page
130
+ width : auto
131
+ background-color : $c-primary
132
+ border-radius : $b-borderRadius
133
+ border : 1px solid transparent
134
+ color : $c-text-invert
135
+ cursor : pointer
136
+ display : inline-block
137
+ font-size : $b-fontSize
138
+ line-height : 2.5
139
+ padding : 0 $b-space
140
+ text-align : center
141
+ text-decoration : none
142
+ transition : $b-transition
143
+ white-space : nowrap
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ $b-lineHeight: 1.5
83
83
84
84
// ----- Settings ----- //
85
85
86
- $b-transition : 0.3 s ease-in-out
86
+ $b-transition : 0.2 s ease-in-out
87
87
88
88
// ----- Sizing ----- //
89
89
@@ -92,6 +92,7 @@ $b-maxWidth-s: em(700px)
92
92
$b-space : em(20px )
93
93
$b-space-xs : $b-space * 0.25
94
94
$b-space-s : $b-space * 0.5
95
+ $b-space-m : $b-space * 1
95
96
$b-space-l : $b-space * 2
96
97
$b-space-xl : $b-space * 4
97
98
Original file line number Diff line number Diff line change 14
14
.mbl
15
15
margin-bottom : $b-space-l
16
16
17
+ .mbm
18
+ margin-bottom : $b-space-m
19
+
17
20
// -------------------------------------
18
21
// Padding
19
22
// -------------------------------------
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ class ComplimentsController < ApplicationController
9
9
def index
10
10
@compliments = Compliment . includes (
11
11
:complimenter , :complimentee , :uphearts
12
- ) . public
12
+ ) . public . paginate ( page : params [ :page ] , per_page : 30 )
13
13
end
14
14
15
15
def given
Original file line number Diff line number Diff line change 1
- .split.mbl
1
+ .split.mbm
2
2
.split-cell
3
3
4
4
%ul .list.list--inline.list--inline--l
11
11
= link_to " New Compliment" , new_compliment_path, class: " btn"
12
12
= link_to " Download My Compliments" , received_compliments_path(format: :csv), class: " btn"
13
13
14
- - unless @compliments.empty?
14
+ - if @compliments.any?
15
+ = will_paginate @compliments
16
+
15
17
.g.collection.collection--1of2
18
+
16
19
- @compliments.each do |compliment|
17
20
.g-b.g-b--1of2.collection-item
18
21
= render compliment
22
+
23
+
24
+ = will_paginate @compliments
19
25
- else
20
26
%p .pal.tac.tcs.tsi There are no compliments currently. Say something nice :)
Original file line number Diff line number Diff line change 21
21
22
22
en :
23
23
hello : " Hello world"
24
+
25
+ will_paginate :
26
+ previous_label : " Previous"
27
+ next_label : " Next"
28
+ page_gap : " …"
You can’t perform that action at this time.
0 commit comments