From 043dc4c0d9c8aebab8d64044f2566a5d6aa4c469 Mon Sep 17 00:00:00 2001 From: Dan Barber Date: Sat, 12 Mar 2016 10:55:30 +0000 Subject: [PATCH] Redo administrate stuff with 0.1.4 --- .../administrate/overrides.css.scss | 4 +- .../admin/application_controller.rb | 18 +++-- app/controllers/sessions_controller.rb | 2 +- app/dashboards/category_dashboard.rb | 35 +++++++-- app/dashboards/page_dashboard.rb | 23 ++++-- app/dashboards/photo_dashboard.rb | 58 +++++++++++---- app/dashboards/user_dashboard.rb | 18 ++++- app/fields/colour_field.rb | 4 - app/fields/markdown_field.rb | 21 ------ app/views/admin/application/_flashes.html.erb | 20 +++++ .../admin/application/_javascript.html.erb | 19 +++++ app/views/admin/application/_sidebar.html.erb | 20 +++++ .../admin/applications/_collection.html.erb | 74 ------------------- app/views/admin/applications/_form.html.erb | 44 ----------- app/views/admin/applications/edit.html.erb | 25 ------- app/views/admin/applications/index.html.erb | 55 -------------- app/views/admin/applications/new.html.erb | 25 ------- app/views/admin/applications/show.html.erb | 37 ---------- app/views/layouts/admin/application.html.erb | 48 ++++++++++++ app/views/layouts/admin/login.html.erb | 40 ++++++++++ .../layouts/administrate/application.html.erb | 34 --------- app/views/layouts/administrate/login.html.erb | 24 ------ app/views/sessions/new.html.erb | 20 +++-- config/environments/production.rb | 2 +- config/routes.rb | 9 ++- 25 files changed, 283 insertions(+), 396 deletions(-) delete mode 100644 app/fields/colour_field.rb delete mode 100644 app/fields/markdown_field.rb create mode 100644 app/views/admin/application/_flashes.html.erb create mode 100644 app/views/admin/application/_javascript.html.erb create mode 100644 app/views/admin/application/_sidebar.html.erb delete mode 100644 app/views/admin/applications/_collection.html.erb delete mode 100644 app/views/admin/applications/_form.html.erb delete mode 100644 app/views/admin/applications/edit.html.erb delete mode 100644 app/views/admin/applications/index.html.erb delete mode 100644 app/views/admin/applications/new.html.erb delete mode 100644 app/views/admin/applications/show.html.erb create mode 100644 app/views/layouts/admin/application.html.erb create mode 100644 app/views/layouts/admin/login.html.erb delete mode 100644 app/views/layouts/administrate/application.html.erb delete mode 100644 app/views/layouts/administrate/login.html.erb diff --git a/app/assets/stylesheets/administrate/overrides.css.scss b/app/assets/stylesheets/administrate/overrides.css.scss index e9c6116..13d5ecb 100644 --- a/app/assets/stylesheets/administrate/overrides.css.scss +++ b/app/assets/stylesheets/administrate/overrides.css.scss @@ -1,8 +1,10 @@ -.sign_out { +.logout { position: absolute; bottom: 1.5em; } .login { + margin-left: auto; + margin-right: auto; max-width: 50em; } diff --git a/app/controllers/admin/application_controller.rb b/app/controllers/admin/application_controller.rb index dff706f..4fc94ca 100644 --- a/app/controllers/admin/application_controller.rb +++ b/app/controllers/admin/application_controller.rb @@ -4,14 +4,16 @@ # # If you want to add pagination or other controller-level concerns, # you're free to overwrite the RESTful controller actions. -class Admin::ApplicationController < Administrate::ApplicationController - include Monban::ControllerHelpers +module Admin + class ApplicationController < Administrate::ApplicationController + include Monban::ControllerHelpers - before_filter :require_login + before_filter :require_login - # 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 + # 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 + end end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index c9ecd45..25ccf0b 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,5 +1,5 @@ class SessionsController < ApplicationController - layout 'administrate/login' + layout 'admin/login' skip_before_action :require_login, only: [:new, :create] diff --git a/app/dashboards/category_dashboard.rb b/app/dashboards/category_dashboard.rb index 454dc49..f2027c2 100644 --- a/app/dashboards/category_dashboard.rb +++ b/app/dashboards/category_dashboard.rb @@ -8,15 +8,16 @@ class CategoryDashboard < Administrate::BaseDashboard # which determines how the attribute is displayed # on pages throughout the dashboard. ATTRIBUTE_TYPES = { + photos: Field::HasMany, id: Field::Number, name: Field::String, - slug: Field::String, description: Field::Text, created_at: Field::DateTime, updated_at: Field::DateTime, - base_colour: Field::ColourField, + photo_id: Field::Number, + base_colour: Field::String, sort: Field::Number, - photos: Field::HasMany, + slug: Field::String, } # COLLECTION_ATTRIBUTES @@ -25,25 +26,43 @@ class CategoryDashboard < Administrate::BaseDashboard # By default, it's limited to four items to reduce clutter on index pages. # Feel free to add, remove, or rearrange items. COLLECTION_ATTRIBUTES = [ - :base_colour, :name, - :description, + :base_colour, :photos, ] # SHOW_PAGE_ATTRIBUTES # an array of attributes that will be displayed on the model's show page. - SHOW_PAGE_ATTRIBUTES = ATTRIBUTE_TYPES.keys + SHOW_PAGE_ATTRIBUTES = [ + :id, + :name, + :slug, + :base_colour, + :description, + :created_at, + :updated_at, + :photo_id, + :sort, + :photos, + ] # FORM_ATTRIBUTES # an array of attributes that will be displayed # on the model's form (`new` and `edit`) pages. FORM_ATTRIBUTES = [ + :photos, :name, - :slug, :description, + :photo_id, :base_colour, :sort, - :photos, + :slug, ] + + # Overwrite this method to customize how categories are displayed + # across all pages of the admin dashboard. + # + def display_resource(category) + category.name + end end diff --git a/app/dashboards/page_dashboard.rb b/app/dashboards/page_dashboard.rb index fd7a849..c010d9b 100644 --- a/app/dashboards/page_dashboard.rb +++ b/app/dashboards/page_dashboard.rb @@ -8,10 +8,10 @@ class PageDashboard < Administrate::BaseDashboard # which determines how the attribute is displayed # on pages throughout the dashboard. ATTRIBUTE_TYPES = { - title: Field::String, - content: Field::MarkdownField, id: Field::Number, name: Field::String, + title: Field::String, + content: Field::Text, created_at: Field::DateTime, updated_at: Field::DateTime, } @@ -22,14 +22,20 @@ class PageDashboard < Administrate::BaseDashboard # By default, it's limited to four items to reduce clutter on index pages. # Feel free to add, remove, or rearrange items. COLLECTION_ATTRIBUTES = [ - :name, :title, - :content, + :name, ] # SHOW_PAGE_ATTRIBUTES # an array of attributes that will be displayed on the model's show page. - SHOW_PAGE_ATTRIBUTES = ATTRIBUTE_TYPES.keys + SHOW_PAGE_ATTRIBUTES = [ + :id, + :name, + :title, + :content, + :created_at, + :updated_at, + ] # FORM_ATTRIBUTES # an array of attributes that will be displayed @@ -39,4 +45,11 @@ class PageDashboard < Administrate::BaseDashboard :title, :content, ] + + # Overwrite this method to customize how pages are displayed + # across all pages of the admin dashboard. + # + def display_resource(page) + page.title + end end diff --git a/app/dashboards/photo_dashboard.rb b/app/dashboards/photo_dashboard.rb index 855f48f..df69416 100644 --- a/app/dashboards/photo_dashboard.rb +++ b/app/dashboards/photo_dashboard.rb @@ -8,19 +8,21 @@ class PhotoDashboard < Administrate::BaseDashboard # which determines how the attribute is displayed # on pages throughout the dashboard. ATTRIBUTE_TYPES = { - title: Field::String, - image: Field::Image, - description: Field::Text, + categories: Field::HasMany, + id: Field::Number, flickr_url: Field::String, - taken_at: Field::DateTime, created_at: Field::DateTime, updated_at: Field::DateTime, + title: Field::String, + description: Field::Text, + sort: Field::Number, featured: Field::Boolean, enabled: Field::Boolean, - id: Field::Number, - sort: Field::Number, + taken_at: Field::DateTime, views: Field::Number, - categories: Field::HasMany, + image_uid: Field::String, + image_name: Field::String, + image_cloudinary_id: Field::String, } # COLLECTION_ATTRIBUTES @@ -29,28 +31,54 @@ class PhotoDashboard < Administrate::BaseDashboard # By default, it's limited to four items to reduce clutter on index pages. # Feel free to add, remove, or rearrange items. COLLECTION_ATTRIBUTES = [ - :image, :title, :taken_at, - :views, + :featured, + :categories, ] # SHOW_PAGE_ATTRIBUTES # an array of attributes that will be displayed on the model's show page. - SHOW_PAGE_ATTRIBUTES = ATTRIBUTE_TYPES.keys + SHOW_PAGE_ATTRIBUTES = [ + :categories, + :id, + :flickr_url, + :created_at, + :updated_at, + :title, + :description, + :sort, + :featured, + :enabled, + :taken_at, + :views, + :image_uid, + :image_name, + :image_cloudinary_id, + ] # FORM_ATTRIBUTES # an array of attributes that will be displayed # on the model's form (`new` and `edit`) pages. FORM_ATTRIBUTES = [ - :title, - :image, - :description, + :categories, :flickr_url, - :taken_at, + :title, + :description, :sort, :featured, :enabled, - :categories, + :taken_at, + :views, + :image_uid, + :image_name, + :image_cloudinary_id, ] + + # Overwrite this method to customize how photos are displayed + # across all pages of the admin dashboard. + # + # def display_resource(photo) + # "Photo ##{photo.id}" + # end end diff --git a/app/dashboards/user_dashboard.rb b/app/dashboards/user_dashboard.rb index a387992..b5dcefb 100644 --- a/app/dashboards/user_dashboard.rb +++ b/app/dashboards/user_dashboard.rb @@ -21,15 +21,18 @@ class UserDashboard < Administrate::BaseDashboard # By default, it's limited to four items to reduce clutter on index pages. # Feel free to add, remove, or rearrange items. COLLECTION_ATTRIBUTES = [ - :id, :email, - :password_digest, - :created_at, ] # SHOW_PAGE_ATTRIBUTES # an array of attributes that will be displayed on the model's show page. - SHOW_PAGE_ATTRIBUTES = ATTRIBUTE_TYPES.keys + SHOW_PAGE_ATTRIBUTES = [ + :id, + :email, + :password_digest, + :created_at, + :updated_at, + ] # FORM_ATTRIBUTES # an array of attributes that will be displayed @@ -38,4 +41,11 @@ class UserDashboard < Administrate::BaseDashboard :email, :password_digest, ] + + # Overwrite this method to customize how users are displayed + # across all pages of the admin dashboard. + # + # def display_resource(user) + # "User ##{user.id}" + # end end diff --git a/app/fields/colour_field.rb b/app/fields/colour_field.rb deleted file mode 100644 index 9e74533..0000000 --- a/app/fields/colour_field.rb +++ /dev/null @@ -1,4 +0,0 @@ -require "administrate/fields/base" - -class ColourField < Administrate::Field::Base -end diff --git a/app/fields/markdown_field.rb b/app/fields/markdown_field.rb deleted file mode 100644 index 67f9a0a..0000000 --- a/app/fields/markdown_field.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "administrate/fields/base" - -class MarkdownField < Administrate::Field::Base - def rendered - renderer.render(data).html_safe - end - - def truncate - data.to_s[0...truncation_length] - end - - private - - def renderer - Redcarpet::Markdown.new(Redcarpet::Render::HTML, extensions: {}) - end - - def truncation_length - options.fetch(:truncate, 50) - end -end diff --git a/app/views/admin/application/_flashes.html.erb b/app/views/admin/application/_flashes.html.erb new file mode 100644 index 0000000..ff3a9f5 --- /dev/null +++ b/app/views/admin/application/_flashes.html.erb @@ -0,0 +1,20 @@ +<%# +# 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? %> +
+ <% flash.each do |key, value| -%> +
<%= value %>
+ <% end -%> +
+<% end %> diff --git a/app/views/admin/application/_javascript.html.erb b/app/views/admin/application/_javascript.html.erb new file mode 100644 index 0000000..499323b --- /dev/null +++ b/app/views/admin/application/_javascript.html.erb @@ -0,0 +1,19 @@ +<%# +# 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. +%> + +<%= javascript_include_tag "administrate/application" %> + +<%= yield :javascript %> + +<% if Rails.env.test? %> + <%= javascript_tag do %> + $.fx.off = true; + $.ajaxSetup({ async: false }); + <% end %> +<% end %> diff --git a/app/views/admin/application/_sidebar.html.erb b/app/views/admin/application/_sidebar.html.erb new file mode 100644 index 0000000..aa2a5fd --- /dev/null +++ b/app/views/admin/application/_sidebar.html.erb @@ -0,0 +1,20 @@ +<%# +# 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 +%> + + diff --git a/app/views/admin/applications/_collection.html.erb b/app/views/admin/applications/_collection.html.erb deleted file mode 100644 index a11e8fd..0000000 --- a/app/views/admin/applications/_collection.html.erb +++ /dev/null @@ -1,74 +0,0 @@ -<%# -# Table - -This partial is used on the `index` and `show` pages -to display a collection of resources in an HTML table. - -## Local variables: - -- `table_presenter`: - An instance of [Administrate::Page::Table][1]. - The table presenter uses `ResourceDashboard::TABLE_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/Table -%> - - - - - <% collection_presenter.attribute_types.each do |attr_name, attr_type| %> - - <% end %> - - - - - - <% resources.each do |resource| %> - - <% collection_presenter.attributes_for(resource).each do |attribute| %> - - <% end %> - - - - - - <% end %> - -
- <%= link_to(params.merge( - collection_presenter.order_params_for(attr_name) - )) do %> - <%= attr_name.to_s.titleize %> - - <% if collection_presenter.ordered_by?(attr_name) %> - - <%= inline_svg("administrate/sort_arrow.svg") %> - - <% end %> - <% end %> -
- <%= render_field attribute %> - <%= link_to( - t("administrate.actions.edit"), - [:edit, Administrate::NAMESPACE, resource], - class: "action-edit", - ) %><%= link_to( - t("administrate.actions.destroy"), - [Administrate::NAMESPACE, resource], - class: "table__action--destroy", - method: :delete, - data: { confirm: t("administrate.actions.confirm") } - ) %>
diff --git a/app/views/admin/applications/_form.html.erb b/app/views/admin/applications/_form.html.erb deleted file mode 100644 index 2cea728..0000000 --- a/app/views/admin/applications/_form.html.erb +++ /dev/null @@ -1,44 +0,0 @@ -<%# -# Form Partial - -This partial is rendered on a resource's `new` and `edit` pages, -and renders all form fields for a resource's editable attributes. - -## Local variables: - -- `page`: - An instance of [Administrate::Page::Form][1]. - Contains helper methods to display a form, - and knows which attributes should be displayed in the resource's form. - -[1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Form -%> - -<%= form_for([Administrate::NAMESPACE, page.resource], class: "form") do |f| %> - <% if page.resource.errors.any? %> -
-

- <%= pluralize(page.resource.errors.count, "error") %> - prohibited this <%= page.resource_name %> from being saved: -

- - -
- <% end %> - -
- <% page.attributes.each do |attribute| -%> -
- <%= render_field attribute, f: f %> -
- <% end -%> -
- -
- <%= f.submit %> -
-<% end %> diff --git a/app/views/admin/applications/edit.html.erb b/app/views/admin/applications/edit.html.erb deleted file mode 100644 index b604a5b..0000000 --- a/app/views/admin/applications/edit.html.erb +++ /dev/null @@ -1,25 +0,0 @@ -<%# -# Edit - -This view is the template for the edit page. - -It displays a header, and renders the `_form` partial to do the heavy lifting. - -## Local variables: - -- `page`: - An instance of [Administrate::Page::Form][1]. - Contains helper methods to help display a form, - and knows which attributes should be displayed in the resource's form. - -[1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Form -%> - -<% content_for(:title) { "Edit #{page.page_title}" } %> - -
-

<%= content_for(:title) %>

- <%= link_to "Show #{page.resource}", [Administrate::NAMESPACE, page.resource], class: "button" %> -
- -<%= render "form", page: page %> diff --git a/app/views/admin/applications/index.html.erb b/app/views/admin/applications/index.html.erb deleted file mode 100644 index c99dd6b..0000000 --- a/app/views/admin/applications/index.html.erb +++ /dev/null @@ -1,55 +0,0 @@ -<%# -# 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::Table][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. - -[1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Table -%> - -<% content_for(:title) { page.resource_name.pluralize.titleize } %> - -<% content_for(:search) do %> - -<% end %> - -
-

<%= content_for(:title) %>

- <%= link_to( - "New #{page.resource_name.titleize.downcase}", - [:new, Administrate::NAMESPACE, page.resource_name], - class: "button", - ) %> -
- -<%= render "collection", collection_presenter: page, resources: resources %> - -<%= paginate resources %> diff --git a/app/views/admin/applications/new.html.erb b/app/views/admin/applications/new.html.erb deleted file mode 100644 index 46a7063..0000000 --- a/app/views/admin/applications/new.html.erb +++ /dev/null @@ -1,25 +0,0 @@ -<%# -# New - -This view is the template for the "new resource" page. -It displays a header, and then renders the `_form` partial -to do the heavy lifting. - -## Local variables: - -- `page`: - An instance of [Administrate::Page::Form][1]. - Contains helper methods to help display a form, - and knows which attributes should be displayed in the resource's form. - -[1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Form -%> - -<% content_for(:title) { "New #{page.resource_name.titleize}" } %> - -
-

<%= content_for(:title) %>

- <%= link_to 'Back', :back, class: "button" %> -
- -<%= render 'form', page: page %> diff --git a/app/views/admin/applications/show.html.erb b/app/views/admin/applications/show.html.erb deleted file mode 100644 index 7c01eaf..0000000 --- a/app/views/admin/applications/show.html.erb +++ /dev/null @@ -1,37 +0,0 @@ -<%# -# 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) %>

- <%= link_to( - "Edit", - [:edit, Administrate::NAMESPACE, page.resource], - class: "button", - ) %> -
- -
- <% page.attributes.each do |attribute| %> -
<%= attribute.name.titleize %>
- -
<%= render_field attribute %>
- <% end %> -
diff --git a/app/views/layouts/admin/application.html.erb b/app/views/layouts/admin/application.html.erb new file mode 100644 index 0000000..07ef1bb --- /dev/null +++ b/app/views/layouts/admin/application.html.erb @@ -0,0 +1,48 @@ +<%# +# Application Layout + +This view template is used as the layout +for every page that Administrate generates. + +By default, it renders: +- Sidebar for navigation +- Content for a search bar + (if provided by a `content_for` block in a nested page) +- Flashes +- Links to stylesheets and Javascripts +%> + + + + + + + + <%= content_for(:title) %> | <%= Rails.application.class.parent_name.titlecase %> + <%= stylesheet_link_tag "administrate/application", media: "all" %> + <%= stylesheet_link_tag "administrate/overrides", media: "all" %> + <%= csrf_meta_tags %> + + + + +
+ + + +
+ <%= content_for(:search) %> + <%= render "flashes" -%> + <%= yield %> +
+ +
+ + <%= render "javascript" %> + + diff --git a/app/views/layouts/admin/login.html.erb b/app/views/layouts/admin/login.html.erb new file mode 100644 index 0000000..48a875b --- /dev/null +++ b/app/views/layouts/admin/login.html.erb @@ -0,0 +1,40 @@ +<%# +# Application Layout + +This view template is used as the layout +for every page that Administrate generates. + +By default, it renders: +- Sidebar for navigation +- Content for a search bar + (if provided by a `content_for` block in a nested page) +- Flashes +- Links to stylesheets and Javascripts +%> + + + + + + + + <%= Rails.application.class.parent_name.titlecase %> + <%= stylesheet_link_tag "administrate/application", media: "all" %> + <%= stylesheet_link_tag "administrate/overrides", media: "all" %> + <%= csrf_meta_tags %> + + + + +
+ +
+ <%= render "admin/application/flashes" -%> + <%= yield %> +
+ +
+ + <%= render "admin/application/javascript" %> + + diff --git a/app/views/layouts/administrate/application.html.erb b/app/views/layouts/administrate/application.html.erb deleted file mode 100644 index f1ea89d..0000000 --- a/app/views/layouts/administrate/application.html.erb +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - <%= content_for(:title) %> | <%= Rails.application.class.parent_name.titlecase %> - <%= stylesheet_link_tag "//fonts.googleapis.com/css?family=Lato:300,400,900", media: "all" %> - <%= stylesheet_link_tag "administrate/application", media: "all" %> - <%= stylesheet_link_tag "administrate/overrides", media: "all" %> - <%= csrf_meta_tags %> - - - -
- - -
- <%= content_for(:search) %> -
- <%= render "flashes" -%> - <%= yield %> -
-
-
- - <%= render "javascript" %> - - diff --git a/app/views/layouts/administrate/login.html.erb b/app/views/layouts/administrate/login.html.erb deleted file mode 100644 index b494e67..0000000 --- a/app/views/layouts/administrate/login.html.erb +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - <%= Rails.application.class.parent_name.titlecase %> - <%= stylesheet_link_tag "//fonts.googleapis.com/css?family=Lato:300,400,900", media: "all" %> - <%= stylesheet_link_tag "administrate/application", media: "all" %> - <%= stylesheet_link_tag "administrate/overrides", media: "all" %> - <%= csrf_meta_tags %> - - - -
-
-
- <%= render "administrate/application/flashes" -%> - <%= yield %> -
-
-
- - diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index 7afd523..1088c1a 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -4,14 +4,22 @@ <%= form_for :session, url: session_path do |form| %>
-
- <%= form.label :email %> - <%= form.email_field :email %> +
+
+ <%= form.label :email %> +
+
+ <%= form.email_field :email %> +
-
- <%= form.label :password %> - <%= form.password_field :password %> +
+
+ <%= form.label :password %> +
+
+ <%= form.password_field :password %> +
diff --git a/config/environments/production.rb b/config/environments/production.rb index c109528..20e9dd0 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -74,7 +74,7 @@ DanBarberPhoto::Application.configure do :domain => 'heroku.com' } ActionMailer::Base.delivery_method = :smtp - + config.action_mailer.default_url_options = { :host => "danbarberphoto.com" } end diff --git a/config/routes.rb b/config/routes.rb index c276f5a..77885d7 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -3,11 +3,12 @@ require 'monban/constraints/signed_out' DanBarberPhoto::Application.routes.draw do namespace :admin do - DashboardManifest::DASHBOARDS.each do |dashboard_resource| - resources dashboard_resource - end + resources :categories + resources :pages + resources :photos + resources :users - root controller: DashboardManifest::ROOT_DASHBOARD, action: :index + root to: "categories#index" end resource :session, only: [:new, :create, :destroy]