Skip to content

Commit aa6ef95

Browse files
committed
Switch templates from HAML to ERB
Make RailsAdmin have fewer dependencies and so slightly reduce total installation size. Align the project with default upstream Rails practices. Starting a new Rails project includes ERB by default but not HAML. By switching, we don't pull in additional templating practices beyond what any default project is already using. The change may also help encourage contributors. While nearly all Rails developers have direct experience working with ERB, the same is not always true of HAML. This removes a small barrier. Fixes #3173
1 parent a458ced commit aa6ef95

File tree

98 files changed

+1087
-709
lines changed

Some content is hidden

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

98 files changed

+1087
-709
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ Style/IdenticalConditionalBranches:
302302
# Cop supports --auto-correct.
303303
Style/IfUnlessModifier:
304304
Exclude:
305-
- "config/initializers/haml.rb"
306305
- "lib/rails_admin/adapters/active_record.rb"
307306
- "lib/rails_admin/adapters/mongoid.rb"
308307
- "lib/rails_admin/bootstrap-sass.rb"

Appraisals

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
appraise "rails-6.0" do
22
gem 'rails', '~> 6.0.0'
3-
gem 'haml'
43
gem 'sassc-rails', '~> 2.1'
54
gem 'devise', '~> 4.7'
65

@@ -34,7 +33,6 @@ end
3433

3534
appraise "rails-6.1" do
3635
gem 'rails', '~> 6.1.0'
37-
gem 'haml'
3836
gem 'sassc-rails', '~> 2.1'
3937
gem 'devise', '~> 4.7'
4038

@@ -68,7 +66,6 @@ end
6866

6967
appraise "rails-7.0" do
7068
gem 'rails', '~> 7.0.0.alpha2'
71-
gem 'haml'
7269
gem 'sassc-rails', '~> 2.1'
7370
gem 'devise', '~> 4.7', github: 'strobilomyces/devise', branch: 'patch-1'
7471

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ source 'https://rubygems.org'
22

33
gem 'appraisal', '>= 2.0'
44
gem 'rails'
5-
gem 'haml'
65
gem 'devise'
76
gem 'webrick', '~> 1.7'
87

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<li class="disabled">
2+
<a href="#">
3+
<%= raw(t 'admin.pagination.truncate') %>
4+
</a>
5+
</li>

app/views/kaminari/ra-twitter-bootstrap/_gap.html.haml

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<% if current_page.last? %>
2+
<li class="next disabled">
3+
<%= link_to raw(t 'admin.pagination.next'), '#' %>
4+
</li>
5+
<% else %>
6+
<li class="next">
7+
<%= link_to raw(t 'admin.pagination.next'), url, class: (remote ? 'pjax' : '') %>
8+
</li>
9+
<% end %>

app/views/kaminari/ra-twitter-bootstrap/_next_page.html.haml

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<% if page.current? %>
2+
<li class="active">
3+
<%= link_to page, url, class: (remote ? 'pjax' : '') %>
4+
</li>
5+
<% else %>
6+
<li>
7+
<%= link_to page, url, class: (remote ? 'pjax' : '') %>
8+
</li>
9+
<% end %>

app/views/kaminari/ra-twitter-bootstrap/_page.html.haml

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<%= paginator.render do %>
2+
<ul class="pagination">
3+
<%= prev_page_tag %>
4+
<% each_page do |page| %>
5+
<% if page.left_outer? or page.right_outer? or page.inside_window? %>
6+
<%= page_tag page %>
7+
<% elsif !page.was_truncated? %>
8+
<%= gap_tag %>
9+
<% end %>
10+
<% end %>
11+
<%= next_page_tag %>
12+
</ul>
13+
<% end %>

0 commit comments

Comments
 (0)