Browse Source

Hide fields in activity view if not set

Maarten van den Berg 7 years ago
parent
commit
64294081dc

+ 31 - 20
app/views/activities/show.html.haml

25
 
25
 
26
 
26
 
27
       %table.table
27
       %table.table
28
-        %tr
29
-          %td
30
-            = t 'activities.attrs.organizers'
31
-          %td
32
-            = @organizers
33
-        %tr
34
-          %td
35
-            = t 'activities.attrs.description'
36
-          %td
37
-            = @activity.description
28
+        - unless @organizers.blank?
29
+          %tr
30
+            %td
31
+              = t 'activities.attrs.organizers'
32
+            %td
33
+              = @organizers
38
 
34
 
39
-        %tr
40
-          %td
41
-            = t 'activities.attrs.where'
42
-          %td
43
-            = @activity.location
35
+        - unless @activity.description.blank?
36
+          %tr
37
+            %td
38
+              = t 'activities.attrs.description'
39
+            %td
40
+              = @activity.description
41
+
42
+        - unless @activity.location.blank?
43
+          %tr
44
+            %td
45
+              = t 'activities.attrs.where'
46
+            %td
47
+              = @activity.location
44
 
48
 
45
         %tr
49
         %tr
46
           %td
50
           %td
55
               - else
59
               - else
56
                 = l @activity.end, format: :long
60
                 = l @activity.end, format: :long
57
 
61
 
58
-        %tr
59
-          %td
60
-            = t 'activities.attrs.deadline'
62
+        - if @activity.deadline
63
+          %tr
64
+            %td
65
+              = t 'activities.attrs.deadline'
61
 
66
 
62
-          %td
63
-            - if @activity.deadline
67
+            %td
64
               = l @activity.deadline, format: :long
68
               = l @activity.deadline, format: :long
65
 
69
 
66
         - if @assignable_subgroups.any?
70
         - if @assignable_subgroups.any?
71
             %td
75
             %td
72
               = @assignable_subgroups.join(', ')
76
               = @assignable_subgroups.join(', ')
73
 
77
 
78
+        - if @ownparticipant&.subgroup
79
+          %tr
80
+            %td
81
+              = t 'activities.participant.yoursubgroup'
82
+            %td
83
+              = @ownparticipant.subgroup.name
84
+
74
   - if @ownparticipant
85
   - if @ownparticipant
75
     .col-md-3
86
     .col-md-3
76
       .panel.panel-default
87
       .panel.panel-default

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

29
       notes: "Notes"
29
       notes: "Notes"
30
       add_notes: "Add notes"
30
       add_notes: "Add notes"
31
       yourresponse: "Your response"
31
       yourresponse: "Your response"
32
+      yoursubgroup: "Your subgroup"
32
 
33
 
33
       copy_responses: "Copy responses"
34
       copy_responses: "Copy responses"
34
       copy_absent: "Copy absentees"
35
       copy_absent: "Copy absentees"

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

29
       notes: "Opmerkingen"
29
       notes: "Opmerkingen"
30
       add_notes: "Opmerkingen toevoegen"
30
       add_notes: "Opmerkingen toevoegen"
31
       yourresponse: "Jouw antwoord"
31
       yourresponse: "Jouw antwoord"
32
+      yoursubgroup: "Jouw subgroep"
32
 
33
 
33
       copy_responses: "Kopieer overzicht"
34
       copy_responses: "Kopieer overzicht"
34
       copy_absent: "Kopieer afwezigen"
35
       copy_absent: "Kopieer afwezigen"