Browse Source

Previous/next buttons

Maarten van den Berg 6 years ago
parent
commit
cea66c0de8

+ 7 - 0
app/assets/stylesheets/application.scss

99
   margin-top: 0;
99
   margin-top: 0;
100
   margin-bottom: 0;
100
   margin-bottom: 0;
101
 }
101
 }
102
+
103
+/* Ellipsis fixes for previous/next buttons. */
104
+.ellipsize-50 {
105
+  overflow: hidden;
106
+  text-overflow: ellipsis;
107
+  max-width: 50%;
108
+}

+ 15 - 0
app/views/activities/_prev_next.html.haml

1
+.row.form-group
2
+  .col-xs-12
3
+    - if @activity.previous_in_group
4
+      = link_to group_activity_path(@group, @activity.previous_in_group), class: 'btn btn-default ellipsize-50' do
5
+        %span
6
+          %i.fas.fa-arrow-left
7
+        %span
8
+          = @activity.previous_in_group.name
9
+
10
+    - if @activity.next_in_group
11
+      = link_to group_activity_path(@group, @activity.next_in_group), class: 'btn btn-default ellipsize-50 pull-right' do
12
+        %span.pull-right{style: "margin-left: 3px"}
13
+          %i.fas.fa-arrow-right
14
+        %span
15
+          = @activity.next_in_group.name

+ 1 - 0
app/views/activities/edit.html.haml

1
+= render partial: 'activities/prev_next'
1
 %h1
2
 %h1
2
   = t 'activities.edit'
3
   = t 'activities.edit'
3
 
4
 

+ 2 - 0
app/views/activities/show.html.haml

1
 - all_buttons = @activity.may_change?(current_person)
1
 - all_buttons = @activity.may_change?(current_person)
2
+= render partial: 'activities/prev_next'
3
+
2
 .row
4
 .row
3
   .col-md-9
5
   .col-md-9
4
     .panel.panel-default
6
     .panel.panel-default

+ 3 - 0
config/locales/aardbei_en.yml

38
   send_email: "Send email"
38
   send_email: "Send email"
39
   overview: "Overzicht"
39
   overview: "Overzicht"
40
 
40
 
41
+  next: "Next"
42
+  previous: "Previous"
43
+
41
   somethingbroke: "Something broke!"
44
   somethingbroke: "Something broke!"
42
 
45
 
43
   areyousure: "Are you sure?"
46
   areyousure: "Are you sure?"

+ 3 - 0
config/locales/aardbei_nl.yml

17
   send_email: "Email versturen"
17
   send_email: "Email versturen"
18
   overview: "Overzicht"
18
   overview: "Overzicht"
19
 
19
 
20
+  next: "Volgende"
21
+  previous: "Vorige"
22
+
20
   areyousure: "Weet je het zeker?"
23
   areyousure: "Weet je het zeker?"
21
 
24
 
22
   somethingbroke: "Er is iets misgegaan! Neem contact op als dit blijft gebeuren."
25
   somethingbroke: "Er is iets misgegaan! Neem contact op als dit blijft gebeuren."