Skip to content

Commit 854e657

Browse files
committed
Port admin views to Bootstrap 4
1 parent 024ada0 commit 854e657

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+659
-673
lines changed

Manifest.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ app/views/admin/settings/feedback.html.erb
173173
app/views/admin/settings/index.html.erb
174174
app/views/admin/settings/write.html.erb
175175
app/views/admin/shared/_edit.html.erb
176+
app/views/admin/shared/_flash.html.erb
176177
app/views/admin/shared/_menu.html.erb
177178
app/views/admin/shared/_twitter_alert.html.erb
178179
app/views/admin/sidebar/_available.html.erb

app/assets/stylesheets/administration_structure.css.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@ tr .action {
5858
.page-title { display:inline-block }
5959
/* Classes for menu icons */
6060

61-
.btn-action {
62-
padding: 4px;
63-
}
64-
6561
#article_title,
6662
#page_title {
6763
font-size: 2.3em;

app/assets/stylesheets/sidebar_admin.css.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,4 @@
2727
h3 {
2828
margin-top: 0;
2929
}
30-
.deletion_link {
31-
position: absolute;
32-
top: 20px;
33-
right: 20px;
34-
display: inline-block;
35-
}
3630
}

app/helpers/admin/base_helper.rb

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,9 @@ def plugin_options(kind)
3535
end
3636

3737
def show_actions(item)
38-
tag.div(class: "action", style: "") do
39-
safe_join [button_to_edit(item),
40-
button_to_delete(item),
41-
button_to_short_url(item)], " "
42-
end
38+
safe_join [button_to_edit(item),
39+
button_to_delete(item),
40+
button_to_short_url(item)], " "
4341
end
4442

4543
def display_pagination(collection, cols, _first = "", _last = "")
@@ -53,34 +51,42 @@ def display_pagination(collection, cols, _first = "", _last = "")
5351
def button_to_edit(item)
5452
link_to(t("generic.edit"),
5553
{ action: "edit", id: item.id },
56-
{ class: "btn btn-primary btn-xs btn-action" })
54+
{ class: "btn btn-primary btn-sm" })
5755
end
5856

5957
def button_to_delete(item)
6058
confirm_text = t("admin.shared.destroy.are_you_sure",
6159
element: item.class.model_name.human.downcase)
6260
link_to(t("generic.delete"),
6361
{ action: "destroy", id: item.id },
64-
{ class: "btn btn-danger btn-xs btn-action", method: :delete,
62+
{ class: "btn btn-danger btn-sm", method: :delete,
6563
data: { confirm: confirm_text } })
6664
end
6765

6866
def button_to_short_url(item)
6967
return "" if item.short_url.nil?
7068

7169
link_to(t("generic.short_url"), item.short_url,
72-
class: "btn btn-success btn-xs btn-action")
70+
class: "btn btn-success btn-sm")
7371
end
7472

7573
def twitter_available?(blog, user)
7674
blog.has_twitter_configured? && user.has_twitter_configured?
7775
end
7876

77+
def top_menu_item(name, url)
78+
if current_page? url
79+
tag.li(link_to(name, "#", class: "active nav-link"), class: "nav-item")
80+
else
81+
tag.li(link_to(name, url, class: "nav-link"), class: "nav-item")
82+
end
83+
end
84+
7985
def menu_item(name, url)
8086
if current_page? url
81-
tag.li(link_to(name, "#"), class: "active")
87+
link_to(name, "#", class: "active dropdown-item")
8288
else
83-
tag.li(link_to(name, url))
89+
link_to(name, url, class: "dropdown-item")
8490
end
8591
end
8692
end

app/helpers/admin/feedback_helper.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ def show_feedback_actions(item, context = "listing")
2323
def button_to_edit_comment(item)
2424
link_to(t("generic.edit"),
2525
{ controller: "admin/feedback", action: "edit", id: item.id },
26-
{ class: "btn btn-primary btn-xs btn-action" })
26+
{ class: "btn btn-primary btn-sm" })
2727
end
2828

2929
def button_to_delete_comment(item)
3030
link_to(t("generic.delete"),
3131
{ controller: "admin/feedback", action: "destroy", id: item.id },
32-
{ class: "btn btn-danger btn-xs btn-action" })
32+
{ class: "btn btn-danger btn-sm" })
3333
end
3434

3535
def button_to_conversation(item)
3636
link_to(t("generic.conversation"),
3737
{ controller: "admin/feedback", action: "article", id: item.article_id },
38-
{ class: "btn btn-default btn-xs btn-action" })
38+
{ class: "btn btn-default btn-sm" })
3939
end
4040

4141
def change_status(item, context = "listing")
@@ -46,7 +46,7 @@ def change_status(item, context = "listing")
4646
link_to(link_text,
4747
{ controller: "admin/feedback", action: "change_state",
4848
id: item.id, context: context },
49-
{ class: "btn btn-#{button_type} btn-xs btn-action",
49+
{ class: "btn btn-#{button_type} btn-sm",
5050
method: :post, remote: true })
5151
end
5252
end

0 commit comments

Comments
 (0)