-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
98 changed files
with
1,087 additions
and
709 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<li class="disabled"> | ||
<a href="#"> | ||
<%= raw(t 'admin.pagination.truncate') %> | ||
</a> | ||
</li> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<% if current_page.last? %> | ||
<li class="next disabled"> | ||
<%= link_to raw(t 'admin.pagination.next'), '#' %> | ||
</li> | ||
<% else %> | ||
<li class="next"> | ||
<%= link_to raw(t 'admin.pagination.next'), url, class: (remote ? 'pjax' : '') %> | ||
</li> | ||
<% end %> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<% if page.current? %> | ||
<li class="active"> | ||
<%= link_to page, url, class: (remote ? 'pjax' : '') %> | ||
</li> | ||
<% else %> | ||
<li> | ||
<%= link_to page, url, class: (remote ? 'pjax' : '') %> | ||
</li> | ||
<% end %> |
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
app/views/kaminari/ra-twitter-bootstrap/_paginator.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<%= paginator.render do %> | ||
<ul class="pagination"> | ||
<%= prev_page_tag %> | ||
<% each_page do |page| %> | ||
<% if page.left_outer? or page.right_outer? or page.inside_window? %> | ||
<%= page_tag page %> | ||
<% elsif !page.was_truncated? %> | ||
<%= gap_tag %> | ||
<% end %> | ||
<% end %> | ||
<%= next_page_tag %> | ||
</ul> | ||
<% end %> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<% if current_page.first? %> | ||
<li class="prev disabled"> | ||
<%= link_to raw(t 'admin.pagination.previous'), '#' %> | ||
</li> | ||
<% else %> | ||
<li class="prev"> | ||
<%= link_to raw(t 'admin.pagination.previous'), url, class: (remote ? 'pjax' : '') %> | ||
</li> | ||
<% end %> |
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
app/views/kaminari/ra-twitter-bootstrap/without_count/_next_page.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<% if current_page.last? %> | ||
<li class="next disabled"> | ||
<%= link_to raw(t 'admin.pagination.next'), '#' %> | ||
</li> | ||
<% else %> | ||
<li class="next"> | ||
<%= link_to raw(t 'admin.pagination.next'), url, class: (remote ? 'pjax' : '') %> | ||
</li> | ||
<% end %> |
4 changes: 0 additions & 4 deletions
4
app/views/kaminari/ra-twitter-bootstrap/without_count/_next_page.html.haml
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
app/views/kaminari/ra-twitter-bootstrap/without_count/_paginator.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<%= paginator.render do %> | ||
<ul class="pagination"> | ||
<%= prev_page_tag if !current_page.first? %> | ||
<%= next_page_tag %> | ||
</ul> | ||
<% end %> |
4 changes: 0 additions & 4 deletions
4
app/views/kaminari/ra-twitter-bootstrap/without_count/_paginator.html.haml
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
app/views/kaminari/ra-twitter-bootstrap/without_count/_prev_page.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<% if current_page.first? %> | ||
<li class="prev disabled"> | ||
<%= link_to raw(t 'admin.pagination.previous'), '#' %> | ||
</li> | ||
<% else %> | ||
<li class="prev"> | ||
<%= link_to raw(t 'admin.pagination.previous'), url, class: (remote ? 'pjax' : '') %> | ||
</li> | ||
<% end %> |
4 changes: 0 additions & 4 deletions
4
app/views/kaminari/ra-twitter-bootstrap/without_count/_prev_page.html.haml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<meta content="IE=edge" http-equiv="X-UA-Compatible"/> | ||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/> | ||
<meta content="width=device-width, initial-scale=1" name="viewport; charset=utf-8"/> | ||
<meta content="NONE,NOARCHIVE" name="robots"/> | ||
<%= csrf_meta_tag %> | ||
<%= stylesheet_link_tag "rails_admin/rails_admin.css", media: :all %> | ||
<%= javascript_include_tag "rails_admin/rails_admin.js" %> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<div class="container-fluid"> | ||
<div class="navbar-header"> | ||
<button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target="#secondary-navigation"> | ||
<span class="sr-only"> | ||
<%= t('admin.toggle_navigation') %> | ||
</span> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
</button> | ||
<a class="navbar-brand pjax" href="<%= dashboard_path %>"> | ||
<%= _get_plugin_name[0] || 'Rails' %> | ||
<small> | ||
<%= _get_plugin_name[1] || 'Admin' %> | ||
</small> | ||
</a> | ||
</div> | ||
<div class="collapse navbar-collapse" id="secondary-navigation"> | ||
<%= render partial: 'layouts/rails_admin/secondary_navigation' %> | ||
</div> | ||
</div> |
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
app/views/layouts/rails_admin/_secondary_navigation.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<ul class="nav navbar-nav navbar-right root_links"> | ||
<% actions(:root).select(&:show_in_navigation).each do |action| %> | ||
<li class="<%= action.action_name %>_root_link"> | ||
<%= link_to wording_for(:menu, action), { action: action.action_name, controller: 'rails_admin/main' }, class: action.pjax? ? "pjax" : "" %> | ||
</li> | ||
<% end %> | ||
<% if main_app_root_path = (main_app.root_path rescue false) %> | ||
<li> | ||
<%= link_to t('admin.home.name'), main_app_root_path %> | ||
</li> | ||
<% end %> | ||
<% if _current_user %> | ||
<% if user_link = edit_user_link %> | ||
<li class="edit_user_root_link"> | ||
<%= user_link %> | ||
</li> | ||
<% end %> | ||
<% if logout_path.present? %> | ||
<li> | ||
<%= link_to content_tag('span', t('admin.misc.log_out'), class: 'label label-danger'), logout_path, method: logout_method %> | ||
</li> | ||
<% end %> | ||
<% end %> | ||
</ul> |
10 changes: 0 additions & 10 deletions
10
app/views/layouts/rails_admin/_secondary_navigation.html.haml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<ul class="nav nav-pills nav-stacked"> | ||
<%= main_navigation %> | ||
</ul> | ||
<ul class="nav nav-pills nav-stacked"> | ||
<%= root_navigation %> | ||
</ul> | ||
<ul class="nav nav-pills nav-stacked"> | ||
<%= static_navigation %> | ||
</ul> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!DOCTYPE html> | ||
<html lang="<%= I18n.locale %>"> | ||
<head> | ||
<%= render "layouts/rails_admin/head" %> | ||
</head> | ||
<body class="rails_admin"> | ||
<div data-i18n-options="<%= I18n.t("admin.js").to_json %>" id="admin-js"></div> | ||
<div class="label label-warning" id="loading" style="display:none; position:fixed; right:20px; bottom:20px; z-index:100000"> | ||
<%= t('admin.loading') %> | ||
</div> | ||
<nav class="navbar navbar-default navbar-fixed-top"> | ||
<%= render "layouts/rails_admin/navigation" %> | ||
</nav> | ||
<div class="container-fluid"> | ||
<div class="row"> | ||
<div class="col-sm-3 col-md-2 sidebar-nav"> | ||
<%= render "layouts/rails_admin/sidebar_navigation" %> | ||
</div> | ||
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2"> | ||
<div class="content" data-pjax-container="<%= true %>"> | ||
<%= render template: 'layouts/rails_admin/pjax' %> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<% flash && flash.each do |key, value| %> | ||
<div class="<%= flash_alert_class(key) %> alert alert-dismissible"> | ||
<button class="close" data-dismiss="alert" type="button">×</button> | ||
<%= value %> | ||
</div> | ||
<% end %> | ||
<%= yield %> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<title> | ||
<%= "#{@abstract_model.try(:pretty_name) || @page_name} | #{[_get_plugin_name[0] || 'Rails', _get_plugin_name[1] || 'Admin'].join(' ')}" %> | ||
</title> | ||
<div class="page-header" data-model="<%= @abstract_model.to_param %>"> | ||
<h1> | ||
<%= @page_name %> | ||
</h1> | ||
</div> | ||
<% flash && flash.each do |key, value| %> | ||
<div class="<%= flash_alert_class(key) %> alert alert-dismissible"> | ||
<button class="close" data-dismiss="alert" type="button">×</button> | ||
<%= value %> | ||
</div> | ||
<% end %> | ||
<%= breadcrumb %> | ||
<ul class="nav nav-tabs"> | ||
<%= menu_for((@abstract_model ? (@object.try(:persisted?) ? :member : :collection) : :root), @abstract_model, @object) %> | ||
<%= content_for :contextual_tabs %> | ||
</ul> | ||
<%= yield %> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<table class="table table-condensed table-striped table-hover"> | ||
<thead> | ||
<tr> | ||
<th class="shrink user"> | ||
<%= t("admin.table_headers.username") %> | ||
</th> | ||
<th class="shrink items"> | ||
<%= t("admin.table_headers.item") %> | ||
</th> | ||
<th class="changes"> | ||
<%= t("admin.table_headers.changes") %> | ||
</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% @history.each do |t| %> | ||
<% abstract_model = RailsAdmin.config(t.table).abstract_model %> | ||
<tr> | ||
<td> | ||
<%= t.try :username %> | ||
</td> | ||
<% if o = abstract_model.try(:get, t.item) %> | ||
<% label = o.send(abstract_model.config.object_label_method) %> | ||
<% if show_action = action(:show, abstract_model, o) %> | ||
<td> | ||
<%= link_to(label, url_for(action: show_action.action_name, model_name: abstract_model.to_param, id: o.id), class: 'pjax') %> | ||
</td> | ||
<% else %> | ||
<td> | ||
<%= label %> | ||
</td> | ||
<% end %> | ||
<% else %> | ||
<% label = Object.const_defined?(t.table) ? t.table.constantize.model_name.human : t.table %> | ||
<td> | ||
<%= "#{label} ##{t.item}" %> | ||
</td> | ||
<% end %> | ||
<td> | ||
<%= t.message %> | ||
</td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> |
Oops, something went wrong.