Skip to content

Commit 7284d1b

Browse files
committed
Update design to be more mobile-friendly
1 parent e0e6e98 commit 7284d1b

7 files changed

Lines changed: 89 additions & 89 deletions

File tree

‎app/views/devise/registrations/edit.html.slim‎

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ section.container
1111

1212
h4 = t('views.registrations.personal_data')
1313
.row
14-
.col-6
14+
.col-md-9.col-lg-6.col-12
1515
.row
16-
.col-12
17-
.col-6
16+
.col-md-6.col-12
1817
= f.input :first_name, required: true
19-
.col-6
18+
.col-md-6.col-12
2019
= f.input :last_name, required: true
2120
.col-12
2221
= f.input :username, required: true
@@ -26,14 +25,13 @@ section.container
2625
p
2726
| Currently waiting confirmation for:
2827
=< resource.unconfirmed_email
29-
.col-md-3
30-
.col-6.col-md-3
28+
.col-12.col-md-3.offset-lg-3
3129
.row
3230
= f.input :locale, collection: I18n.available_locales, required: true, class: ''
3331
.row
3432
.row.edit_gravatar
3533
.col.d-flex.justify-content-center
36-
= image_tag resource.picture(192)
34+
= image_tag resource.picture(192), class: 'img-fluid'
3735
.row
3836
.col.d-flex.justify-content-center
3937
span.overlay
@@ -45,22 +43,22 @@ section.container
4543
= f.input :announce_my_presence, hint: t('views.registrations.announce_my_presence_explanation')
4644

4745
.row
48-
.col-6
46+
.col-md-6.col-12
4947
= f.input :password, autocomplete: "off", hint: t('views.registrations.leave_blank_if_you_do_not_want_to_change'), required: false
50-
.col-6
48+
.col-md-6.col-12
5149
= f.input :password_confirmation, required: false
5250

5351
hr
5452
h4 = t('views.registrations.phones')
5553
.row
56-
.col-6
54+
.col-md-6.col-12
5755
.row
5856
= f.input :pin, as: :password, autocomplete: "off", required: false
5957
= f.input :pin_confirmation, as: :password, required: false
6058
.col-12.d-grid
6159
= link_to_add_association t('views.registrations.add_phone_number'), f, :phone_numbers, role: 'button', class: 'btn btn-primary', data: {'association-insertion-node' => '#phone_numbers', 'association-insertion-method' => 'append'}
6260

63-
.col-6#phone_numbers
61+
.col-md-6.col-12#phone_numbers
6462
= f.simple_fields_for :phone_numbers do |phone_numbers_form|
6563
= render 'phone_number_fields', f: phone_numbers_form
6664

@@ -70,26 +68,26 @@ section.container
7068
h4 = t('views.registrations.socials')
7169

7270
.row
73-
.col-3
71+
.col-md-6.col-lg-3.col-12
7472
= f.input :github
75-
.col-3
73+
.col-md-6.col-lg-3.col-12
7674
= f.input :url
77-
.col-3
75+
.col-md-6.col-lg-3.col-12
7876
= f.input :twitter
79-
.col-3
77+
.col-md-6.col-lg-3.col-12
8078
= f.input :jabber
8179

8280
hr
8381

8482
.row.align-items-end
85-
.col-6
83+
.col-md-6.col-12
8684
= f.input :current_password, hint: t('views.registrations.we_need_your_current_password'), required: true, wrapper_html: {class: 'has-warning'}
8785
.form-actions.d-grid.g-2
8886
= f.button :submit, t('views.registrations.update')
89-
.col-3
90-
.col-3
87+
.col-md-6.col-lg-3.offset-lg-3.col-12
9188
.row
92-
= t('views.registrations.unhappy')
93-
= link_to t('views.registrations.cancel_my_account'), registration_path(resource_name), data: { confirm: t('views.registrations.are_you_sure') }, method: :delete, class: 'btn btn-danger'
89+
.col-12.d-grid
90+
= t('views.registrations.unhappy')
91+
= link_to t('views.registrations.cancel_my_account'), registration_path(resource_name), data: { confirm: t('views.registrations.are_you_sure') }, method: :delete, class: 'btn btn-danger'
9492
.clearfix
9593

‎app/views/devise/registrations/new.html.slim‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@ section.container
99
= f.error_notification
1010
.form-inputs
1111
.row
12-
.col-6 = f.input :email, required: true, autofocus: true
13-
.col-6 = f.input :username, required: true, autofocus: true
14-
.row
15-
.col-6 = f.input :first_name, required: true, autofocus: true
16-
.col-6 = f.input :last_name, required: true, autofocus: true
17-
.row
18-
.col-6 = f.input :password, required: true, hint: (t("views.registrations.minimum_characters", minimum: @minimum_password_length) if @validatable)
19-
.col-6 = f.input :password_confirmation, required: true
12+
.col-md-6.col-12 = f.input :email, required: true, autofocus: true
13+
.col-md-6.col-12 = f.input :username, required: true, autofocus: true
14+
.col-md-6.col-12 = f.input :first_name, required: true, autofocus: true
15+
.col-md-6.col-12 = f.input :last_name, required: true, autofocus: true
16+
.col-md-6.col-12 = f.input :password, required: true, hint: (t("views.registrations.minimum_characters", minimum: @minimum_password_length) if @validatable)
17+
.col-md-6.col-12 = f.input :password_confirmation, required: true
2018
.form-actions
2119
= f.button :submit, t('views.registrations.sign_me_up')
2220
= render "devise/shared/links"
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
= form_for @user.user_roles.new, url: fauna_user_role_assignments_path, html: { class: 'row m-0 p-0 row-cols-xs-auto g-3 align-items-end' } do |f|
2-
.col-2
2+
.col-lg-2.col-12
33
= f.label :role, class: 'form-label fw-bold'
44
= f.select :role, Role.all.map { |r| [r.localized_name.to_s, r.id] }, {}, { required: true, selected: nil, class: 'form-select' }
5-
.col-4
5+
.col-md-6.col-lg-4.col-12
66
= f.label :start_time, class: 'form-label fw-bold'
77
= f.datetime_field :start_time, as: :date, html5: true, class: 'form-control', value: Time.current
8-
.col-4
8+
.col-md-6.col-lg-4.col-12
99
= f.label :end_time, class: 'form-label fw-bold'
1010
= f.datetime_field :end_time, as: :date, html5: true, class: 'form-control'
11-
.col-2.d-grid
11+
.col-lg-2.col-12.d-grid
1212
= f.button :submit, class: 'btn btn-success'

‎app/views/fauna/role_assignments/index.html.slim‎

Lines changed: 49 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -19,56 +19,59 @@ section.container
1919
.row.my-3
2020
.col
2121
h4 = t 'views.roles.current'
22-
table.table.table-hover.table-sm.m-2.table-responsive
23-
thead
24-
tr
25-
th.col-2[scope='col'] = UserRole.human_attribute_name :role
26-
th.col-4[scope='col'] = UserRole.human_attribute_name :start_time
27-
th.col-4[scope='col'] = UserRole.human_attribute_name :end_time
28-
th.col-2
29-
tbody
30-
- @user.user_roles.order(end_time: :desc).each do |ur|
22+
.table-responsive-lg
23+
table.table.table-hover.table-sm.m-2
24+
thead
3125
tr
32-
td = ur.role.localized_name
33-
td = ur.start_time.localtime
34-
td = ur.end_time&.localtime
35-
td
36-
= form_tag fauna_user_role_assignment_path(id: ur.role_id), method: :delete, class: 'd-grid' do
37-
= hidden_field_tag :start_time, value: ur.start_time
38-
= button_tag icon('fa-solid', :close, t('views.roles.deactivate')), class: 'btn btn-danger btn-sm m-0'
26+
th.col-2[scope='col'] = UserRole.human_attribute_name :role
27+
th.col-4[scope='col'] = UserRole.human_attribute_name :start_time
28+
th.col-4[scope='col'] = UserRole.human_attribute_name :end_time
29+
th.col-2
30+
tbody
31+
- @user.user_roles.order(end_time: :desc).each do |ur|
32+
tr
33+
td = ur.role.localized_name
34+
td = ur.start_time.localtime
35+
td = ur.end_time&.localtime
36+
td
37+
= form_tag fauna_user_role_assignment_path(id: ur.role_id), method: :delete, class: 'd-grid' do
38+
= hidden_field_tag :start_time, value: ur.start_time
39+
= button_tag icon('fa-solid', :close, t('views.roles.deactivate')), class: 'btn btn-danger btn-sm m-0'
3940
hr
4041
h4 = t 'views.roles.future'
41-
table.table.table-hover.table-sm.m-2.table-responsive
42-
thead
43-
tr
44-
th.col-2[scope='col'] = UserRole.human_attribute_name :role
45-
th.col-4[scope='col'] = UserRole.human_attribute_name :start_time
46-
th.col-4[scope='col'] = UserRole.human_attribute_name :end_time
47-
th.col-2
48-
tbody
49-
- @user.user_roles.future.order(end_time: :desc).each do |ur|
42+
.table-responsive-lg
43+
table.table.table-hover.table-sm.m-2
44+
thead
5045
tr
51-
td = ur.role.localized_name
52-
td = ur.start_time.localtime
53-
td = ur.end_time&.localtime
54-
td
55-
= form_tag fauna_user_role_assignment_path(id: ur.role_id), method: :delete, class: 'd-grid' do
56-
= hidden_field_tag :start_time, value: ur.start_time
57-
= button_tag icon('fa-solid', :trash, t('views.roles.cancel')), class: 'btn btn-danger btn-sm m-0'
46+
th.col-2[scope='col'] = UserRole.human_attribute_name :role
47+
th.col-4[scope='col'] = UserRole.human_attribute_name :start_time
48+
th.col-4[scope='col'] = UserRole.human_attribute_name :end_time
49+
th.col-2
50+
tbody
51+
- @user.user_roles.future.order(end_time: :desc).each do |ur|
52+
tr
53+
td = ur.role.localized_name
54+
td = ur.start_time.localtime
55+
td = ur.end_time&.localtime
56+
td
57+
= form_tag fauna_user_role_assignment_path(id: ur.role_id), method: :delete, class: 'd-grid' do
58+
= hidden_field_tag :start_time, value: ur.start_time
59+
= button_tag icon('fa-solid', :trash, t('views.roles.cancel')), class: 'btn btn-danger btn-sm m-0'
5860
hr
5961
h4 = t 'views.roles.expired'
60-
table.table.table-hover.table-sm.m-2.table-responsive
61-
thead
62-
tr
63-
th.col-2[scope='col'] = UserRole.human_attribute_name :role
64-
th.col-4[scope='col'] = UserRole.human_attribute_name :start_time
65-
th.col-4[scope='col'] = UserRole.human_attribute_name :end_time
66-
th.col-2
67-
68-
tbody
69-
- @user.user_roles.expired.order(end_time: :desc).each do |ur|
62+
.table-responsive-lg
63+
table.table.table-hover.table-sm.m-2
64+
thead
7065
tr
71-
td = ur.role.localized_name
72-
td = ur.start_time.localtime
73-
td = ur.end_time&.localtime
74-
td
66+
th.col-2[scope='col'] = UserRole.human_attribute_name :role
67+
th.col-4[scope='col'] = UserRole.human_attribute_name :start_time
68+
th.col-4[scope='col'] = UserRole.human_attribute_name :end_time
69+
th.col-2
70+
71+
tbody
72+
- @user.user_roles.expired.order(end_time: :desc).each do |ur|
73+
tr
74+
td = ur.role.localized_name
75+
td = ur.start_time.localtime
76+
td = ur.end_time&.localtime
77+
td

‎app/views/fauna/users/_user.html.slim‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ tr
33
td = user.username
44
td = user.email
55
td.d-flex
6-
ul.list-group.list-group-horizontal-md.align-items-center.border-primary.small
6+
ul.list-group.list-group-horizontal-md.border-primary.small
77
- Role.predefined.each do |predefined_role|
88
- if user.role? predefined_role.name
99
/ TODO: hidden form here

‎app/views/fauna/users/index.html.slim‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ section.container
77
.users
88
.row
99
.col-sm-12
10-
table.table.table-hover.table-sm.m-2.table-responsive
11-
thead
12-
tr
13-
th.col-2[scope='col'] = User.human_attribute_name(:name)
14-
th.col-2[scope='col'] = User.human_attribute_name(:username)
15-
th.col-2[scope='col'] = User.human_attribute_name(:email)
16-
th.col-6[scope='col'] = User.human_attribute_name(:roles)
17-
tbody#user_table
18-
= render @users
10+
.table-responsive-lg
11+
table.table.table-hover.table-sm.m-2
12+
thead
13+
tr
14+
th.col-2[scope='col'] = User.human_attribute_name(:name)
15+
th.col-2[scope='col'] = User.human_attribute_name(:username)
16+
th.col-2[scope='col'] = User.human_attribute_name(:email)
17+
th.col-6[scope='col'] = User.human_attribute_name(:roles)
18+
tbody#user_table
19+
= render @users

‎app/views/layouts/_navigation.html.slim‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ nav class="py-0 navbar navbar-expand-lg #{content_for?(:nav_color) ? yield(:nav_
22
.container
33
= link_to root_url, class: "navbar-brand", active: false do
44
= image_tag 'initlab-logo.svg', class: 'logo', height: '47px', alt: 'Fauna'
5-
button.navbar-toggler data-target="#navbar-collapse" data-toggle="collapse" type="button"
5+
button.navbar-toggler data-bs-target="#navbar-collapse" data-bs-toggle="collapse" type="button"
66
span.navbar-toggler-icon
77

88
.navbar-collapse.collapse#navbar-collapse

0 commit comments

Comments
 (0)