Selaa lähdekoodia

Split mobile participant row to partial, fontawesome update

Maarten van den Berg 6 vuotta sitten
vanhempi
commit
b65e2b91e6

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

@@ -0,0 +1,15 @@
1
+- p = participant
2
+- all_buttons = show_all_buttons
3
+%tr.participant-row{data: {person_id: p.person.id, activity_id: @activity.id, subgroup_id: p.subgroup_id}}
4
+  %td
5
+    = p.person.full_name
6
+    - if p.is_organizer
7
+      %i.far.fa-star
8
+
9
+  %td
10
+    - if p.person.id == current_person.id || all_buttons
11
+      = render partial: "activities/presence_buttons", locals: {activity: @activity, person: p.person, state: p.attending}
12
+
13
+  %tr.participant-row{data: {person_id: p.person_id, activity_id: @activity.id, subgroup_id: p.subgroup_id}}
14
+    %td{colspan: "2"}
15
+      = editable p, :notes, url: presence_group_activity_path(@activity.group, @activity, person_id: p.person_id), title: t('activities.participant.notes'), value: p.notes, emptytext: "--"

+ 4 - 4
app/views/activities/_presence_buttons.haml

@@ -1,12 +1,12 @@
1 1
 .btn-group.btn-group-xs{role: "group"}
2 2
   %button.btn.btn-success.btn-present.btn-presence{data: {person_id: person.id, activity_id: activity.id, group_id: activity.group.id, new_state: "present"}}
3 3
     - if !state
4
-      %i.fa.fa-check
4
+      %i.fas.fa-check
5 5
     - else
6
-      %i.fa.fa-check-circle
6
+      %i.fas.fa-check-circle
7 7
 
8 8
   %button.btn.btn-danger.btn-absent.btn-presence{data: {person_id: person.id, activity_id: activity.id, group_id: activity.group.id, new_state: "absent"}}
9 9
     - if state == false
10
-      %i.fa.fa-times-circle
10
+      %i.fas.fa-times-circle
11 11
     - else
12
-      %i.fa.fa-times
12
+      %i.fas.fa-times

+ 4 - 4
app/views/activities/_wide_presence_buttons.haml

@@ -2,15 +2,15 @@
2 2
   .btn-group
3 3
     %button.btn.btn-success.btn-present.btn-presence{data: {wide: 1, person_id: person.id, activity_id: activity.id, group_id: activity.group.id, new_state: "present"}}
4 4
       - if !state
5
-        %i.fa.fa-check
5
+        %i.fas.fa-check
6 6
       - else
7
-        %i.fa.fa-check-circle
7
+        %i.fas.fa-check-circle
8 8
       = t 'activities.state.present'
9 9
 
10 10
   .btn-group
11 11
     %button.btn.btn-danger.btn-absent.btn-presence{data: {wide: 1, person_id: person.id, activity_id: activity.id, group_id: activity.group.id, new_state: "absent"}}
12 12
       - if state == false
13
-        %i.fa.fa-times-circle
13
+        %i.fas.fa-times-circle
14 14
       - else
15
-        %i.fa.fa-times
15
+        %i.fas.fa-times
16 16
       = t 'activities.state.absent'

+ 7 - 7
app/views/activities/edit.html.haml

@@ -61,7 +61,7 @@
61 61
             = f.check_box :is_assignable
62 62
             = t 'activerecord.attributes.subgroup.is_assignable'
63 63
             (
64
-            %i.fa.fa-random
64
+            %i.fas.fa-random
65 65
             )
66 66
 
67 67
       = f.submit t('activities.subgroups.create'), class: 'btn btn-success'
@@ -77,10 +77,10 @@
77 77
             = t 'activerecord.attributes.subgroup.name'
78 78
 
79 79
           %th
80
-            %i.fa.fa-random
80
+            %i.fas.fa-random
81 81
 
82 82
           %th
83
-            %i.fa.fa-cogs
83
+            %i.fas.fa-cogs
84 84
         - @subgroups.each do |sg|
85 85
           %tr
86 86
             %td
@@ -90,16 +90,16 @@
90 90
             %td
91 91
               = link_to group_activity_update_subgroup_path(@group, @activity, sg.id, 'subgroup[is_assignable]' => !sg.is_assignable), method: :patch, class: 'btn btn-default btn-xs' do
92 92
                 - if sg.is_assignable
93
-                  %i.fa.fa-check
93
+                  %i.fas.fa-check
94 94
                 - else
95
-                  %i.fa.fa-times
95
+                  %i.fas.fa-times
96 96
 
97 97
             %td
98 98
               = link_to group_activity_destroy_subgroup_path(@group, @activity, sg.id), method: :delete, class: 'btn btn-danger btn-xs', data: {confirm: I18n.t(:areyousure)} do
99
-                %i.fa.fa-trash
99
+                %i.fas.fa-trash
100 100
 
101 101
       = link_to(group_activity_edit_subgroups_path(@group, @activity), class: 'btn btn-default') do
102
-        %i.fa.fa-edit
102
+        %i.fas.fa-edit
103 103
         = t 'activities.subgroups.edit'
104 104
 
105 105
 

+ 4 - 4
app/views/activities/index.html.haml

@@ -8,15 +8,15 @@
8 8
 .btn-group.pull-right
9 9
   - if params[:past]
10 10
     = link_to group_activities_path(@group), class: 'btn btn-default' do
11
-      %i.fa.fa-history
11
+      %i.fas.fa-history
12 12
       = t 'activities.upcoming'
13 13
   - else
14 14
     = link_to group_activities_path(@group, past: true), class: 'btn btn-default' do
15
-      %i.fa.fa-history
15
+      %i.fas.fa-history
16 16
       = t 'activities.past'
17 17
   - if isleader
18 18
     = link_to new_group_activity_path(@group), class: 'btn btn-default' do
19
-      %i.fa.fa-plus
19
+      %i.fas.fa-plus
20 20
       = t 'activities.new'
21 21
 
22 22
 %table.table
@@ -49,6 +49,6 @@
49 49
         - if isleader
50 50
           %td
51 51
             = link_to edit_group_activity_path(@group, a) do
52
-              %i.fa.fa-pencil
52
+              %i.fas.fa-pencil-alt
53 53
 
54 54
 = will_paginate @activities

+ 14 - 51
app/views/activities/show.html.haml

@@ -5,21 +5,21 @@
5 5
       .panel-heading
6 6
         .btn-group.pull-right
7 7
           %button.btn.btn-default.dropdown-toggle.btn-xs{data: {toggle: 'dropdown'}, 'aria-haspopup': true, 'aria-expanded': false}
8
-            %i.fa.fa-cogs
8
+            %i.fas.fa-cogs
9 9
             %span.caret
10 10
           %ul.dropdown-menu
11 11
             %li
12 12
               %a.copy-reactions{data: {activity: @activity.id, absent: true}}
13
-                %i.fa.fa-files-o
13
+                %i.fas.fa-copy
14 14
                 = t 'activities.participant.copy_absent'
15 15
               %a.copy-reactions{data: {activity: @activity.id, present: true, absent: true, unknown: true}}
16
-                %i.fa.fa-files-o
16
+                %i.fas.fa-copy
17 17
                 = t 'activities.participant.copy_responses'
18 18
             - if all_buttons
19 19
               %li.divider{role: 'separator'}
20 20
               %li
21 21
                 = link_to edit_group_activity_path(@group, @activity) do
22
-                  %i.fa.fa-pencil
22
+                  %i.fas.fa-pencil
23 23
                   = t :edit
24 24
         = @activity.name
25 25
 
@@ -115,7 +115,7 @@
115 115
         %td
116 116
           = p.person.full_name
117 117
           - if p.is_organizer
118
-            %i.fa.fa-star-o
118
+            %i.fas.fa-star-o
119 119
 
120 120
         %td
121 121
           = editable p, :notes, url: presence_group_activity_path(@activity.group, @activity, person_id: p.person_id), title: t('activities.participant.notes'), value: p.notes, emptytext: "--"
@@ -137,10 +137,10 @@
137 137
       %a{role: 'button', href: '#present-collapse', data: {toggle: 'collapse'}, 'aria-expanded': 'false'}
138 138
 
139 139
         %span.sv-show-collapsed
140
-          %i.fa.fa-angle-down
140
+          %i.fas.fa-angle-down
141 141
 
142 142
         %span.sv-show-expanded
143
-          %i.fa.fa-angle-up
143
+          %i.fas.fa-angle-up
144 144
 
145 145
         = t 'activities.state.present'
146 146
         %span.badge.state-count.present-count
@@ -149,30 +149,17 @@
149 149
     %table.table.collapse#present-collapse
150 150
       %tbody
151 151
         - @participants.where(attending: true).each do |p|
152
-          %tr.participant-row{data: {person_id: p.person.id, activity_id: @activity.id, subgroup_id: p.subgroup_id}}
153
-            %td
154
-              = p.person.full_name
155
-              - if p.is_organizer
156
-                %i.fa.fa-star-o
157
-
158
-            %td
159
-              - if p.person.id == current_person.id || all_buttons
160
-                = render partial: "activities/presence_buttons", locals: {activity: @activity, person: p.person, state: p.attending}
161
-
162
-          %tr.participant-row{data: {person_id: p.person_id, activity_id: @activity.id, subgroup_id: p.subgroup_id}}
163
-            %td{colspan: "2"}
164
-              = editable p, :notes, url: presence_group_activity_path(@activity.group, @activity, person_id: p.person_id), title: t('activities.participant.notes'), value: p.notes, emptytext: "--"
165
-
152
+          = render partial: "mobile_participant_row", locals: {participant: p, show_all_buttons: all_buttons}
166 153
 
167 154
   .panel.panel-default
168 155
     .panel-heading
169 156
       %a{role: 'button', href: '#unknown-collapse', data: {toggle: 'collapse'}, 'aria-expanded': 'false'}
170 157
 
171 158
         %span.sv-show-collapsed
172
-          %i.fa.fa-angle-down
159
+          %i.fas.fa-angle-down
173 160
 
174 161
         %span.sv-show-expanded
175
-          %i.fa.fa-angle-up
162
+          %i.fas.fa-angle-up
176 163
 
177 164
         = t 'activities.state.need_response'
178 165
 
@@ -182,29 +169,17 @@
182 169
     %table.table.collapse#unknown-collapse
183 170
       %tbody
184 171
         - @participants.where(attending: nil).each do |p|
185
-          %tr.participant-row{data: {person_id: p.person.id, activity_id: @activity.id, subgroup_id: p.subgroup_id}}
186
-            %td
187
-              = p.person.full_name
188
-              - if p.is_organizer
189
-                %i.fa.fa-star-o
190
-
191
-            %td
192
-              - if p.person.id == current_person.id || all_buttons
193
-                = render partial: "activities/presence_buttons", locals: {activity: @activity, person: p.person, state: p.attending}
194
-
195
-          %tr.participant-row{data: {person_id: p.person_id, activity_id: @activity.id, subgroup_id: p.subgroup_id}}
196
-            %td{colspan: "2"}
197
-              = editable p, :notes, url: presence_group_activity_path(@activity.group, @activity, person_id: p.person_id), title: t('activities.participant.notes'), value: p.notes, emptytext: "--"
172
+          = render partial: "mobile_participant_row", locals: {participant: p, show_all_buttons: all_buttons}
198 173
 
199 174
   .panel.panel-default.panel-danger
200 175
     .panel-heading
201 176
       %a{role: 'button', href: '#absent-collapse', data: {toggle: 'collapse'}, 'aria-expanded': 'false'}
202 177
 
203 178
         %span.sv-show-collapsed
204
-          %i.fa.fa-angle-down
179
+          %i.fas.fa-angle-down
205 180
 
206 181
         %span.sv-show-expanded
207
-          %i.fa.fa-angle-up
182
+          %i.fas.fa-angle-up
208 183
 
209 184
         = t 'activities.state.absent'
210 185
 
@@ -214,16 +189,4 @@
214 189
     %table.table.collapse#absent-collapse
215 190
       %tbody
216 191
         - @participants.where(attending: false).each do |p|
217
-          %tr.participant-row{data: {person_id: p.person.id, activity_id: @activity.id, subgroup_id: p.subgroup_id}}
218
-            %td
219
-              = p.person.full_name
220
-              - if p.is_organizer
221
-                %i.fa.fa-star-o
222
-
223
-            %td
224
-              - if p.person.id == current_person.id || all_buttons
225
-                = render partial: "activities/presence_buttons", locals: {activity: @activity, person: p.person, state: p.attending}
226
-
227
-          %tr.participant-row{data: {person_id: p.person_id, activity_id: @activity.id, subgroup_id: p.subgroup_id}}
228
-            %td{colspan: "2"}
229
-              = editable p, :notes, url: presence_group_activity_path(@activity.group, @activity, person_id: p.person_id), title: t('activities.participant.notes'), value: p.notes, emptytext: "--"
192
+          = render partial: "mobile_participant_row", locals: {participant: p, show_all_buttons: all_buttons}

+ 1 - 1
app/views/authentication/logout_confirm.html.haml

@@ -4,7 +4,7 @@
4 4
       = t :areyousure
5 5
     .panel-body
6 6
       = link_to logout_path, method: :delete, class: 'btn btn-danger' do
7
-        %i.fa.fa-sign-out{'aria-hidden': true}
7
+        %i.fas.fa-sign-out-alt{'aria-hidden': true}
8 8
         = t :log_out
9 9
       = link_to root_path, class: 'btn btn-default' do
10 10
         = t :cancel

+ 2 - 2
app/views/dashboard/home.html.haml

@@ -45,10 +45,10 @@
45 45
               %a{role: 'button', href: '#needresponse-collapse', data: {toggle: 'collapse'}, 'aria-expanded': 'false'}
46 46
 
47 47
                 %span.sv-show-collapsed
48
-                  %i.fa.fa-angle-down
48
+                  %i.fas.fa-angle-down
49 49
 
50 50
                 %span.sv-show-expanded
51
-                  %i.fa.fa-angle-up
51
+                  %i.fas.fa-angle-up
52 52
 
53 53
                 = t 'activities.state.need_response'
54 54
                 %span.badge

+ 2 - 2
app/views/dashboard/settings.html.haml

@@ -14,14 +14,14 @@
14 14
         = text_field_tag(:calurl, person_calendar_url(@person.calendar_token), readonly: true, id: 'calurl', class: 'form-control')
15 15
         %span.input-group-btn
16 16
           = button_tag(class: 'btn btn-default copy-url', data: {'clipboard-target': '#calurl'}) do
17
-            %i.fa.fa-files-o
17
+            %i.far.fa-files
18 18
 
19 19
     .form-group
20 20
       .input-group
21 21
         = text_field_tag(:calurl_nocancel, person_calendar_url(@person.calendar_token, skipcancel: 1), readonly: true, id: 'calurl-skipcancel', class: 'form-control')
22 22
         %span.input-group-btn
23 23
           = button_tag(class: 'btn btn-default copy-url', data: {'clipboard-target': '#calurl-skipcancel'}) do
24
-            %i.fa.fa-files-o
24
+            %i.far.fa-files
25 25
 
26 26
 %h2
27 27
   = t 'settings.email_settings'

+ 6 - 6
app/views/shared/_menu.html.haml

@@ -14,31 +14,31 @@
14 14
       %ul.nav.navbar-nav
15 15
         %li
16 16
           = link_to root_path do
17
-            %i.fa.fa-home{'aria-hidden': true}
17
+            %i.fas.fa-home{'aria-hidden': true}
18 18
             Home
19 19
 
20 20
         %li
21 21
           = link_to user_groups_path do
22
-            %i.fa.fa-users{'aria-hidden': true}
22
+            %i.fas.fa-users{'aria-hidden': true}
23 23
             = t 'groups.plural'
24 24
 
25 25
         - if current_person.is_admin?
26 26
           %li
27 27
             = link_to people_path do
28
-              %i.fa.fa-user{'aria-hidden': true}
28
+              %i.fas.fa-user{'aria-hidden': true}
29 29
               = t 'person.plural'
30 30
 
31 31
           %li
32 32
             = link_to groups_path do
33
-              %i.fa.fa-users{'aria-hidden': true}
33
+              %i.fas.fa-users{'aria-hidden': true}
34 34
               = t 'groups.all'
35 35
 
36 36
       %ul.nav.navbar-nav.navbar-right
37 37
         %li
38 38
           = link_to settings_path do
39
-            %i.fa.fa-cogs{'aria-hidden': true}
39
+            %i.fas.fa-cogs{'aria-hidden': true}
40 40
             = t 'settings.settings'
41 41
         %li
42 42
           = link_to logout_path, confirm: "Really log out?", method: :delete do
43
-            %i.fa.fa-sign-out{'aria-hidden': true}
43
+            %i.fas.fa-sign-out-alt{'aria-hidden': true}
44 44
             = t 'log_out'