diff --git a/app/controllers/manager/administrateurs_controller.rb b/app/controllers/manager/administrateurs_controller.rb index 71b37a9ed..2b2beaf2c 100644 --- a/app/controllers/manager/administrateurs_controller.rb +++ b/app/controllers/manager/administrateurs_controller.rb @@ -1,21 +1,4 @@ module Manager 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 diff --git a/app/controllers/manager/application_controller.rb b/app/controllers/manager/application_controller.rb index 8d2db8e84..15ea3211c 100644 --- a/app/controllers/manager/application_controller.rb +++ b/app/controllers/manager/application_controller.rb @@ -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 class ApplicationController < Administrate::ApplicationController before_action :authenticate_administration! 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 params[:order] ||= "created_at" params[:direction] ||= "desc" diff --git a/app/views/manager/application/_collection.html.haml b/app/views/manager/application/_collection.html.haml index 96b51ca15..ca18cdcd2 100644 --- a/app/views/manager/application/_collection.html.haml +++ b/app/views/manager/application/_collection.html.haml @@ -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" } %thead %tr diff --git a/app/views/manager/application/_flashes.html.haml b/app/views/manager/application/_flashes.html.haml index dcb80f65f..f5fd0ebc9 100644 --- a/app/views/manager/application/_flashes.html.haml +++ b/app/views/manager/application/_flashes.html.haml @@ -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? .flashes - flash.each do |key, value| diff --git a/app/views/manager/application/_javascript.html.haml b/app/views/manager/application/_javascript.html.haml index 94b427358..de1850bf7 100644 --- a/app/views/manager/application/_javascript.html.haml +++ b/app/views/manager/application/_javascript.html.haml @@ -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| = javascript_include_tag js_path diff --git a/app/views/manager/application/_sidebar.html.haml b/app/views/manager/application/_sidebar.html.haml index cd3499d18..abfd0f41a 100644 --- a/app/views/manager/application/_sidebar.html.haml +++ b/app/views/manager/application/_sidebar.html.haml @@ -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 %li = link_to "Se déconnecter", administrations_sign_out_path, method: :delete, class: "sidebar__link" diff --git a/app/views/manager/application/index.html.haml b/app/views/manager/application/index.html.haml index 1e69b1213..ce051bf66 100644 --- a/app/views/manager/application/index.html.haml +++ b/app/views/manager/application/index.html.haml @@ -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 = display_resource_name(page.resource_name) diff --git a/app/views/manager/application/show.html.haml b/app/views/manager/application/show.html.haml index e6f79a723..a17f35005 100644 --- a/app/views/manager/application/show.html.haml +++ b/app/views/manager/application/show.html.haml @@ -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 } %header.header diff --git a/app/views/manager/procedures/show.html.haml b/app/views/manager/procedures/show.html.haml index dee910db0..1627fa667 100644 --- a/app/views/manager/procedures/show.html.haml +++ b/app/views/manager/procedures/show.html.haml @@ -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 } - procedure = page.resource