Browse Source

More stuff

Maarten van den Berg 7 years ago
parent
commit
7c97dec636

+ 11 - 5
app/assets/javascripts/activities.coffee

@@ -28,16 +28,22 @@ $(document).on 'turbolinks:load', ->
28 28
 
29 29
 @filterparticipants = (e) ->
30 30
   show = e.target.value
31
-  if (show != 'all')
31
+  if (show == 'all')
32
+    $('.participant-row').show()
33
+    @updatecounts()
34
+    this.subgroupfilter = null
35
+  else if (show == 'withoutgroup')
36
+    selector = "tr.participant-row.success:not([data-subgroup-id])"
37
+    $('.participant-row').hide()
38
+    $(selector).show()
39
+    @updatecounts()
40
+    this.subgroupfilter = show
41
+  else
32 42
     selector = "[data-subgroup-id=" + e.target.value + "]"
33 43
     $('.participant-row').hide()
34 44
     $(selector).show()
35 45
     @updatecounts(show)
36 46
     this.subgroupfilter = show
37
-  else
38
-    $('.participant-row').show()
39
-    @updatecounts()
40
-    this.subgroupfilter = null
41 47
 
42 48
 @updatecounts = (subgroupid) ->
43 49
   selector = 'tr.countable.participant-row'

+ 2 - 1
app/controllers/activities_controller.rb

@@ -53,7 +53,8 @@ class ActivitiesController < ApplicationController
53 53
     @subgroup_ids = @activity.subgroups
54 54
       .order(name: :asc)
55 55
       .pluck(:name, :id)
56
-    @subgroup_ids.prepend( ['*' , 'all'] )
56
+    @subgroup_ids.prepend( [I18n.t('activities.subgroups.filter_nofilter'), 'all'] )
57
+    @subgroup_ids.append( [I18n.t('activities.subgroups.filter_nogroup'), 'withoutgroup'] )
57 58
   end
58 59
 
59 60
   # GET /activities/new

+ 9 - 0
config/locales/activities/en.yml

@@ -82,6 +82,7 @@ en:
82 82
         subject: "You have been assigned to subgroup %{subgroup} for %{activity}"
83 83
         yoursubgroupis: "The upcoming activity %{activity} uses subgroups, and you have been assigned to subgroup %{subgroup}."
84 84
         subgroupmembers: "The other people in this subgroup are: %{others}"
85
+        noothersinsubgroup: "There are no other people in this subgroup. :("
85 86
         allsubgroups: "All subgroups (including yours):"
86 87
         cannotdecline: "This email was sent when the deadline expired. If you find you cannot attend, please contact the Drerrie, or one of the organisers (%{organizers})."
87 88
 
@@ -91,6 +92,9 @@ en:
91 92
       created: 'Subgroup created.'
92 93
       create_failed: 'Could not create subgroup!'
93 94
 
95
+      edit: 'Edit subgroup division'
96
+      edited: 'Subgroup division updated.'
97
+
94 98
       update: 'Update subgroup'
95 99
       updated: 'Subgroup updated.'
96 100
       update_failed: 'Could not update subgroup!'
@@ -98,3 +102,8 @@ en:
98 102
       destroy: 'Destroy subgroup'
99 103
       destroyed: 'Subgroup destroyed.'
100 104
       none: 'There are no subgroups.'
105
+
106
+      filter_nogroup: 'Attending, no subgroup'
107
+      filter_nofilter: 'Show everyone'
108
+
109
+      only_present_people: "Only people who will attend are listed, because people who don't cannot be in a subgroup."

+ 4 - 0
config/locales/activities/nl.yml

@@ -84,6 +84,7 @@ nl:
84 84
         subject: "Je bent automatisch aangemeld voor %{activity}"
85 85
         havenot_responded: "Je hebt nog niet aangegeven of je bij %{activity} kunt zijn. Omdat we ervan uitgaan dat je er bent als je niks aangeeft, is je reactie automatisch op 'aanwezig' gezet."
86 86
         if_cannot: "Als je toch niet aanwezig kunt zijn, kan je dit tot %{deadline} aangeven via de volgende link:"
87
+
87 88
       subgroup_notification:
88 89
         subject: "Je bent ingedeeld in subgroep %{subgroup} voor %{activity}"
89 90
         yoursubgroupis: "De aankomende opkomst %{activity} gebruikt subgroepen, en jij bent ingedeeld in subgroep %{subgroup}."
@@ -109,4 +110,7 @@ nl:
109 110
       destroyed: 'Subgroep verwijderd.'
110 111
       none: 'Er zijn geen subgroepen.'
111 112
 
113
+      filter_nogroup: 'Aangemeld, geen groep'
114
+      filter_nofilter: 'Toon iedereen'
115
+
112 116
       only_present_people: 'Je ziet alleen maar mensen die zijn aangemeld in dit overzicht, omdat mensen die zijn afgemeld niet in een subgroep kunnen zitten.'