Better side menu

This commit is contained in:
2015-02-25 10:11:48 +01:00
parent 2df08b7348
commit b0491aa997
2 changed files with 10 additions and 10 deletions
+6 -6
View File
@@ -2,27 +2,27 @@ module Cmtool
class Quote
include SimplyStored::Couch
include Paperclip::Glue
property :owner
property :function
property :state
property :body
property :active, :type => :boolean, :default => true
property :locale
property :image_file_name
property :image_content_type
property :image_file_size, :type => Fixnum
property :image_updated_at, :type => Time
has_attached_file :image, :styles => {:medium => "300x1000>", :thumb => "137x1250>" }
view :for_sidebar_view, :key => [:state, :created_at], :conditions => %{doc['active']}
STATES = %w[page sidebar]
def self.active(*args)
database.view(for_sidebar_view(*args))
end
def self.for_page
active(:startkey => ['page'], :endkey => ['page', {}])
end
@@ -30,7 +30,7 @@ module Cmtool
def self.states
STATES
end
def self.for_sidebar
active(:startkey => ['sidebar'], :endkey => ['sidebar', {}], :limit => 2)
end
@@ -27,14 +27,14 @@ html lang="en"
= render 'cmtool/application/alerts'
.row
.small-12.large-9.columns
h3= content_for?(:page_title) ? yield(:page_title) : application_title
= content_for?(:content) ? yield(:content) : yield
- if content_for?(:page_links)
#sub-navigation-container= yield(:page_links)
.show-for-large-up.large-3.columns
.panel.sidebar-nav
h3= content_for?(:page_title) ? yield(:page_title) : application_title
ul.nav.nav-list
li.nav-header Links
.panel
h4 Links
ul.side-nav
li= link_to "Home", root_path
li= link_to 'Wiki', 'https://github.com/bterkuile/cmtool/wiki', target: :_blank
= yield :sidebar