Skip to content

Instantly share code, notes, and snippets.

@leemcalilly
Created December 6, 2012 16:50
Show Gist options
  • Save leemcalilly/4225980 to your computer and use it in GitHub Desktop.
Save leemcalilly/4225980 to your computer and use it in GitHub Desktop.
Checklist of File Changes for Setting up Refinery CMS with Twitter Bootstrap
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require_tree .
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
*= require_tree .
*/
// Place changes to Twitter Bootstrap CSS rules here
// Overriding bootstrap variables must come before loading bootstrap
@import 'variables';
// Load bootstrap
@import 'bootstrap';
body { padding-top: 60px; }
@import 'bootstrap-responsive';
// These variables need to be imported to each stylesheet that you want to use them in
$green: #488073;
$blue: #404b89;
$peach: #c68474;
$black: #292421;
$white: #ffffff;
$sansFontFamily: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
$headingsColor: $blue;
$linkColor: $green;
$textColor: $black;
module ApplicationHelper
def custom_menu_branch_css(local_assigns)
options = local_assigns.dup
options.update(:sibling_count => options[:menu_branch].shown_siblings.length) unless options[:sibling_count]
css = []
css << 'active' if selected_page_or_descendant_page_selected?(local_assigns[:menu_branch])
css
end
end
<!DOCTYPE html>
<%= render '/refinery/html_tag' %>
<%= render '/refinery/head' %>
<body>
<%= render '/refinery/ie6check' if request.env['HTTP_USER_AGENT'] =~ /MSIE/ -%>
<div id="page_container">
<header id="header">
<%= render '/refinery/header' -%>
</header>
<section id="page" class="container">
<%= yield %>
</section>
<footer class="container">
<%= render '/refinery/footer' -%>
</footer>
</div>
<%= render '/refinery/javascripts' %>
</body>
</html>
<head>
<meta charset='<%= Rails.application.config.encoding %>' />
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /><![endif]-->
<title><%= browser_title(yield(:title)) %></title>
<%= raw(%(<meta name="description" content="#{@meta.meta_description}" />)) if @meta.meta_description.present? -%>
<%= raw(%(<meta name="keywords" content="#{@meta.meta_keywords}">)) if @meta.meta_keywords.present? -%>
<%= raw(%(<link rel="canonical" content="#{@canonical}" />)) if @canonical.present? -%>
<%= csrf_meta_tags if Refinery::Core.authenticity_token_on_frontend -%>
<%= yield :meta %>
<%= stylesheet_link_tag "application" %>
<%= yield :stylesheets %>
<%= render :partial => '/refinery/google_analytics' %>
<%= javascript_include_tag 'modernizr-min' %>
</head>
<%= render(:partial => "/refinery/menu", :locals => {
:dom_id => 'menu',
:css => 'menu'
}) %>
<%
# Collect the root items.
# ::Refinery::Menu is smart enough to remember all of the items in the original collection.
if (roots = local_assigns[:roots] || (collection ||= refinery_menu_pages).roots).present?
dom_id ||= 'menu'
css = [(css || 'menu'), 'clearfix'].flatten.join(' ')
hide_children = Refinery::Core.menu_hide_children if hide_children.nil?
-%>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<%= link_to Refinery::Core.site_name, refinery.root_path, :class => 'brand' %>
<div class="nav-collapse collapse">
<nav id='<%= dom_id %>' class='<%= css %> nav'>
<ul class="nav">
<%= render :partial => '/refinery/menu_branch', :collection => roots,
:locals => {
:hide_children => hide_children,
:sibling_count => (roots.length - 1),
:menu_levels => local_assigns[:menu_levels],
:apply_css => true #if you don't care about class='first' class='last' or class='selected' set apply_css to false for speed.
} -%>
</ul>
</nav>
</div><!-- /.nav-collapse -->
</div><!-- /.container -->
</div><!-- /.navbar-inner -->
</div><!-- /.navbar -->
<% end -%>
source 'https://rubygems.org'
gem 'rails', '3.2.9'
gem 'jquery-rails', '~> 2.0.0'
gem 'bootstrap-sass'
group :development, :test do
gem 'sqlite3'
end
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
end
# Refinery CMS
gem 'refinerycms', '~> 2.0.0'
# Specify additional Refinery CMS Extensions here (all optional):
gem 'refinerycms-i18n', '~> 2.0.0'
# gem 'refinerycms-blog', '~> 2.0.0'
# gem 'refinerycms-inquiries', '~> 2.0.0'
# gem 'refinerycms-search', '~> 2.0.0'
# gem 'refinerycms-page-images', '~> 2.0.0'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment