This file contains hidden or 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
// FADEOUT THE LOADING GRAPHIC AFTER WAITING 1 SEC | |
function fadeSpinner(complete){ | |
$('.delay-spinner').delay(1000).fadeToggle(500, 'easeOutQuart', complete); | |
} | |
// FADEIN THE CONTENT | |
function fadeInContent(type){ | |
$('.ps-item-content .'+type+'').fadeToggle(700, 'easeInQuart'); | |
} | |
var fadeSpinnerType = function(){ |
This file contains hidden or 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
<script type="text/javascript"> | |
$(document).ready(function() { | |
$('#next_approver_email_field').toggle(); | |
$('#approval_checked').click(function() { | |
$('#next_approver_email_field').show(); | |
}); | |
}); | |
</script> |
This file contains hidden or 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
<%= form_for @recommendation, :html => { :multipart => true} do |f| %> | |
<% if @recommendation.errors.any? %> | |
<div id="error_explanation"> | |
<h2><%= pluralize(@recommendation.errors.count, "error") %> prohibited this recommendation from being saved:</h2> | |
<ul> | |
<% @recommendation.errors.full_messages.each do |msg| %> | |
<li><%= msg %></li> | |
<% end %> | |
</ul> |
This file contains hidden or 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
# resources :recommendations, :has_many => :approvals | |
resources :recommendations, :shallow => true do | |
resources :approvals | |
end |
This file contains hidden or 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
add_action( 'init', 'event_rewrites' ); | |
function event_rewrites() | |
{ | |
add_rewrite_rule( "/\/events\/day\/([\d]{4}-[\d]{2}-[\d]{2})\/?/", 'index.php?post_type=event&event-date=$matches[1]', 'top' ); | |
} | |
add_filter( 'query_vars', 'event_vars' ); | |
function event_vars ( $vars ) | |
{ | |
$vars[] = 'event-date'; | |
return $vars; |
This file contains hidden or 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
<?php | |
$today = date("o-m-d"); | |
$future = strtotime ( '+6 days' , strtotime ( $today ) ) ; | |
$future = date ( 'o-m-d' , $future ); | |
$event_query = new WP_Query( | |
array( | |
'post_type' => 'event', | |
'meta_key' => 'event-date', | |
'orderby' => 'meta_value', | |
'order' => 'asc', |
This file contains hidden or 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
class Object | |
def if_present?(&blk) | |
if blk.arity == -1 | |
instance_eval(&blk) | |
else | |
blk.call(self) | |
end | |
end | |
This file contains hidden or 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 wedgie_tws | |
@products = Product.find :all, :conditions => {:name_data => ['double-agent', 'nitrane-contraband', 'delta-mvmnt', 'contraband', 'bandita-contraband']} | |
end |
This file contains hidden or 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
# Unique for each merchant. Your merchant_group_id is located in the PowerReviews Dashboard > Merchant | |
# Group Properties section. | |
PowerReviews::Config.merchant_group_id = 11979 | |
# ID representing your website (default value is "1"). If you have multiple websites and would like to | |
# integrate PowerReviews onto each site, we can set your account as a Master Merchant. This enables | |
# review sharing and consolidated management among your different websites. When using the “Master | |
# Merchant” configuration, you assign a different Site ID to each site that will have reviews. This ID | |
# can be your own internal ID for the site or an ID assigned by PowerReviews. If you are implementing |
This file contains hidden or 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 results | |
return @results unless @results.nil? | |
# Strategy | |
# First always, consider the weight range, right now we'll find where max_weight = :weight | |
conditions = ['', {}] | |
#conditions = ["weight_range_max = :weight", {:weight => self.weight}] | |
# If they choose kids for intended use then just find shoes for kids and ignore gender | |
# | |
if self.intended_use == 'kids' |
NewerOlder