Initial refactor of rigboard template

This commit is contained in:
2020-03-09 22:44:46 +00:00
parent 1e5fcbdba0
commit 320c43e472
54 changed files with 52 additions and 17111 deletions

View File

@@ -34,7 +34,7 @@ __author__ = 'ghost'
class RigboardIndex(generic.TemplateView):
template_name = 'RIGS/rigboard.html'
template_name = 'rigboard.html'
def get_context_data(self, **kwargs):
# get super context
@@ -46,7 +46,7 @@ class RigboardIndex(generic.TemplateView):
class WebCalendar(generic.TemplateView):
template_name = 'RIGS/calendar.html'
template_name = 'calendar.html'
def get_context_data(self, **kwargs):
context = super(WebCalendar, self).get_context_data(**kwargs)
@@ -78,7 +78,7 @@ class EventOembed(generic.View):
class EventEmbed(EventDetail):
template_name = 'RIGS/event_embed.html'
template_name = 'event_embed.html'
class EventRA(generic.base.RedirectView):
@@ -189,7 +189,7 @@ class EventDuplicate(EventUpdate):
class EventPrint(generic.View):
def get(self, request, pk):
object = get_object_or_404(models.Event, pk=pk)
template = get_template('RIGS/event_print.xml')
template = get_template('event_print.xml')
merger = PdfFileMerger()
@@ -197,8 +197,8 @@ class EventPrint(generic.View):
'object': object,
'fonts': {
'opensans': {
'regular': 'RIGS/static/fonts/OPENSANS-REGULAR.TTF',
'bold': 'RIGS/static/fonts/OPENSANS-BOLD.TTF',
'regular': 'static/fonts/OPENSANS-REGULAR.TTF',
'bold': 'static/fonts/OPENSANS-BOLD.TTF',
}
},
'quote': True,
@@ -287,8 +287,8 @@ class EventArchive(generic.ListView):
class EventAuthorise(generic.UpdateView):
template_name = 'RIGS/eventauthorisation_form.html'
success_template = 'RIGS/eventauthorisation_success.html'
template_name = 'eventauthorisation_form.html'
success_template = 'eventauthorisation_success.html'
def form_valid(self, form):
self.object = form.save()
@@ -351,7 +351,7 @@ class EventAuthorise(generic.UpdateView):
class EventAuthorisationRequest(generic.FormView, generic.detail.SingleObjectMixin):
model = models.Event
form_class = forms.EventAuthorisationRequestForm
template_name = 'RIGS/eventauthorisation_request.html'
template_name = 'eventauthorisation_request.html'
@method_decorator(decorators.nottinghamtec_address_required)
def dispatch(self, *args, **kwargs):

View File

@@ -1 +0,0 @@
!function(h){"use strict";var r=function(t,i){this.options=h.extend({},r.DEFAULTS,i),this.$target=h(this.options.target).on("scroll.bs.affix.data-api",h.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",h.proxy(this.checkPositionWithEventLoop,this)),this.$element=h(t),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};function e(o){return this.each(function(){var t=h(this),i=t.data("bs.affix"),e="object"==typeof o&&o;i||t.data("bs.affix",i=new r(this,e)),"string"==typeof o&&i[o]()})}r.VERSION="3.3.7",r.RESET="affix affix-top affix-bottom",r.DEFAULTS={offset:0,target:window},r.prototype.getState=function(t,i,e,o){var f=this.$target.scrollTop(),n=this.$element.offset(),s=this.$target.height();if(null!=e&&"top"==this.affixed)return f<e&&"top";if("bottom"==this.affixed)return null!=e?!(f+this.unpin<=n.top)&&"bottom":!(f+s<=t-o)&&"bottom";var a=null==this.affixed,h=a?f:n.top;return null!=e&&f<=e?"top":null!=o&&t-o<=h+(a?s:i)&&"bottom"},r.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(r.RESET).addClass("affix");var t=this.$target.scrollTop(),i=this.$element.offset();return this.pinnedOffset=i.top-t},r.prototype.checkPositionWithEventLoop=function(){setTimeout(h.proxy(this.checkPosition,this),1)},r.prototype.checkPosition=function(){if(this.$element.is(":visible")){var t=this.$element.height(),i=this.options.offset,e=i.top,o=i.bottom,f=Math.max(h(document).height(),h(document.body).height());"object"!=typeof i&&(o=e=i),"function"==typeof e&&(e=i.top(this.$element)),"function"==typeof o&&(o=i.bottom(this.$element));var n=this.getState(f,t,e,o);if(this.affixed!=n){null!=this.unpin&&this.$element.css("top","");var s="affix"+(n?"-"+n:""),a=h.Event(s+".bs.affix");if(this.$element.trigger(a),a.isDefaultPrevented())return;this.affixed=n,this.unpin="bottom"==n?this.getPinnedOffset():null,this.$element.removeClass(r.RESET).addClass(s).trigger(s.replace("affix","affixed")+".bs.affix")}"bottom"==n&&this.$element.offset({top:f-t-o})}};var t=h.fn.affix;h.fn.affix=e,h.fn.affix.Constructor=r,h.fn.affix.noConflict=function(){return h.fn.affix=t,this},h(window).on("load",function(){h('[data-spy="affix"]').each(function(){var t=h(this),i=t.data();i.offset=i.offset||{},null!=i.offsetBottom&&(i.offset.bottom=i.offsetBottom),null!=i.offsetTop&&(i.offset.top=i.offsetTop),e.call(t,i)})})}(jQuery);

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
!function(s){"use strict";function o(t){s(t).on("click",e,this.close)}var e='[data-dismiss="alert"]';o.VERSION="3.3.7",o.TRANSITION_DURATION=150,o.prototype.close=function(t){var e=s(this),a=e.attr("data-target");a=a||(a=e.attr("href"))&&a.replace(/.*(?=#[^\s]*$)/,"");var r=s("#"===a?[]:a);function n(){r.detach().trigger("closed.bs.alert").remove()}t&&t.preventDefault(),r.length||(r=e.closest(".alert")),r.trigger(t=s.Event("close.bs.alert")),t.isDefaultPrevented()||(r.removeClass("in"),s.support.transition&&r.hasClass("fade")?r.one("bsTransitionEnd",n).emulateTransitionEnd(o.TRANSITION_DURATION):n())};var t=s.fn.alert;s.fn.alert=function(a){return this.each(function(){var t=s(this),e=t.data("bs.alert");e||t.data("bs.alert",e=new o(this)),"string"==typeof a&&e[a].call(t)})},s.fn.alert.Constructor=o,s.fn.alert.noConflict=function(){return s.fn.alert=t,this},s(document).on("click.bs.alert.data-api",e,o.prototype.close)}(jQuery);

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
$(document).ready(function(){function t(e){targetObject=$("#"+e.attr("id")+"-update"),update_url=$("option:selected",e).data("update_url"),""==update_url?targetObject.attr("disabled",!0):(targetObject.attr("href",update_url),targetObject.attr("disabled",!1))}clearSelectionLabel="(no selection)",$(".selectpicker").each(function(){var e={ajax:{url:$(this).data("sourceurl"),type:"GET",dataType:"json",data:{term:"{{{q}}}"}},locale:{emptyTitle:""},clearOnEmpty:!1,preprocessData:function(e){var t,a=e.length,l=[];if(l.push({text:clearSelectionLabel,value:"",data:{update_url:"",subtext:""}}),a)for(t=0;t<a;t++)l.push($.extend(!0,e[t],{text:e[t].label,value:e[t].pk,data:{update_url:e[t].update,subtext:""}}));return l}};$(this).prepend($("<option></option>").attr("value","").text(clearSelectionLabel).data("update_url","")),$(this).selectpicker().ajaxSelectPicker(e),$(this).change(function(){t($(this))}),t($(this))}),$("#modal").on("hide.bs.modal",function(e){var t,a,l,r;null!=modaltarget&&""!=modalobject&&(t=$(modaltarget),a=modalobject[0].pk,l=modalobject[0].fields.name,r=modalobject[0].update_url,t.find("option").remove(),t.append($("<option></option>").attr("value",a).text(l).data("update_url",r)),t.selectpicker("render"),t.selectpicker("refresh"),t.selectpicker("val",a),t.change())})});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

6
RIGS/static/js/bootstrap.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
!function(o){"use strict";var i=function(t,e){this.$element=o(t),this.options=o.extend({},i.DEFAULTS,e),this.isLoading=!1};function n(s){return this.each(function(){var t=o(this),e=t.data("bs.button"),n="object"==typeof s&&s;e||t.data("bs.button",e=new i(this,n)),"toggle"==s?e.toggle():s&&e.setState(s)})}i.VERSION="3.3.7",i.DEFAULTS={loadingText:"loading..."},i.prototype.setState=function(t){var e="disabled",n=this.$element,s=n.is("input")?"val":"html",i=n.data();t+="Text",null==i.resetText&&n.data("resetText",n[s]()),setTimeout(o.proxy(function(){n[s](null==i[t]?this.options[t]:i[t]),"loadingText"==t?(this.isLoading=!0,n.addClass(e).attr(e,e).prop(e,!0)):this.isLoading&&(this.isLoading=!1,n.removeClass(e).removeAttr(e).prop(e,!1))},this),0)},i.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var n=this.$element.find("input");"radio"==n.prop("type")?(n.prop("checked")&&(t=!1),e.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==n.prop("type")&&(n.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),n.prop("checked",this.$element.hasClass("active")),t&&n.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var t=o.fn.button;o.fn.button=n,o.fn.button.Constructor=i,o.fn.button.noConflict=function(){return o.fn.button=t,this},o(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(t){var e=o(t.target).closest(".btn");n.call(e,"toggle"),o(t.target).is('input[type="radio"], input[type="checkbox"]')||(t.preventDefault(),e.is("input,button")?e.trigger("focus"):e.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(t){o(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))})}(jQuery);

View File

@@ -1 +0,0 @@
!function(d){"use strict";function u(t,e){this.$element=d(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=e,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",d.proxy(this.keydown,this)),"hover"!=this.options.pause||"ontouchstart"in document.documentElement||this.$element.on("mouseenter.bs.carousel",d.proxy(this.pause,this)).on("mouseleave.bs.carousel",d.proxy(this.cycle,this))}function r(n){return this.each(function(){var t=d(this),e=t.data("bs.carousel"),i=d.extend({},u.DEFAULTS,t.data(),"object"==typeof n&&n),s="string"==typeof n?n:i.slide;e||t.data("bs.carousel",e=new u(this,i)),"number"==typeof n?e.to(n):s?e[s]():i.interval&&e.pause().cycle()})}u.VERSION="3.3.7",u.TRANSITION_DURATION=600,u.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},u.prototype.keydown=function(t){if(!/input|textarea/i.test(t.target.tagName)){switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()}},u.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(d.proxy(this.next,this),this.options.interval)),this},u.prototype.getItemIndex=function(t){return this.$items=t.parent().children(".item"),this.$items.index(t||this.$active)},u.prototype.getItemForDirection=function(t,e){var i=this.getItemIndex(e);if(("prev"==t&&0===i||"next"==t&&i==this.$items.length-1)&&!this.options.wrap)return e;var s=(i+("prev"==t?-1:1))%this.$items.length;return this.$items.eq(s)},u.prototype.to=function(t){var e=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(t>this.$items.length-1||t<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){e.to(t)}):i==t?this.pause().cycle():this.slide(i<t?"next":"prev",this.$items.eq(t))},u.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&d.support.transition&&(this.$element.trigger(d.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},u.prototype.next=function(){if(!this.sliding)return this.slide("next")},u.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},u.prototype.slide=function(t,e){var i=this.$element.find(".item.active"),s=e||this.getItemForDirection(t,i),n=this.interval,a="next"==t?"left":"right",r=this;if(s.hasClass("active"))return this.sliding=!1;var o=s[0],l=d.Event("slide.bs.carousel",{relatedTarget:o,direction:a});if(this.$element.trigger(l),!l.isDefaultPrevented()){if(this.sliding=!0,n&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var h=d(this.$indicators.children()[this.getItemIndex(s)]);h&&h.addClass("active")}var c=d.Event("slid.bs.carousel",{relatedTarget:o,direction:a});return d.support.transition&&this.$element.hasClass("slide")?(s.addClass(t),s[0].offsetWidth,i.addClass(a),s.addClass(a),i.one("bsTransitionEnd",function(){s.removeClass([t,a].join(" ")).addClass("active"),i.removeClass(["active",a].join(" ")),r.sliding=!1,setTimeout(function(){r.$element.trigger(c)},0)}).emulateTransitionEnd(u.TRANSITION_DURATION)):(i.removeClass("active"),s.addClass("active"),this.sliding=!1,this.$element.trigger(c)),n&&this.cycle(),this}};var t=d.fn.carousel;d.fn.carousel=r,d.fn.carousel.Constructor=u,d.fn.carousel.noConflict=function(){return d.fn.carousel=t,this};function e(t){var e,i=d(this),s=d(i.attr("data-target")||(e=i.attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,""));if(s.hasClass("carousel")){var n=d.extend({},s.data(),i.data()),a=i.attr("data-slide-to");a&&(n.interval=!1),r.call(s,n),a&&s.data("bs.carousel").to(a),t.preventDefault()}}d(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),d(window).on("load",function(){d('[data-ride="carousel"]').each(function(){var t=d(this);r.call(t,t.data())})})}(jQuery);

View File

@@ -1 +0,0 @@
!function(l){"use strict";var o=function(t,e){this.$element=l(t),this.options=l.extend({},o.DEFAULTS,e),this.$trigger=l('[data-toggle="collapse"][href="#'+t.id+'"],[data-toggle="collapse"][data-target="#'+t.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};function i(t){var e,a=t.attr("data-target")||(e=t.attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"");return l(a)}function r(s){return this.each(function(){var t=l(this),e=t.data("bs.collapse"),a=l.extend({},o.DEFAULTS,t.data(),"object"==typeof s&&s);!e&&a.toggle&&/show|hide/.test(s)&&(a.toggle=!1),e||t.data("bs.collapse",e=new o(this,a)),"string"==typeof s&&e[s]()})}o.VERSION="3.3.7",o.TRANSITION_DURATION=350,o.DEFAULTS={toggle:!0},o.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"},o.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var t,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(t=e.data("bs.collapse"))&&t.transitioning)){var a=l.Event("show.bs.collapse");if(this.$element.trigger(a),!a.isDefaultPrevented()){e&&e.length&&(r.call(e,"hide"),t||e.data("bs.collapse",null));var s=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[s](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var i=function(){this.$element.removeClass("collapsing").addClass("collapse in")[s](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!l.support.transition)return i.call(this);var n=l.camelCase(["scroll",s].join("-"));this.$element.one("bsTransitionEnd",l.proxy(i,this)).emulateTransitionEnd(o.TRANSITION_DURATION)[s](this.$element[0][n])}}}},o.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var t=l.Event("hide.bs.collapse");if(this.$element.trigger(t),!t.isDefaultPrevented()){var e=this.dimension();this.$element[e](this.$element[e]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var a=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!l.support.transition)return a.call(this);this.$element[e](0).one("bsTransitionEnd",l.proxy(a,this)).emulateTransitionEnd(o.TRANSITION_DURATION)}}},o.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},o.prototype.getParent=function(){return l(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(l.proxy(function(t,e){var a=l(e);this.addAriaAndCollapsedClass(i(a),a)},this)).end()},o.prototype.addAriaAndCollapsedClass=function(t,e){var a=t.hasClass("in");t.attr("aria-expanded",a),e.toggleClass("collapsed",!a).attr("aria-expanded",a)};var t=l.fn.collapse;l.fn.collapse=r,l.fn.collapse.Constructor=o,l.fn.collapse.noConflict=function(){return l.fn.collapse=t,this},l(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(t){var e=l(this);e.attr("data-target")||t.preventDefault();var a=i(e),s=a.data("bs.collapse")?"toggle":e.data();r.call(a,s)})}(jQuery);

View File

@@ -1 +0,0 @@
$.ajaxSetup({beforeSend:function(e,t){/^http:.*/.test(t.url)||/^https:.*/.test(t.url)||e.setRequestHeader("X-CSRFToken",function(e){var t=null;if(document.cookie&&""!=document.cookie)for(var n=document.cookie.split(";"),o=0;o<n.length;o++){var r=jQuery.trim(n[o]);if(r.substring(0,e.length+1)==e+"="){t=decodeURIComponent(r.substring(e.length+1));break}}return t}("csrftoken"))}});

View File

@@ -1 +0,0 @@
!function(d){"use strict";function n(t){d(t).on("click.bs.dropdown",this.toggle)}var i='[data-toggle="dropdown"]';function s(t){var e=t.attr("data-target"),o=(e=e||(e=t.attr("href"))&&/#[A-Za-z]/.test(e)&&e.replace(/.*(?=#[^\s]*$)/,""))&&d(e);return o&&o.length?o:t.parent()}function a(n){n&&3===n.which||(d(".dropdown-backdrop").remove(),d(i).each(function(){var t=d(this),e=s(t),o={relatedTarget:this};e.hasClass("open")&&(n&&"click"==n.type&&/input|textarea/i.test(n.target.tagName)&&d.contains(e[0],n.target)||(e.trigger(n=d.Event("hide.bs.dropdown",o)),n.isDefaultPrevented()||(t.attr("aria-expanded","false"),e.removeClass("open").trigger(d.Event("hidden.bs.dropdown",o)))))}))}n.VERSION="3.3.7",n.prototype.toggle=function(t){var e=d(this);if(!e.is(".disabled, :disabled")){var o=s(e),n=o.hasClass("open");if(a(),!n){"ontouchstart"in document.documentElement&&!o.closest(".navbar-nav").length&&d(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(d(this)).on("click",a);var r={relatedTarget:this};if(o.trigger(t=d.Event("show.bs.dropdown",r)),t.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),o.toggleClass("open").trigger(d.Event("shown.bs.dropdown",r))}return!1}},n.prototype.keydown=function(t){if(/(38|40|27|32)/.test(t.which)&&!/input|textarea/i.test(t.target.tagName)){var e=d(this);if(t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled")){var o=s(e),n=o.hasClass("open");if(!n&&27!=t.which||n&&27==t.which)return 27==t.which&&o.find(i).trigger("focus"),e.trigger("click");var r=o.find(".dropdown-menu li:not(.disabled):visible a");if(r.length){var a=r.index(t.target);38==t.which&&0<a&&a--,40==t.which&&a<r.length-1&&a++,~a||(a=0),r.eq(a).trigger("focus")}}}};var t=d.fn.dropdown;d.fn.dropdown=function(o){return this.each(function(){var t=d(this),e=t.data("bs.dropdown");e||t.data("bs.dropdown",e=new n(this)),"string"==typeof o&&e[o].call(t)})},d.fn.dropdown.Constructor=n,d.fn.dropdown.noConflict=function(){return d.fn.dropdown=t,this},d(document).on("click.bs.dropdown.data-api",a).on("click.bs.dropdown.data-api",".dropdown form",function(t){t.stopPropagation()}).on("click.bs.dropdown.data-api",i,n.prototype.toggle).on("keydown.bs.dropdown.data-api",i,n.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",n.prototype.keydown)}(jQuery);

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
function setupItemTable(t){objectitems=JSON.parse(t),$.each(objectitems,function(t,e){objectitems[t]=JSON.parse(e)}),newitem=-1}function nl2br(t,e){return(t+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1"+(e||void 0===e?"<br />":"<br>")+"$2")}function escapeHtml(t){return $("<div/>").text(t).html()}function updatePrices(){var t=0;for(var e in objectitems){var i=objectitems[e].fields,a=i.cost*i.quantity;$("#item-"+e+" .sub-total").html(parseFloat(a).toFixed(2)).data("subtotal",a),t+=Number(a)}$("#sumtotal").text(parseFloat(t).toFixed(2));var o=t*Number($("#vat-rate").data("rate"));$("#vat").text(parseFloat(o).toFixed(2)),$("#total").text(parseFloat(t+o).toFixed(2))}$("#item-table").on("click",".item-delete",function(){delete objectitems[$(this).data("pk")],$("#item-"+$(this).data("pk")).remove(),updatePrices()}),$("#item-table").on("click",".item-add",function(){$("#item-form").data("pk",newitem),$("#item_name").val(""),$("#item_description").val(""),$("#item_quantity").val(""),$("#item_cost").val(""),$($(this).data("target")).modal("show")}),$("#item-table").on("click",".item-edit",function(){var t=$(this).data("pk");$("#item-form").data("pk",t);var e=objectitems[t].fields;$("#item_name").val(e.name),$("#item_description").val(e.description),$("#item_quantity").val(e.quantity),$("#item_cost").val(e.cost),$($(this).data("target")).modal("show")}),$("body").on("submit","#item-form",function(t){t.preventDefault();var e,i=$(this).data("pk");if($("#itemModal").modal("hide"),i==newitem--){(e=new Object).name=$("#item_name").val(),e.description=$("#item_description").val(),e.cost=$("#item_cost").val(),e.quantity=$("#item_quantity").val();var a=0;for(item in objectitems)a++;e.order=a,objectitems[i]=new Object,objectitems[i].fields=e,$("#new-item-row").clone().attr("id","item-"+i).data("pk",i).appendTo("#item-table-body"),$("#item-"+i+" .item-delete, #item-"+i+" .item-edit").data("pk",i)}else(e=objectitems[i].fields).name=$("#item_name").val(),e.description=$("#item_description").val(),e.cost=$("#item_cost").val(),e.quantity=$("#item_quantity").val(),objectitems[i].fields=e;$row=$("#item-"+i),$row.find(".name").html(escapeHtml(e.name)),$row.find(".description").html(nl2br(escapeHtml(e.description))),$row.find(".cost").html(parseFloat(e.cost).toFixed(2)),$row.find(".quantity").html(e.quantity),updatePrices()}),$("body").on("submit",".itemised_form",function(t){$("#id_items_json").val(JSON.stringify(objectitems))});var fixHelper=function(t,e){return e.children().each(function(){$(this).width($(this).width())}),e};$("#item-table tbody").sortable({helper:fixHelper,update:function(t,e){info=$(this).sortable("toArray"),itemorder=new Array,$.each(info,function(t,e){pk=$("#"+e).data("pk"),objectitems[pk].fields.order=t})}});
function setupItemTable(t){objectitems=JSON.parse(t),$.each(objectitems,(function(t,e){objectitems[t]=JSON.parse(e)})),newitem=-1}function nl2br(t,e){return(t+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1"+(e||void 0===e?"<br />":"<br>")+"$2")}function escapeHtml(t){return $("<div/>").text(t).html()}function updatePrices(){var t=0;for(var e in objectitems){var i=objectitems[e].fields,a=i.cost*i.quantity;$("#item-"+e+" .sub-total").html(parseFloat(a).toFixed(2)).data("subtotal",a),t+=Number(a)}$("#sumtotal").text(parseFloat(t).toFixed(2));var o=t*Number($("#vat-rate").data("rate"));$("#vat").text(parseFloat(o).toFixed(2)),$("#total").text(parseFloat(t+o).toFixed(2))}$("#item-table").on("click",".item-delete",(function(){delete objectitems[$(this).data("pk")],$("#item-"+$(this).data("pk")).remove(),updatePrices()})),$("#item-table").on("click",".item-add",(function(){$("#item-form").data("pk",newitem),$("#item_name").val(""),$("#item_description").val(""),$("#item_quantity").val(""),$("#item_cost").val(""),$($(this).data("target")).modal("show")})),$("#item-table").on("click",".item-edit",(function(){var t=$(this).data("pk");$("#item-form").data("pk",t);var e=objectitems[t].fields;$("#item_name").val(e.name),$("#item_description").val(e.description),$("#item_quantity").val(e.quantity),$("#item_cost").val(e.cost),$($(this).data("target")).modal("show")})),$("body").on("submit","#item-form",(function(t){t.preventDefault();var e,i=$(this).data("pk");if($("#itemModal").modal("hide"),i==newitem--){(e=new Object).name=$("#item_name").val(),e.description=$("#item_description").val(),e.cost=$("#item_cost").val(),e.quantity=$("#item_quantity").val();var a=0;for(item in objectitems)a++;e.order=a,objectitems[i]=new Object,objectitems[i].fields=e,$("#new-item-row").clone().attr("id","item-"+i).data("pk",i).appendTo("#item-table-body"),$("#item-"+i+" .item-delete, #item-"+i+" .item-edit").data("pk",i)}else(e=objectitems[i].fields).name=$("#item_name").val(),e.description=$("#item_description").val(),e.cost=$("#item_cost").val(),e.quantity=$("#item_quantity").val(),objectitems[i].fields=e;$row=$("#item-"+i),$row.find(".name").html(escapeHtml(e.name)),$row.find(".description").html(nl2br(escapeHtml(e.description))),$row.find(".cost").html(parseFloat(e.cost).toFixed(2)),$row.find(".quantity").html(e.quantity),updatePrices()})),$("body").on("submit",".itemised_form",(function(t){$("#id_items_json").val(JSON.stringify(objectitems))}));var fixHelper=function(t,e){return e.children().each((function(){$(this).width($(this).width())})),e};$("#item-table tbody").sortable({helper:fixHelper,update:function(t,e){info=$(this).sortable("toArray"),itemorder=new Array,$.each(info,(function(t,e){pk=$("#"+e).data("pk"),objectitems[pk].fields.order=t}))}});

View File

@@ -1 +0,0 @@
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(v){var i=/\+/g;function x(e){return g.raw?e:encodeURIComponent(e)}function l(e,n){var o=g.raw?e:function(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{e=decodeURIComponent(e.replace(i," "))}catch(e){return}try{return g.json?JSON.parse(e):e}catch(e){}}(e);return v.isFunction(n)?n(o):o}var g=v.cookie=function(e,n,o){if(void 0!==n&&!v.isFunction(n)){if("number"==typeof(o=v.extend({},g.defaults,o)).expires){var i=o.expires,t=o.expires=new Date;t.setDate(t.getDate()+i)}return document.cookie=[x(e),"=",(r=n,x(g.json?JSON.stringify(r):String(r))),o.expires?"; expires="+o.expires.toUTCString():"",o.path?"; path="+o.path:"",o.domain?"; domain="+o.domain:"",o.secure?"; secure":""].join("")}for(var r,c,a=e?void 0:{},u=document.cookie?document.cookie.split("; "):[],d=0,f=u.length;d<f;d++){var s=u[d].split("="),p=(c=s.shift(),g.raw?c:decodeURIComponent(c)),m=s.join("=");if(e&&e===p){a=l(m,n);break}e||void 0===(m=l(m))||(a[p]=m)}return a};g.defaults={},v.removeCookie=function(e,n){return void 0!==v.cookie(e)&&(v.cookie(e,"",v.extend({},n,{expires:-1})),!0)}});

1
RIGS/static/js/jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
jQuery(function(s){s.widget("custom.combobox",{_create:function(){this.wrapper=s("<span>").addClass("custom-combobox").insertAfter(this.element),this.element.hide(),this._createAutocomplete()},_createAutocomplete:function(){var t=this.element.children(":selected"),e=t.val()?t.text():"";this.input=s("<input>").appendTo(this.wrapper).val(e).attr("title","").addClass("form-control").autocomplete({delay:0,minLength:3,source:s.proxy(this,"_source")}).tooltip({tooltipClass:"ui-state-highlight"}),this._on(this.input,{autocompleteselect:function(t,e){e.item.option.selected=!0,this._trigger("select",t,{item:e.item.option})},autocompletechange:"_removeIfInvalid"})},_source:function(e,t){var i=new RegExp(s.ui.autocomplete.escapeRegex(e.term),"i");t(this.element.children("option").map(function(){var t=s(this).text();if(this.value&&(!e.term||i.test(t)))return{label:t,value:t,option:this}}))},_removeIfInvalid:function(t,e){if(!e.item){var i=this.input.val(),o=i.toLowerCase(),n=!1;this.element.children("option").each(function(){if(s(this).text().toLowerCase()===o)return this.selected=n=!0,!1}),n||(this.input.val("").attr("title",i+" didn't match any item").tooltip("open"),this.element.val(""),this._delay(function(){this.input.tooltip("close").attr("title","")},25e3),this.input.data("ui-autocomplete").term="")}},_destroy:function(){this.wrapper.remove(),this.element.show()}})});

View File

@@ -1 +1 @@
var Konami=function(t){var i={addEvent:function(t,e,n,i){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&(t["e"+e+n]=n,t[e+n]=function(){t["e"+e+n](window.event,i)},t.attachEvent("on"+e,t[e+n]))},input:"",pattern:"38384040373937396665",load:function(n){this.addEvent(document,"keydown",function(t,e){if(e&&(i=e),i.input+=t?t.keyCode:event.keyCode,i.input.length>i.pattern.length&&(i.input=i.input.substr(i.input.length-i.pattern.length)),i.input==i.pattern)return i.code(n),i.input="",t.preventDefault(),!1},this)},code:function(t){window.location=t},iphone:{start_x:0,start_y:0,stop_x:0,stop_y:0,tap:!1,capture:!1,orig_keys:"",keys:["UP","UP","DOWN","DOWN","LEFT","RIGHT","LEFT","RIGHT","TAP","TAP"],code:function(t){i.code(t)},load:function(e){this.orig_keys=this.keys,i.addEvent(document,"touchmove",function(t){if(1==t.touches.length&&1==i.iphone.capture){var e=t.touches[0];i.iphone.stop_x=e.pageX,i.iphone.stop_y=e.pageY,i.iphone.tap=!1,i.iphone.capture=!1,i.iphone.check_direction()}}),i.addEvent(document,"touchend",function(t){1==i.iphone.tap&&i.iphone.check_direction(e)},!1),i.addEvent(document,"touchstart",function(t){i.iphone.start_x=t.changedTouches[0].pageX,i.iphone.start_y=t.changedTouches[0].pageY,i.iphone.tap=!0,i.iphone.capture=!0})},check_direction:function(t){x_magnitude=Math.abs(this.start_x-this.stop_x),y_magnitude=Math.abs(this.start_y-this.stop_y),x=this.start_x-this.stop_x<0?"RIGHT":"LEFT",y=this.start_y-this.stop_y<0?"DOWN":"UP",result=x_magnitude>y_magnitude?x:y,result=1==this.tap?"TAP":result,result==this.keys[0]&&(this.keys=this.keys.slice(1,this.keys.length)),0==this.keys.length&&(this.keys=this.orig_keys,this.code(t))}}};return"string"==typeof t&&i.load(t),"function"==typeof t&&(i.code=t,i.load()),i};
var Konami=function(t){var e={addEvent:function(t,e,n,i){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&(t["e"+e+n]=n,t[e+n]=function(){t["e"+e+n](window.event,i)},t.attachEvent("on"+e,t[e+n]))},input:"",pattern:"38384040373937396665",load:function(t){this.addEvent(document,"keydown",(function(n,i){if(i&&(e=i),e.input+=n?n.keyCode:event.keyCode,e.input.length>e.pattern.length&&(e.input=e.input.substr(e.input.length-e.pattern.length)),e.input==e.pattern)return e.code(t),e.input="",n.preventDefault(),!1}),this)},code:function(t){window.location=t},iphone:{start_x:0,start_y:0,stop_x:0,stop_y:0,tap:!1,capture:!1,orig_keys:"",keys:["UP","UP","DOWN","DOWN","LEFT","RIGHT","LEFT","RIGHT","TAP","TAP"],code:function(t){e.code(t)},load:function(t){this.orig_keys=this.keys,e.addEvent(document,"touchmove",(function(t){if(1==t.touches.length&&1==e.iphone.capture){var n=t.touches[0];e.iphone.stop_x=n.pageX,e.iphone.stop_y=n.pageY,e.iphone.tap=!1,e.iphone.capture=!1,e.iphone.check_direction()}})),e.addEvent(document,"touchend",(function(n){1==e.iphone.tap&&e.iphone.check_direction(t)}),!1),e.addEvent(document,"touchstart",(function(t){e.iphone.start_x=t.changedTouches[0].pageX,e.iphone.start_y=t.changedTouches[0].pageY,e.iphone.tap=!0,e.iphone.capture=!0}))},check_direction:function(t){x_magnitude=Math.abs(this.start_x-this.stop_x),y_magnitude=Math.abs(this.start_y-this.stop_y),x=this.start_x-this.stop_x<0?"RIGHT":"LEFT",y=this.start_y-this.stop_y<0?"DOWN":"UP",result=x_magnitude>y_magnitude?x:y,result=1==this.tap?"TAP":result,result==this.keys[0]&&(this.keys=this.keys.slice(1,this.keys.length)),0==this.keys.length&&(this.keys=this.orig_keys,this.code(t))}}};return"string"==typeof t&&e.load(t),"function"==typeof t&&(e.code=t,e.load()),e};

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
(function(){var s,e;s={seconds:{short:"s",long:" sec"},minutes:{short:"m",long:" min"},hours:{short:"h",long:" hr"},days:{short:"d",long:" day"}},e=function(r){var t;return t=function(t){var e,n,o,i;if(n=o=null,(e=Math.abs(this.diff(r())))<=1e3)o="seconds",n=1;else if(e<6e4)o="seconds";else if(e<36e5)o="minutes";else if(e<864e5)o="hours";else{if("short"!==t)return this.format("MMM D");if(!(e<6048e5))return this.format("M/D/YY");o="days"}return n&&o||(n=r.duration(e)[o]()),i=o=s[o][t],"long"===t&&1<n&&(i+="s"),n+i},r.fn.twitterLong=function(){return t.call(this,"long")},r.fn.twitter=r.fn.twitterShort=function(){return t.call(this,"short")},r},"function"==typeof define&&define.amd?define("moment-twitter",["moment"],function(t){return this.moment=e(t)}):"undefined"!=typeof module?module.exports=e(require("moment")):"undefined"!=typeof window&&window.moment&&(this.moment=e(this.moment))}).call(this);

1
RIGS/static/js/moment.js Normal file
View File

@@ -0,0 +1 @@
import{createLocal}from"../create/local";import{createUTC}from"../create/utc";import{createInvalid}from"../create/valid";import{isMoment}from"./constructor";import{min,max}from"./min-max";import{now}from"./now";import momentPrototype from"./prototype";function createUnix(e){return createLocal(1e3*e)}function createInZone(){return createLocal.apply(null,arguments).parseZone()}export{now,min,max,isMoment,createUTC,createUnix,createLocal,createInZone,createInvalid,momentPrototype};

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
!function(r){"use strict";function i(t,o){this.init("popover",t,o)}if(!r.fn.tooltip)throw new Error("Popover requires tooltip.js");i.VERSION="3.3.7",i.DEFAULTS=r.extend({},r.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),((i.prototype=r.extend({},r.fn.tooltip.Constructor.prototype)).constructor=i).prototype.getDefaults=function(){return i.DEFAULTS},i.prototype.setContent=function(){var t=this.tip(),o=this.getTitle(),e=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](o),t.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof e?"html":"append":"text"](e),t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},i.prototype.hasContent=function(){return this.getTitle()||this.getContent()},i.prototype.getContent=function(){var t=this.$element,o=this.options;return t.attr("data-content")||("function"==typeof o.content?o.content.call(t[0]):o.content)},i.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var t=r.fn.popover;r.fn.popover=function(n){return this.each(function(){var t=r(this),o=t.data("bs.popover"),e="object"==typeof n&&n;!o&&/destroy|hide/.test(n)||(o||t.data("bs.popover",o=new i(this,e)),"string"==typeof n&&o[n]())})},r.fn.popover.Constructor=i,r.fn.popover.noConflict=function(){return r.fn.popover=t,this}}(jQuery);

25
RIGS/static/js/popper.js Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
!function(r){"use strict";function o(t,s){this.$body=r(document.body),this.$scrollElement=r(t).is(document.body)?r(window):r(t),this.options=r.extend({},o.DEFAULTS,s),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",r.proxy(this.process,this)),this.refresh(),this.process()}function s(i){return this.each(function(){var t=r(this),s=t.data("bs.scrollspy"),e="object"==typeof i&&i;s||t.data("bs.scrollspy",s=new o(this,e)),"string"==typeof i&&s[i]()})}o.VERSION="3.3.7",o.DEFAULTS={offset:10},o.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},o.prototype.refresh=function(){var t=this,i="offset",o=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),r.isWindow(this.$scrollElement[0])||(i="position",o=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var t=r(this),s=t.data("target")||t.attr("href"),e=/^#./.test(s)&&r(s);return e&&e.length&&e.is(":visible")?[[e[i]().top+o,s]]:null}).sort(function(t,s){return t[0]-s[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},o.prototype.process=function(){var t,s=this.$scrollElement.scrollTop()+this.options.offset,e=this.getScrollHeight(),i=this.options.offset+e-this.$scrollElement.height(),o=this.offsets,r=this.targets,l=this.activeTarget;if(this.scrollHeight!=e&&this.refresh(),i<=s)return l!=(t=r[r.length-1])&&this.activate(t);if(l&&s<o[0])return this.activeTarget=null,this.clear();for(t=o.length;t--;)l!=r[t]&&s>=o[t]&&(void 0===o[t+1]||s<o[t+1])&&this.activate(r[t])},o.prototype.activate=function(t){this.activeTarget=t,this.clear();var s=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',e=r(s).parents("li").addClass("active");e.parent(".dropdown-menu").length&&(e=e.closest("li.dropdown").addClass("active")),e.trigger("activate.bs.scrollspy")},o.prototype.clear=function(){r(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var t=r.fn.scrollspy;r.fn.scrollspy=s,r.fn.scrollspy.Constructor=o,r.fn.scrollspy.noConflict=function(){return r.fn.scrollspy=t,this},r(window).on("load.bs.scrollspy.data-api",function(){r('[data-spy="scroll"]').each(function(){var t=r(this);s.call(t,t.data())})})}(jQuery);

View File

@@ -1 +0,0 @@
!function(d){"use strict";function s(t){this.element=d(t)}function a(e){return this.each(function(){var t=d(this),a=t.data("bs.tab");a||t.data("bs.tab",a=new s(this)),"string"==typeof e&&a[e]()})}s.VERSION="3.3.7",s.TRANSITION_DURATION=150,s.prototype.show=function(){var t=this.element,a=t.closest("ul:not(.dropdown-menu)"),e=t.data("target");if(e=e||(e=t.attr("href"))&&e.replace(/.*(?=#[^\s]*$)/,""),!t.parent("li").hasClass("active")){var n=a.find(".active:last a"),i=d.Event("hide.bs.tab",{relatedTarget:t[0]}),r=d.Event("show.bs.tab",{relatedTarget:n[0]});if(n.trigger(i),t.trigger(r),!r.isDefaultPrevented()&&!i.isDefaultPrevented()){var s=d(e);this.activate(t.closest("li"),a),this.activate(s,s.parent(),function(){n.trigger({type:"hidden.bs.tab",relatedTarget:t[0]}),t.trigger({type:"shown.bs.tab",relatedTarget:n[0]})})}}},s.prototype.activate=function(t,a,e){var n=a.find("> .active"),i=e&&d.support.transition&&(n.length&&n.hasClass("fade")||!!a.find("> .fade").length);function r(){n.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),t.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),i?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu").length&&t.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}n.length&&i?n.one("bsTransitionEnd",r).emulateTransitionEnd(s.TRANSITION_DURATION):r(),n.removeClass("in")};var t=d.fn.tab;d.fn.tab=a,d.fn.tab.Constructor=s,d.fn.tab.noConflict=function(){return d.fn.tab=t,this};function e(t){t.preventDefault(),a.call(d(this),"show")}d(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery);

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
!function(r){"use strict";r.fn.emulateTransitionEnd=function(n){var t=!1,i=this;r(this).one("bsTransitionEnd",function(){t=!0});return setTimeout(function(){t||r(i).trigger(r.support.transition.end)},n),this},r(function(){r.support.transition=function(){var n=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in t)if(void 0!==n.style[i])return{end:t[i]};return!1}(),r.support.transition&&(r.event.special.bsTransitionEnd={bindType:r.support.transition.end,delegateType:r.support.transition.end,handle:function(n){if(r(n.target).is(this))return n.handleObj.handler.apply(this,arguments)}})})}(jQuery);

View File

@@ -3,34 +3,11 @@
{% block title %}Rigboard{% endblock %}
{% block content %}
<div class="row">
<div class="col-sm-12">
<div class="row">
<div class="col-sm-10">
<h3>Rigboard</h3>
</div>
{% if perms.RIGS.add_event %}
<div class="col-sm-2">
<a href="{% url 'event_create' %}" class="btn btn-default pull-right">New <span
class="glyphicon glyphicon-plus"></span></a>
</div>
{% endif %}
{% comment %}
{# Bring search back at a later date #}
<div class="col-sm-3 col-sm-offset-9">
<form class="form form-horizontal col-sm-12">
<div class="form-group">
<input type="search" name="q" placeholder="Search" value="{{ request.GET.q }}"
class="form-control"/>
</div>
</form>
</div>
{% endcomment %}
</div>
{# .row #}
{% include 'event_table.html' %}
</div>
<div>
<h1 class="bd-title" id="content">Rigboard</h1>
{% if perms.RIGS.add_event %}
<a href="{% url 'event_create' %}" class="btn btn-lg btn-outline-primary float-right">New <span class="glyphicon glyphicon-plus"></span></a>
{% endif %}
</div>
{% endblock %}
{% include 'event_table.html' %}
{% endblock %}