Skip to content

Commit 117c34a

Browse files
authored
Deps: upgrade to Bootstrap 5 (#1447)
1 parent 20a237c commit 117c34a

16 files changed

Lines changed: 48 additions & 47 deletions

File tree

app/javascript/application.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
import "@hotwired/turbo-rails";
33
import "@rails/activestorage";
44
import "jquery";
5-
import "bootstrap";
5+
import * as bootstrap from "bootstrap";
6+
7+
window.bootstrap = bootstrap;
68
import "mousetrap";
79
import "jquery-visible";
810
import _ from "underscore";
@@ -323,7 +325,7 @@ var AppView = Backbone.NativeView.extend({
323325

324326
$(document).ready(function() {
325327
Mousetrap.bind("?", function() {
326-
$("#shortcuts").modal('toggle');
328+
bootstrap.Modal.getOrCreateInstance(document.getElementById('shortcuts')).toggle();
327329
});
328330
});
329331

app/views/feeds/_feed.html.erb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
<div class="feed-line">
33
<div class="feed-title-container">
44
<p class="feed-title <%= feed.unread_stories_count > 0 ? "feed-unread" : "" %>">
5-
<i class="fa fa-circle status <%= feed.status_bubble %>" data-toggle="tooltip" title="<%= t("partials.feed.status_bubble.#{feed.status_bubble}") if feed.status_bubble %>" data-placement="left"></i>
5+
<i class="fa fa-circle status <%= feed.status_bubble %>" aria-hidden="true" data-bs-toggle="tooltip" title="<%= t("partials.feed.status_bubble.#{feed.status_bubble}") if feed.status_bubble %>" data-placement="left"></i>
6+
<% if feed.status_bubble %><span class="sr-only"><%= t("partials.feed.status_bubble.#{feed.status_bubble}") %></span><% end %>
67
<a href="/feed/<%= feed.id %>">
78
<% if feed.unread_stories_count > 0 %>
89
(<%= feed.unread_stories_count %>)

app/views/feeds/_single_feed_action_bar.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="row" data-controller="hotkeys mark-all-as-read" data-action="keydown@document->hotkeys#handleKeydown">
2-
<div class="float-left">
2+
<div class="float-start">
33
<a class="btn" id="home" href="/news" title="<%= t('partials.feed_action_bar.home') %>">
44
<i class="fa fa-reply"></i>
55
</a>
@@ -12,7 +12,7 @@
1212
</a>
1313
</div>
1414

15-
<div class="float-right">
15+
<div class="float-end">
1616
<a class="btn btn-primary" id="starred" href="/starred" title="<%= t('partials.action_bar.starred_stories') %>">
1717
<i class="fa fa-star"></i>
1818
</a>

app/views/feeds/edit.html.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77
<hr />
88
<%= form_with(url: "/feeds/#{@feed.id}", method: :put, id: "add-feed-setup") do %>
99
<input type="hidden" name="feed_id" value="<%= @feed.id %>">
10-
<div class="form-group">
10+
<div>
1111
<input name="feed_name" id="feed-name" class="form-control" type="text" value="<%= @feed.name %>" required />
1212
<i class="fa fa-pencil field-icon"></i>
1313
<label id="feed-name-label" class="field-label" for="feed-name"><%= t('feeds.edit.fields.feed_name') %></label>
1414
</div>
15-
<div class="form-group">
15+
<div>
1616
<input name="feed_url" id="feed-url" class="form-control" type="text" value="<%= @feed.url %>" autofocus required />
1717
<i class="fa fa-rss field-icon"></i>
1818
<label id="feed-url-label" class="field-label" for="feed-url"><%= t('feeds.edit.fields.feed_url') %></label>
1919
</div>
2020
<% if current_user.groups.any? %>
21-
<div class="form-group">
21+
<div>
2222
<input type="text" class="form-control" tabindex="-1">
2323
<select name="group_id" id="group-id">
2424
<option value=""></option>
@@ -30,6 +30,6 @@
3030
</div>
3131
<% end %>
3232

33-
<input type="submit" id="submit" class="btn btn-primary float-right" value="<%= t('feeds.edit.fields.submit') %>"/>
33+
<input type="submit" id="submit" class="btn btn-primary float-end" value="<%= t('feeds.edit.fields.submit') %>"/>
3434
<% end %>
3535
</div>

app/views/feeds/index.html.erb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
<script type="text/javascript">
2020
$(document).ready(function () {
21-
$(".status").tooltip();
21+
document.querySelectorAll(".status").forEach(function(el) {
22+
new bootstrap.Tooltip(el);
23+
});
2224
});
2325
</script>

app/views/feeds/new.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
<p><%= t('feeds.add.description') %></p>
99
<hr />
1010
<%= form_with(url: "/feeds", id: "add-feed-setup") do %>
11-
<div class="form-group">
11+
<div>
1212
<input name="feed_url" class="form-control" id="feed-url" type="text" value="<%= @feed_url %>" autofocus/>
1313
<i class="fa fa-rss field-icon"></i>
1414
<label id="feed_url-label" class="field-label" for="feed-url"><%= t('feeds.add.fields.feed_url') %></label>
1515
</div>
1616

17-
<input type="submit" id="submit" class="btn btn-primary float-right" value="<%= t('feeds.add.fields.submit') %>"/>
17+
<input type="submit" id="submit" class="btn btn-primary float-end" value="<%= t('feeds.add.fields.submit') %>"/>
1818
<% end %>
1919
</div>

app/views/imports/new.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<%= form_with(url: "/feeds/import", id: "import", multipart: true) do %>
1818
<input id="opml_file" name="opml_file" type="file" title="<%= t('import.fields.import') %>" aria-label="<%= t('import.fields.import') %>" class="btn-primary" />
19-
<a href="/setup/tutorial" id="skip" class="btn float-right"><%= t('import.fields.not_now') %></a>
19+
<a href="/setup/tutorial" id="skip" class="btn float-end"><%= t('import.fields.not_now') %></a>
2020
<% end %>
2121
</div>
2222

app/views/js/templates/_story.js.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@
3333
{{= body }}
3434
</div>
3535
<div class="row story-actions-container">
36-
<div class="float-left">
36+
<div class="float-start">
3737
<span class="story-published">
3838
{{= pretty_date }}
3939
</span>
4040
</div>
41-
<div class="float-right story-actions">
41+
<div class="float-end story-actions">
4242
<div class="story-keep-unread">
4343
<i class="fa {{ if(keep_unread) { }}fa-check{{ } else { }}fa-square-o{{ } }}"></i> <%= I18n.t('stories.keep_unread') %>
4444
</div>

app/views/layouts/_footer.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<li><a href="/feeds/export"><%= t('layout.export') %></a></li>
1111
<li class="text-muted">·</li>
1212
<li>
13-
<a href="#shortcuts" data-toggle="modal" aria-label="shortcuts">
13+
<a href="#shortcuts" data-bs-toggle="modal" data-bs-target="#shortcuts" aria-label="shortcuts">
1414
<i aria-hidden="true" class="fa fa-keyboard-o">
1515
</i>
1616
</a>
@@ -28,7 +28,7 @@
2828
</ul>
2929
</div>
3030
<div class="col-md-4">
31-
<p class="float-right">
31+
<p class="float-end">
3232
<b><%= t('layout.hey') %></b> <%= t('layout.back_to_work') %>
3333
</p>
3434
</div>

app/views/layouts/_shortcuts.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<div class="modal-dialog">
33
<div class="modal-content">
44
<div class="modal-header">
5-
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
65
<h4 id="myModalLabel"><%= t('partials.shortcuts.title') %></h4>
6+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
77
</div>
88
<div class="modal-body">
99
<ul class="shortcut-legend">

0 commit comments

Comments
 (0)