diff --git a/app/models/cmtool/quote.rb b/app/models/cmtool/quote.rb index b45d78a..e3f602d 100644 --- a/app/models/cmtool/quote.rb +++ b/app/models/cmtool/quote.rb @@ -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 diff --git a/app/views/layouts/cmtool/application.html.slim b/app/views/layouts/cmtool/application.html.slim index 5053eff..cbcf80c 100644 --- a/app/views/layouts/cmtool/application.html.slim +++ b/app/views/layouts/cmtool/application.html.slim @@ -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