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
order_type = params[:order_type] | |
if(order_type == 'chronological') | |
products.order_by_date | |
elsif(order_type == 'alphabetical') | |
products.order_by_name | |
elsif(order_type == 'price') | |
products.order_by_price | |
else | |
# ... order alist by some default |
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
<aspect min-screen="lg" ratio="0.5625"> | |
<oomph-analytics job-id="1542" /> | |
<animation id="anim01" type="move-in-from-left" /> | |
<layer z-index="0" background-src="./aspect02/layer0/lg0535.jpg"> | |
<ips id="ips01" width="53%" height="30%" left="10%" top="5%"> | |
<ips-slide background-src="./aspect02/ips01/01.jpg"> | |
<link href="http://www.google.com" top="90%" left="80%" width="20%" height="10%" /> | |
</ips-slide> | |
<ips-slide background-src="./aspect02/ips01/02.jpg" /></ips-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
# https://github.com/mogeneration/adomatic/blob/ruth/feature/duplicate_job/app/controllers/jobs_controller.rb#L32 | |
if check_required_fields @job | |
if @job.save | |
@job.send_status_email | |
if current_user.is_admin? | |
redirect_to admin_organisation_job_queue_job_url(@job.job_queue.organisation, @job.job_queue, @job), notice: 'Job was successfully created.' | |
else | |
redirect_to job_queue_job_url(@job.job_queue, @job), notice: 'Job was successfully created.' | |
end | |
else |
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
duplicate_fields = (url) -> | |
if $('.duplicatable_nested_form').length == 1 && (typeof $('#upload_content_location').attr('value') == 'undefined') | |
$('#upload_content_location').attr('value', url) | |
return | |
if $('.duplicatable_nested_form').length > 0 | |
lastNestedForm = $('.duplicatable_nested_form').last() | |
nestedForm = $('.duplicatable_nested_form').last().clone() | |
update_clone_block(nestedForm[0], url) | |
$( nestedForm ).insertAfter( lastNestedForm ) |
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
# GET /everything | |
def index | |
@page = params[:page] ||= 1 # Set as 1 if page number not provided | |
gon.current_page = @page # Not sure I'm a fan of setting JS variables this way, but will leave for now | |
@shots = Shot.seen_by(current_user).paginate(page: @page) | |
@notifications = Notification.unseen_counts(shots: @shots, user: current_user) # Not great, but better | |
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
<% flash.each do |key, value| %> | |
<p class="<%= key %>"><%= value %></p> | |
<% end %> |