浏览代码

More stuff

Maarten van den Berg 7 年之前
父节点
当前提交
7c97dec636

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

28
 
28
 
29
 @filterparticipants = (e) ->
29
 @filterparticipants = (e) ->
30
   show = e.target.value
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
     selector = "[data-subgroup-id=" + e.target.value + "]"
42
     selector = "[data-subgroup-id=" + e.target.value + "]"
33
     $('.participant-row').hide()
43
     $('.participant-row').hide()
34
     $(selector).show()
44
     $(selector).show()
35
     @updatecounts(show)
45
     @updatecounts(show)
36
     this.subgroupfilter = show
46
     this.subgroupfilter = show
37
-  else
38
-    $('.participant-row').show()
39
-    @updatecounts()
40
-    this.subgroupfilter = null
41
 
47
 
42
 @updatecounts = (subgroupid) ->
48
 @updatecounts = (subgroupid) ->
43
   selector = 'tr.countable.participant-row'
49
   selector = 'tr.countable.participant-row'

+ 2 - 1
app/controllers/activities_controller.rb

53
     @subgroup_ids = @activity.subgroups
53
     @subgroup_ids = @activity.subgroups
54
       .order(name: :asc)
54
       .order(name: :asc)
55
       .pluck(:name, :id)
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
   end
58
   end
58
 
59
 
59
   # GET /activities/new
60
   # GET /activities/new

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

82
         subject: "You have been assigned to subgroup %{subgroup} for %{activity}"
82
         subject: "You have been assigned to subgroup %{subgroup} for %{activity}"
83
         yoursubgroupis: "The upcoming activity %{activity} uses subgroups, and you have been assigned to subgroup %{subgroup}."
83
         yoursubgroupis: "The upcoming activity %{activity} uses subgroups, and you have been assigned to subgroup %{subgroup}."
84
         subgroupmembers: "The other people in this subgroup are: %{others}"
84
         subgroupmembers: "The other people in this subgroup are: %{others}"
85
+        noothersinsubgroup: "There are no other people in this subgroup. :("
85
         allsubgroups: "All subgroups (including yours):"
86
         allsubgroups: "All subgroups (including yours):"
86
         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
         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
       created: 'Subgroup created.'
92
       created: 'Subgroup created.'
92
       create_failed: 'Could not create subgroup!'
93
       create_failed: 'Could not create subgroup!'
93
 
94
 
95
+      edit: 'Edit subgroup division'
96
+      edited: 'Subgroup division updated.'
97
+
94
       update: 'Update subgroup'
98
       update: 'Update subgroup'
95
       updated: 'Subgroup updated.'
99
       updated: 'Subgroup updated.'
96
       update_failed: 'Could not update subgroup!'
100
       update_failed: 'Could not update subgroup!'
98
       destroy: 'Destroy subgroup'
102
       destroy: 'Destroy subgroup'
99
       destroyed: 'Subgroup destroyed.'
103
       destroyed: 'Subgroup destroyed.'
100
       none: 'There are no subgroups.'
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
         subject: "Je bent automatisch aangemeld voor %{activity}"
84
         subject: "Je bent automatisch aangemeld voor %{activity}"
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."
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
         if_cannot: "Als je toch niet aanwezig kunt zijn, kan je dit tot %{deadline} aangeven via de volgende link:"
86
         if_cannot: "Als je toch niet aanwezig kunt zijn, kan je dit tot %{deadline} aangeven via de volgende link:"
87
+
87
       subgroup_notification:
88
       subgroup_notification:
88
         subject: "Je bent ingedeeld in subgroep %{subgroup} voor %{activity}"
89
         subject: "Je bent ingedeeld in subgroep %{subgroup} voor %{activity}"
89
         yoursubgroupis: "De aankomende opkomst %{activity} gebruikt subgroepen, en jij bent ingedeeld in subgroep %{subgroup}."
90
         yoursubgroupis: "De aankomende opkomst %{activity} gebruikt subgroepen, en jij bent ingedeeld in subgroep %{subgroup}."
109
       destroyed: 'Subgroep verwijderd.'
110
       destroyed: 'Subgroep verwijderd.'
110
       none: 'Er zijn geen subgroepen.'
111
       none: 'Er zijn geen subgroepen.'
111
 
112
 
113
+      filter_nogroup: 'Aangemeld, geen groep'
114
+      filter_nofilter: 'Toon iedereen'
115
+
112
       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.'
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.'