This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Refinery | |
module PhotoGallery | |
module Extensions | |
module Pages | |
def has_one_page_album | |
has_many :album_page, :as => :page, :dependent=> :destroy | |
has_many :album, :through => :album_page | |
has_many :photos, :class_name => Refinery::PhotoGallery::Photo, :through => :album , :order => "created_at ASC" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# == Schema Information | |
# Schema version: 20130116180743 | |
# | |
# Table name: users | |
# | |
# id :integer not null, primary key | |
# name :string(255) | |
# email :string(255) | |
# created_at :datetime not null | |
# updated_at :datetime not null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def content_with_parent_fallback | |
content_without_parent_fallback.presence || translation_for(parent_translation(I18n.locale)).try(:content) | |
end | |
alias_method_chain :content, :parent_fallback | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section id="carousel"> | |
<div id="myCarousel" class="carousel slide"> | |
<ul class="carousel-inner"> | |
<% @slides.each_with_index do |slide, i| %> | |
<% if i==0 %> | |
<li class="item active"> | |
<% else %> | |
<li class="item"> | |
<% end %> | |
<%= link_to image_fu(slide.image, '1200x490!'), refinery.slides_slide_path(slide) %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section id="carousel"> | |
<div id="myCarousel" class="carousel slide"> | |
<ul class="carousel-inner"> | |
<% @slides.each_with_index do |slide, i| %> | |
<% if i==0 %> | |
<li class="item active"> | |
<% else %> | |
<li class="item"> | |
<% end %> | |
<%= link_to image_fu(slide.image, '1200x490!'), refinery.slides_slide_path(slide) %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'gh' | |
contributions = {} | |
repositories = {} | |
longest_name = 0 | |
GH.with(username: ENV['GITHUB_USERNAME'], password: ENV['GITHUB_PASSWORD']) do | |
GH["orgs/#{ENV['ORG']}/repos"].each do |repository| | |
repositories[repository['full_name']] = GH["repos/#{repository['full_name']}/contributors"] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/core/lib/refinery/plugins.rb b/core/lib/refinery/plugins.rb | |
index a22497f..cef123e 100644 | |
--- a/core/lib/refinery/plugins.rb | |
+++ b/core/lib/refinery/plugins.rb | |
@@ -1,5 +1,10 @@ | |
module Refinery | |
- class Plugins < Array | |
+ class Plugins | |
+ include Enumerable | |
+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'http://rubygems.org' | |
gem 'rails', '~> 3.0.11' | |
gem 'foreman' | |
gem 'unicorn' | |
gem 'airbrake' | |
gem 'delayed_job' | |
gem 'compass', '~> 0.12.alpha' | |
gem 'acts-as-taggable-on', '~>2.1.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def current_theme | |
# first, check if we've tried to access this already and if so @current_theme will be populated with a value. | |
@current_theme ||= if params[:ChangeTheme] == "true" | |
# If the user is trying to change the theme, first: construct an array of possible themes. | |
# then: reject the theme in the current session if it is present. | |
# Finally, grab a random sample to use a random theme from the array of themes. | |
%w[power.css creative.css communication.css].reject{|theme| theme == session[:current_theme]}.sample | |
else | |
# The user is not trying to change the theme so just return the current theme saved to sesssion OR | |
# return the default theme which is 'power.css' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= stylesheet_link_tag(current_theme) %> |