-
-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3026 from AlchemyCMS/move-resource-table-partial
Move alchemy resources table into resource_table partial
- Loading branch information
Showing
4 changed files
with
32 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<%= render Alchemy::Admin::Resource::Table.new(resources_instance_variable, query: @query, search_filter_params: search_filter_params, icon: local_assigns[:icon]) %> | ||
|
||
<%= paginate resources_instance_variable, scope: resource_url_proxy, theme: 'alchemy' %> |
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 |
---|---|---|
@@ -1,3 +1,29 @@ | ||
<%= render Alchemy::Admin::Resource::Table.new(resources_instance_variable, query: @query, search_filter_params: search_filter_params, icon: local_assigns[:icon]) %> | ||
<% Alchemy::Deprecation.warn "The `alchemy/admin/resources/_table` partial is deprecated. Please `render 'alchemy/admin/resources/_resource_table'` instead and update it to your needs." %> | ||
|
||
<% if resources_instance_variable.any? %> | ||
<table class="list" id="<%= resource_handler.resources_name %>_list"> | ||
<thead> | ||
<tr> | ||
<% if local_assigns[:icon] %> | ||
<th class="icon"></th> | ||
<% end %> | ||
<% resource_handler.sorted_attributes.each do |attribute| %> | ||
<th class="<%= attribute[:type] %> <%= attribute[:name] %>"> | ||
<%= sort_link [:resource_url_proxy, @query], | ||
sortable_resource_header_column(attribute), | ||
resource_handler.model.human_attribute_name(attribute[:name]), | ||
default_order: attribute[:type].to_s =~ /date|time/ ? 'desc' : 'asc' %> | ||
</th> | ||
<% end %> | ||
<th class="tools"></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<%= render_resources(icon: local_assigns[:icon]) %> | ||
</tbody> | ||
</table> | ||
<% elsif search_filter_params[:q].present? %> | ||
<p><%= Alchemy.t('Nothing found') %></p> | ||
<% end %> | ||
|
||
<%= paginate resources_instance_variable, scope: resource_url_proxy, theme: 'alchemy' %> |
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