Skip to content

Commit f97d046

Browse files
authored
Merge pull request #362 from codefirst/bootstrap-462
Update Bootstrap to 4.6.2
2 parents e208bcd + 1ebc034 commit f97d046

25 files changed

+303
-285
lines changed

.github/dependabot.yml

-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,3 @@ updates:
2626
- "@codemirror/*"
2727
ignore:
2828
- dependency-name: "bootstrap"
29-
- dependency-name: "jasny-bootstrap"

app/assets/stylesheets/main.css.scss

+17-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
body {
2-
padding-top: 60px;
2+
padding-top: 20px;
33
}
44

55
.navbar {
6+
.container {
7+
padding-left: 0;
8+
padding-right: 15px;
9+
}
610
.navbar-brand {
711
padding: 0;
812
img {
@@ -40,6 +44,14 @@ body {
4044
padding: 2px 6px;
4145
}
4246

47+
pre {
48+
background-color: #f5f5f5;
49+
border: 1px solid #ccc;
50+
border-radius: 4px;
51+
color: #333;
52+
padding: 9.5px;
53+
}
54+
4355
pre.run {
4456
margin-bottom: 20px;
4557
}
@@ -94,10 +106,10 @@ footer {
94106
ul.attachments {
95107
list-style-type: none;
96108
padding-left: 0;
97-
label {
98-
margin-left: 25px;
99-
margin-top: 5px;
100-
}
109+
}
110+
111+
.fileinput {
112+
display: block;
101113
}
102114

103115
.cm-editor {

app/helpers/application_helper.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ def title(text)
55
page_tilte << 'Sunline'
66
end
77

8-
# moneky patch for twitter-bootstrap-rails-2.2.8
8+
# Updated for Bootstrap 4.6.2
99
ALERT_TYPES = ['danger', 'info', 'success', 'warning']
1010
def bootstrap_flash_compat
1111
flash_messages = []
@@ -19,8 +19,8 @@ def bootstrap_flash_compat
1919

2020
Array(message).each do |msg|
2121
text = content_tag(:div,
22-
content_tag(:button, raw("&times;"), class: "close", "data-dismiss": "alert") +
23-
msg.html_safe, class: "alert fade in alert-#{type}")
22+
content_tag(:button, raw("&times;"), class: "close", "data-dismiss": "alert", "aria-label": "Close") +
23+
msg.html_safe, class: "alert alert-#{type} alert-dismissible fade show")
2424
flash_messages << text if msg
2525
end
2626
end

app/views/hosts/index.html.haml

+6-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
= t(:hosts_count)
99

1010
%table.table.table-striped
11-
- @hosts.each do |host|
11+
%thead
1212
%tr
13-
%td= link_to host, host_path(host)
13+
%th= t(:field_host)
14+
%tbody
15+
- @hosts.each do |host|
16+
%tr
17+
%td= link_to host, host_path(host)
1418

app/views/hosts/show.html.haml

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
- content_for :title do
22
= @hostname
33

4-
%ul.breadcrumb
5-
%li
6-
= link_to t(:title_hosts), hosts_path
7-
%li.active= @hostname
4+
%nav{"aria-label" => "breadcrumb"}
5+
%ol.breadcrumb
6+
%li.breadcrumb-item
7+
= link_to t(:title_hosts), hosts_path
8+
%li.breadcrumb-item.active{"aria-current" => "page"}= @hostname
89
910
.page-title
1011
%h4= @hostname
@@ -13,12 +14,13 @@
1314
= t(:logs_count)
1415
1516
%table.table.table-striped
16-
%tr
17-
%th= t(:field_script_name)
18-
%th= t(:field_created)
19-
20-
- @logs.each do |log|
17+
%thead
2118
%tr
22-
%td= link_to log.script.name, script_path(log.script.id)
23-
%td= link_to log.formatted_created_at, log_path(log.id)
19+
%th= t(:field_script_name)
20+
%th= t(:field_created)
21+
%tbody
22+
- @logs.each do |log|
23+
%tr
24+
%td= link_to log.script.name, script_path(log.script.id)
25+
%td= link_to log.formatted_created_at, log_path(log.id)
2426
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
%li
2-
= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote
1+
%li.page-item
2+
= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, class: 'page-link', remote: remote

app/views/kaminari/_gap.html.haml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
%li.disabled
2-
= content_tag :a, raw(t 'views.pagination.truncate')
1+
%li.page-item.disabled
2+
= content_tag :a, raw(t 'views.pagination.truncate'), class: 'page-link'
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
%li
2-
= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {remote: remote}
1+
%li.page-item
2+
= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {remote: remote, class: 'page-link'}
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
%li
2-
= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, rel: 'next', remote: remote
1+
%li.page-item
2+
= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, rel: 'next', remote: remote, class: 'page-link'

app/views/kaminari/_page.html.haml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
- if page.current?
2-
%li.active
3-
= content_tag :a, page, remote: remote, rel: (page.next? ? 'next' : (page.prev? ? 'prev' : nil))
2+
%li.page-item.active
3+
= content_tag :a, page, class: 'page-link', remote: remote, rel: (page.next? ? 'next' : (page.prev? ? 'prev' : nil))
44
- else
5-
%li
6-
= link_to page, url, remote: remote, rel: (page.next? ? 'next' : (page.prev? ? 'prev' : nil))
5+
%li.page-item
6+
= link_to page, url, class: 'page-link', remote: remote, rel: (page.next? ? 'next' : (page.prev? ? 'prev' : nil))
+11-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
= paginator.render do
2-
%ul.pagination
3-
= first_page_tag unless current_page.first?
4-
= prev_page_tag unless current_page.first?
5-
- each_page do |page|
6-
- if page.left_outer? || page.right_outer? || page.inside_window?
7-
= page_tag page
8-
- elsif !page.was_truncated?
9-
= gap_tag
10-
= next_page_tag unless current_page.last?
11-
= last_page_tag unless current_page.last?
2+
%nav
3+
%ul.pagination
4+
= first_page_tag unless current_page.first?
5+
= prev_page_tag unless current_page.first?
6+
- each_page do |page|
7+
- if page.left_outer? || page.right_outer? || page.inside_window?
8+
= page_tag page
9+
- elsif !page.was_truncated?
10+
= gap_tag
11+
= next_page_tag unless current_page.last?
12+
= last_page_tag unless current_page.last?
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
%li
2-
= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, rel: 'prev', remote: remote
1+
%li.page-item
2+
= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, rel: 'prev', remote: remote, class: 'page-link'

app/views/layouts/application.html.haml

+14-20
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,30 @@
99
= favicon_link_tag 'apple-touch-icon.png', rel: 'apple-touch-icon', type: 'image/png'
1010
= favicon_link_tag 'favicon.ico', rel: 'icon'
1111
= javascript_include_tag "application"
12-
1312
%body
14-
.navbar.navbar-fixed-top.navbar-inverse
13+
%nav.navbar.fixed-top.navbar-expand-lg.navbar-dark.bg-dark
1514
.container
16-
.navbar-header
17-
= link_to image_tag(asset_path('sunline-logo-white.png')), {controller: 'top'}, class: 'navbar-brand'
18-
%button.navbar-toggle{'data-toggle': 'collapse', 'data-target': '#js-navbar-collapse'}
19-
%span.icon-bar
20-
%span.icon-bar
21-
%span.icon-bar
15+
= link_to image_tag(asset_path('sunline-logo-white.png')), {controller: 'top'}, class: 'navbar-brand'
16+
%button.navbar-toggler{'type': 'button', 'data-toggle': 'collapse', 'data-target': '#js-navbar-collapse', 'aria-controls': 'js-navbar-collapse', 'aria-expanded': 'false', 'aria-label': 'Toggle navigation'}
17+
%span.navbar-toggler-icon
2218
- if user_signed_in?
2319
.collapse.navbar-collapse#js-navbar-collapse
24-
%ul.nav.navbar-nav
25-
%li= link_to t(:title_scripts), scripts_path
26-
%li= link_to t(:title_hosts), hosts_path
27-
%li= link_to t(:title_search), search_path
28-
%ul.nav.navbar-nav.navbar-right
29-
%li.dropdown
30-
%a.dropdown-toggle(data-toggle="dropdown" role="button" href="#")
20+
%ul.navbar-nav.mr-auto
21+
%li.nav-item= link_to t(:title_scripts), scripts_path, class: 'nav-link'
22+
%li.nav-item= link_to t(:title_hosts), hosts_path, class: 'nav-link'
23+
%li.nav-item= link_to t(:title_search), search_path, class: 'nav-link'
24+
%ul.navbar-nav.ml-auto
25+
%li.nav-item.dropdown
26+
%a.nav-link(data-toggle="dropdown" role="button" href="#" id="accountDropdown" aria-haspopup="true" aria-expanded="false")
3127
= t(:button_account)
3228
%i.fa.fa-caret-down
33-
%ul.dropdown-menu(role="menu")
34-
%li.signout-menu
29+
.dropdown-menu.dropdown-menu-right(aria-labelledby="accountDropdown")
30+
.dropdown-item.signout-menu
3531
= button_to destroy_user_session_path, method: :delete, class: 'btn btn-link' do
3632
%i.fa.fa-sign-out-alt
3733
= t(:button_sign_out)
38-
39-
.container
34+
.container.mt-5.pt-3
4035
= bootstrap_flash_compat
4136
= yield
42-
4337
%footer
4438
%p &copy; codefirst.org

app/views/logs/edit.html.haml

+23-21
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,35 @@
11
- content_for :title do
22
= "#{@log.script.name} - #{t(:title_log)} - #{t(:title_edit)}"
33

4-
%ul.breadcrumb
5-
%li
6-
= link_to t(:title_scripts), scripts_path
7-
%li
8-
= link_to @log.script.name, script_path(@log.script)
9-
%li.active= t(:title_log)
4+
%nav{"aria-label" => "breadcrumb"}
5+
%ol.breadcrumb
6+
%li.breadcrumb-item
7+
= link_to t(:title_scripts), scripts_path
8+
%li.breadcrumb-item
9+
= link_to @log.script.name, script_path(@log.script)
10+
%li.breadcrumb-item.active{"aria-current" => "page"}= t(:title_log)
1011
1112
%h3= t(:title_log)
1213
13-
%dl.dl-horizontal
14+
= form_for @log do |f|
15+
%dl.row
16+
%dt.col-sm-3.text-right= t(:field_host)
17+
%dd.col-sm-9= @log.host
1418
15-
%dt= t(:field_host)
16-
%dd= @log.host
19+
%dt.col-sm-3.text-right= t(:field_uploaded)
20+
%dd.col-sm-9= @log.formatted_created_at
1721
18-
%dt= t(:field_uploaded)
19-
%dd= @log.formatted_created_at
22+
%dt.col-sm-3.text-right= t(:field_log)
23+
%dd.col-sm-9
24+
%pre= @log.result
2025
21-
%dt= t(:field_log)
22-
%dd
23-
%pre= @log.result
26+
%dt.col-sm-3.text-right= t(:field_log_size)
27+
%dd.col-sm-9= number_to_human_size @log.result_bytes
2428
25-
%dt= t(:field_log_size)
26-
%dd= number_to_human_size @log.result_bytes
27-
28-
= form_for @log do |f|
29-
%dt= t(:field_memo)
30-
%dd= f.text_area :memo, class: 'form-control script-area', rows: 15
31-
%dd= f.submit t(:button_save), class: 'btn btn-primary'
29+
%dt.col-sm-3.text-right= t(:field_memo)
30+
%dd.col-sm-9
31+
= f.text_area :memo, class: 'form-control script-area', rows: 15
32+
.mt-3
33+
= f.submit t(:button_save), class: 'btn btn-primary'
3234
3335

app/views/logs/show.html.haml

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
- content_for :title do
22
= "#{@log.script.name} - #{t(:title_log)}"
33

4-
%ul.breadcrumb
5-
%li
6-
= link_to t(:title_scripts), scripts_path
7-
%li
8-
= link_to @log.script.name, script_path(@log.script)
9-
%li.active= t(:title_log)
4+
%nav{"aria-label" => "breadcrumb"}
5+
%ol.breadcrumb
6+
%li.breadcrumb-item
7+
= link_to t(:title_scripts), scripts_path
8+
%li.breadcrumb-item
9+
= link_to @log.script.name, script_path(@log.script)
10+
%li.breadcrumb-item.active{"aria-current" => "page"}= t(:title_log)
1011
1112
.page-title
1213
%h3= t(:title_log)
1314
.page-title-right-menu
14-
= link_to t(:button_edit), edit_log_path, class: 'btn btn-default'
15+
= link_to t(:button_edit), edit_log_path, class: 'btn btn-outline-secondary'
1516
16-
%dl.dl-horizontal
17+
%dl.row
18+
%dt.col-sm-3.text-right= t(:field_host)
19+
%dd.col-sm-9= @log.host
1720
18-
%dt= t(:field_host)
19-
%dd= @log.host
21+
%dt.col-sm-3.text-right= t(:field_uploaded)
22+
%dd.col-sm-9= @log.formatted_created_at
2023
21-
%dt= t(:field_uploaded)
22-
%dd= @log.formatted_created_at
23-
24-
%dt= t(:field_log)
25-
%dd
24+
%dt.col-sm-3.text-right= t(:field_log)
25+
%dd.col-sm-9
2626
%pre= @log.result
2727
28-
%dt= t(:field_log_size)
29-
%dd= number_to_human_size @log.result_bytes
28+
%dt.col-sm-3.text-right= t(:field_log_size)
29+
%dd.col-sm-9= number_to_human_size @log.result_bytes
3030
31-
%dt= t(:field_memo)
32-
%dd
31+
%dt.col-sm-3.text-right= t(:field_memo)
32+
%dd.col-sm-9
3333
- unless @log.memo.blank?
3434
%pre= @log.memo

app/views/scripts/_form.html.haml

+9-12
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
= form_for @script, html: {multipart: true} do |f|
2-
.field
2+
.form-group
33
= f.label :name
44
= f.text_field :name, class: 'form-control'
5-
.field
5+
.form-group
66
= f.label :body
77
= f.text_area :body, class: 'form-control script-area', rows: 15
8-
.field
8+
.form-group
99
= label_tag t(:field_attachments)
10-
%ul.attachments
10+
%ul.attachments.list-unstyled
1111
- @script.attachments.order(:upload_file_name).each do |attachment|
1212
%li
1313
%i.fa.fa-file
@@ -18,21 +18,18 @@
1818
\/
1919
= time_ago_in_words(attachment.updated_at) + t(:ago)
2020
)
21-
%label.checkbox
22-
= check_box_tag "delete_attachments[]", attachment.id
23-
= t(:button_remove)
24-
21+
.form-check.form-check-inline
22+
= check_box_tag "delete_attachments[]", attachment.id, false, class: 'form-check-input'
23+
= label_tag nil, t(:button_remove), class: 'form-check-label'
2524
.fileinputs
2625
= render 'form_upload', display: 'none'
2726
= render 'form_upload', display: 'block'
28-
.fileinputs-more
29-
= link_to '#', class: 'attachment-more btn btn-default' do
27+
.fileinputs-more.mt-2
28+
= link_to '#', class: 'attachment-more btn btn-outline-secondary' do
3029
%i.fa.fa-plus
3130
=t(:button_more_attachment)
32-
3331
.actions
3432
= f.submit t(:button_save), class: 'btn btn-primary'
35-
3633
:javascript
3734
$(function() {
3835
$('.attachment-more').on('click', function(e) {

0 commit comments

Comments
 (0)