Add scroll pane to admin dashboard

This commit is contained in:
Rob H
2014-05-09 17:20:53 +10:00
parent 05e01d02c4
commit c98d2e71d8
3 changed files with 30 additions and 26 deletions

View File

@@ -31,6 +31,10 @@ div.dashboard_item
h3
padding: 5px 5px 5px 3%
.list
max-height: 250px
overflow-y: auto
.list-title
border: solid #5498da
border-width: 0px 1px 0px 1px

View File

@@ -2,7 +2,7 @@ module Spree
module Admin
class OverviewController < Spree::Admin::BaseController
def index
@enterprises = Enterprise.managed_by(spree_current_user).order('is_distributor DESC, is_primary_producer ASC, name').limit(4)
@enterprises = Enterprise.managed_by(spree_current_user).order('is_distributor DESC, is_primary_producer ASC, name')
@product_count = Spree::Product.active.managed_by(spree_current_user).count
@order_cycle_count = OrderCycle.active.managed_by(spree_current_user).count
end

View File

@@ -2,42 +2,42 @@
%div.header.sixteen.columns.alpha{ :class => "#{@enterprises.count > 0 ? "" : "red"}"}
%h3.five.columns.alpha My Enterprises
%a.with-tip{ title: "Enterprises are Producers and/or Hubs and are the basic unit of organisation within the Open Food Network." } What's this?
%div.sixteen.columns.alpha.list
- if @enterprises.empty?
%div.sixteen.columns.alpha.list-item.red
%span.text.fifteen.columns.alpha You have no enterprises.
%span.one.columns.omega
%span.icon-remove-sign
%a.sixteen.columns.alpha.button.bottom.red{ href: "#{main_app.new_admin_enterprise_path}" }
CREATE NEW ENTERPRISE
%span.icon-arrow-right
- else
%div.sixteen.columns.alpha.list-title
%span.five.columns.alpha Name
%span.centered.three.columns Payment Methods
%span.centered.three.columns Shipping Methods
%span.centered.three.columns Enterprise Fees
- if @enterprises.empty?
%div.sixteen.columns.alpha.list-item.red
%span.text.fifteen.columns.alpha You have no enterprises.
%span.one.columns.omega
%span.icon-remove-sign
%a.sixteen.columns.alpha.button.bottom.red{ href: "#{main_app.new_admin_enterprise_path}" }
CREATE NEW ENTERPRISE
%span.icon-arrow-right
- else
%div.sixteen.columns.alpha.list-title
%span.five.columns.alpha Name
%span.centered.three.columns Payment Methods
%span.centered.three.columns Shipping Methods
%span.centered.three.columns Enterprise Fees
%div.sixteen.columns.alpha.list
- @enterprises.each do |enterprise|
%a.sixteen.columns.alpha.list-item{ class: "#{cycle('odd','even')}", href: "#{main_app.edit_admin_enterprise_path(enterprise)}" }
%span.five.columns.alpha
= enterprise.name
%span.symbol.three.columns.centered
- if enterprise.payment_methods.count > 0
%span.icon-ok-sign
- if enterprise.payment_methods.count < 1 && enterprise.is_distributor
%span.icon-remove-sign.with-tip{ title: "This enterprise has no payment methods" }
- else
%span.icon-remove-sign
%span.icon-ok-sign
%span.symbol.three.columns.centered
- if enterprise.shipping_methods.count > 0
%span.icon-ok-sign
- if enterprise.shipping_methods.count < 1 && enterprise.is_distributor
%span.icon-remove-sign.with-tip{ title: "This enterprise has no shipping methods" }
- else
%span.icon-remove-sign
%span.icon-ok-sign
%span.symbol.three.columns.centered
- if enterprise.enterprise_fees.count > 0
%span.icon-ok-sign
- else
%span.icon-warning-sign
%span.icon-warning-sign.with-tip{ title: "This enterprise has no enterprise fees" }
%span.two.columns.omega.right
%span.icon-arrow-right
%a.sixteen.columns.alpha.button.bottom.blue{ href: "#{main_app.admin_enterprises_path}" }
MANAGE MY ENTERPRISES
%span.icon-arrow-right
%a.sixteen.columns.alpha.button.bottom.blue{ href: "#{main_app.admin_enterprises_path}" }
MANAGE MY ENTERPRISES
%span.icon-arrow-right