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
var get_calendar; | |
var calendar, endDay, firstDay, firstWeekDay, headerRow, i, j, lastWeekDay, len, len1, month, monthRange, row, startDate, week, weekRange, weeks, year, | |
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; | |
get_calendar = function(year, month) { | |
startDate = moment([year, month]); | |
firstDay = moment(startDate).startOf('month'); | |
endDay = moment(startDate).endOf('month'); | |
monthRange = moment.range(firstDay, endDay); | |
weeks = []; |
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
var required_financial_fields = {{LOAN_REQUIRED_FINANCIAL_FIELDS|safe}}; | |
var fields = [] | |
for(var key in required_financial_fields) { | |
fields = fields.concat(required_financial_fields[key]) | |
} | |
function hideAllFields() { | |
for(var i = 0; i < fields.length; i++) { | |
document.querySelector('[name='+fields[i]+']').parentNode.parentNode.style.display = "none"; |
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
{% if messages %} | |
<div class="container messages"> | |
<div class="row"> | |
<div class="col-md-12"> | |
{% for message in messages %} | |
<div class="alert {% if message.tags %} alert-{{ message.tags }}{% endif %}"> | |
<a class="close" data-dismiss="alert" href="#">×</a> | |
{{ message }} | |
</div> | |
{% endfor %} |
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
// For a given HTML snippet with the class "parallax" | |
// | |
// <div class="parallax" style="height: 400px; overflow: hidden;"> | |
// <div style="background-image:url('http://via.placeholder.com/1600x780');"></div> | |
// </div> | |
(function(){ | |
var speedRatio = 4 | |
var minYOffset = -200 |
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
function toggleCheckboxes(){ | |
var checkboxes = document.querySelectorAll("[name=accommodation]") | |
var allChecked = Array.prototype.every.call(checkboxes, function(item){ return item.checked }) | |
if (allChecked) { | |
checkboxes.forEach(function(item){ item.checked = false }) | |
} else { | |
checkboxes.forEach(function(item){ item.checked = true }) | |
} | |
} |
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
// Author: Guillaume Piot, Alex Russell | |
// Copyright 2017 | |
// MIT License | |
var currency_fields = document.getElementsByClassName('form__text--currency') | |
function formatCurrencyField(elm){ | |
// Duplicate the element to create: | |
// - a hidden version with the integer value tp submitted to the form | |
// - a new text input to display the formatted value |
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
// Extension for unslider.js, add a thumbnail trailer | |
// HOW TO USE | |
// Include this script in your page first, after unslider.js | |
// Then output the thumbnails as follows: | |
// <div class="slide-control"> | |
// <a href="#prev" class="unslider-arrow prev"></a> | |
// <a href="#next" class="unslider-arrow next"></a> | |
// <div class="thumbnail_slider" style="width: 368px;"> |
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
location ~ /more_details.php { | |
if ($args ~* "^profileID=(\d+)") { | |
set $mid $1; | |
set $args ''; | |
rewrite ^.*$ /view/$mid permanent; | |
} | |
} |
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
$('.close').click(function(){ | |
$('#video').modal('hide'); | |
}) | |
$('#open-video').click(function(){ | |
$('#video').modal({'show':true}).on('hidden', function () { | |
toggleVideo('hide'); | |
}); | |
toggleVideo(); | |
}) |
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
# Tested in Django 1.6 | |
# Import default list filter | |
from django.contrib.admin import SimpleListFilter | |
# Create the filter | |
class InvoicePaidFilter(SimpleListFilter): | |
title = _('Paid') | |
parameter_name = 'paid' | |