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,22 +25,26 @@
25 25
 
26 26
 
27 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 49
         %tr
46 50
           %td
@@ -55,12 +59,12 @@
55 59
               - else
56 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 68
               = l @activity.deadline, format: :long
65 69
 
66 70
         - if @assignable_subgroups.any?
@@ -71,6 +75,13 @@
71 75
             %td
72 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 85
   - if @ownparticipant
75 86
     .col-md-3
76 87
       .panel.panel-default

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

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

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

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