Clean Administrate templates and controllers
This commit is contained in:
parent
154181d793
commit
0396db9e5f
9 changed files with 0 additions and 127 deletions
|
@ -1,21 +1,4 @@
|
||||||
module Manager
|
module Manager
|
||||||
class AdministrateursController < Manager::ApplicationController
|
class AdministrateursController < Manager::ApplicationController
|
||||||
# To customize the behavior of this controller,
|
|
||||||
# simply overwrite any of the RESTful actions. For example:
|
|
||||||
#
|
|
||||||
# def index
|
|
||||||
# super
|
|
||||||
# @resources = Administrateur.
|
|
||||||
# page(params[:page]).
|
|
||||||
# per(10)
|
|
||||||
# end
|
|
||||||
|
|
||||||
# Define a custom finder by overriding the `find_resource` method:
|
|
||||||
# def find_resource(param)
|
|
||||||
# Administrateur.find_by!(slug: param)
|
|
||||||
# end
|
|
||||||
|
|
||||||
# See https://administrate-prototype.herokuapp.com/customizing_controller_actions
|
|
||||||
# for more information
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,20 +1,8 @@
|
||||||
# All Administrate controllers inherit from this `Admin::ApplicationController`,
|
|
||||||
# making it the ideal place to put authentication logic or other
|
|
||||||
# before_actions.
|
|
||||||
#
|
|
||||||
# If you want to add pagination or other controller-level concerns,
|
|
||||||
# you're free to overwrite the RESTful controller actions.
|
|
||||||
module Manager
|
module Manager
|
||||||
class ApplicationController < Administrate::ApplicationController
|
class ApplicationController < Administrate::ApplicationController
|
||||||
before_action :authenticate_administration!
|
before_action :authenticate_administration!
|
||||||
before_action :default_params
|
before_action :default_params
|
||||||
|
|
||||||
# Override this value to specify the number of elements to display at a time
|
|
||||||
# on index pages. Defaults to 20.
|
|
||||||
# def records_per_page
|
|
||||||
# params[:per_page] || 20
|
|
||||||
# end
|
|
||||||
|
|
||||||
def default_params
|
def default_params
|
||||||
params[:order] ||= "created_at"
|
params[:order] ||= "created_at"
|
||||||
params[:direction] ||= "desc"
|
params[:direction] ||= "desc"
|
||||||
|
|
|
@ -1,21 +1,3 @@
|
||||||
-# # Collection
|
|
||||||
-#
|
|
||||||
-# This partial is used on the `index` and `show` pages
|
|
||||||
-# to display a collection of resources in an HTML table.
|
|
||||||
-#
|
|
||||||
-# ## Local variables:
|
|
||||||
-#
|
|
||||||
-# - `collection_presenter`:
|
|
||||||
-# An instance of [Administrate::Page::Collection][1].
|
|
||||||
-# The table presenter uses `ResourceDashboard::COLLECTION_ATTRIBUTES` to determine
|
|
||||||
-# the columns displayed in the table
|
|
||||||
-# - `resources`:
|
|
||||||
-# An ActiveModel::Relation collection of resources to be displayed in the table.
|
|
||||||
-# By default, the number of resources is limited by pagination
|
|
||||||
-# or by a hard limit to prevent excessive page load times
|
|
||||||
-#
|
|
||||||
-# [1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Collection
|
|
||||||
|
|
||||||
%table.collection-data{ "aria-labelledby": "page-title" }
|
%table.collection-data{ "aria-labelledby": "page-title" }
|
||||||
%thead
|
%thead
|
||||||
%tr
|
%tr
|
||||||
|
|
|
@ -1,14 +1,3 @@
|
||||||
-# # Flash Partial
|
|
||||||
-#
|
|
||||||
-# This partial renders flash messages on every page.
|
|
||||||
-#
|
|
||||||
-# ## Relevant Helpers:
|
|
||||||
-#
|
|
||||||
-# - `flash`:
|
|
||||||
-# Returns a hash,
|
|
||||||
-# where the keys are the type of flash (alert, error, notice, etc)
|
|
||||||
-# and the values are the message to be displayed.
|
|
||||||
|
|
||||||
- if flash.any?
|
- if flash.any?
|
||||||
.flashes
|
.flashes
|
||||||
- flash.each do |key, value|
|
- flash.each do |key, value|
|
||||||
|
|
|
@ -1,10 +1,3 @@
|
||||||
-# # Javascript Partial
|
|
||||||
-#
|
|
||||||
-# This partial imports the necessary javascript on each page.
|
|
||||||
-# By default, it includes the application JS,
|
|
||||||
-# but each page can define additional JS sources
|
|
||||||
-# by providing a `content_for(:javascript)` block.
|
|
||||||
|
|
||||||
- Administrate::Engine.javascripts.each do |js_path|
|
- Administrate::Engine.javascripts.each do |js_path|
|
||||||
= javascript_include_tag js_path
|
= javascript_include_tag js_path
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,3 @@
|
||||||
-# # Sidebar
|
|
||||||
-#
|
|
||||||
-# This partial is used to display the sidebar in Administrate.
|
|
||||||
-# By default, the sidebar contains navigation links
|
|
||||||
-# for all resources in the admin dashboard,
|
|
||||||
-# as defined by the routes in the `admin/` namespace
|
|
||||||
|
|
||||||
%ul.sidebar__list
|
%ul.sidebar__list
|
||||||
%li
|
%li
|
||||||
= link_to "Se déconnecter", administrations_sign_out_path, method: :delete, class: "sidebar__link"
|
= link_to "Se déconnecter", administrations_sign_out_path, method: :delete, class: "sidebar__link"
|
||||||
|
|
|
@ -1,26 +1,3 @@
|
||||||
-# # Index
|
|
||||||
-#
|
|
||||||
-# This view is the template for the index page.
|
|
||||||
-# It is responsible for rendering the search bar, header and pagination.
|
|
||||||
-# It renders the `_table` partial to display details about the resources.
|
|
||||||
-#
|
|
||||||
-# ## Local variables:
|
|
||||||
-#
|
|
||||||
-# - `page`:
|
|
||||||
-# An instance of [Administrate::Page::Collection][1].
|
|
||||||
-# Contains helper methods to help display a table,
|
|
||||||
-# and knows which attributes should be displayed in the resource's table.
|
|
||||||
-# - `resources`:
|
|
||||||
-# An instance of `ActiveRecord::Relation` containing the resources
|
|
||||||
-# that match the user's search criteria.
|
|
||||||
-# By default, these resources are passed to the table partial to be displayed.
|
|
||||||
-# - `search_term`:
|
|
||||||
-# A string containing the term the user has searched for, if any.
|
|
||||||
-# - `show_search_bar`:
|
|
||||||
-# A boolean that determines if the search bar should be shown.
|
|
||||||
-#
|
|
||||||
-# [1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Collection
|
|
||||||
|
|
||||||
- content_for(:title) do
|
- content_for(:title) do
|
||||||
= display_resource_name(page.resource_name)
|
= display_resource_name(page.resource_name)
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,3 @@
|
||||||
-# # Show
|
|
||||||
-#
|
|
||||||
-# This view is the template for the show page.
|
|
||||||
-# It renders the attributes of a resource,
|
|
||||||
-# as well as a link to its edit page.
|
|
||||||
-#
|
|
||||||
-# ## Local variables:
|
|
||||||
-#
|
|
||||||
-# - `page`:
|
|
||||||
-# An instance of [Administrate::Page::Show][1].
|
|
||||||
-# Contains methods for accessing the resource to be displayed on the page,
|
|
||||||
-# as well as helpers for describing how each attribute of the resource
|
|
||||||
-# should be displayed.
|
|
||||||
-#
|
|
||||||
-# [1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Show
|
|
||||||
|
|
||||||
- content_for(:title) { page.page_title }
|
- content_for(:title) { page.page_title }
|
||||||
|
|
||||||
%header.header
|
%header.header
|
||||||
|
|
|
@ -1,19 +1,3 @@
|
||||||
-# # Show
|
|
||||||
-#
|
|
||||||
-# This view is the template for the show page.
|
|
||||||
-# It renders the attributes of a resource,
|
|
||||||
-# as well as a link to its edit page.
|
|
||||||
-#
|
|
||||||
-# ## Local variables:
|
|
||||||
-#
|
|
||||||
-# - `page`:
|
|
||||||
-# An instance of [Administrate::Page::Show][1].
|
|
||||||
-# Contains methods for accessing the resource to be displayed on the page,
|
|
||||||
-# as well as helpers for describing how each attribute of the resource
|
|
||||||
-# should be displayed.
|
|
||||||
-#
|
|
||||||
-# [1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Show
|
|
||||||
|
|
||||||
- content_for(:title) { page.page_title }
|
- content_for(:title) { page.page_title }
|
||||||
- procedure = page.resource
|
- procedure = page.resource
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue