Archived
Started design form.
This commit is contained in:
1 parent
d5d46b89ec
commit
2ec4ff23f4
13 files changed
+12791
-5
No files matched your search
@@ -0,0 +1,159 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Kommunikasjonsavdelingen - Bestilling designoppdrag</title>
|
||||
{% load staticfiles %}
|
||||
<link type="text/css" href="{% static 'design/css/jquery.ui.css' %}" rel="stylesheet" />
|
||||
<link type="text/css" href="{% static 'design/css/jquery.ui.datepicker.css' %}" rel="stylesheet" />
|
||||
<link type="text/css" href="{% static 'design/css/style.css' %}" rel="stylesheet" />
|
||||
<script type="text/javascript" src="{% static 'design/js/jquery-2.0.0.js' %}"></script>
|
||||
<script type="text/javascript" src="{% static 'design/js/jquery.ui.core.js' %}"></script>
|
||||
<script type="text/javascript" src="{% static 'design/js/jquery.ui.datepicker.js' %}"></script>
|
||||
</head>
|
||||
<body class="center">
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
|
||||
$("#deadline").datepicker({altField: '#deadline_field',
|
||||
altFormat: 'yy-mm-dd',
|
||||
minDate: '+2w',
|
||||
defaultDate: new Date("{{ deadline }}") });
|
||||
// $("#deadline_field").css("display", "none");
|
||||
});
|
||||
</script>
|
||||
<h1>Kommunikasjonsavdelingen - Bestilling designoppdrag </h1>
|
||||
|
||||
<form method="post" action="submit" method="post" id="bestilling">{% csrf_token %}
|
||||
|
||||
<div class="formitem">
|
||||
<h2 class="title">Forening</h2>
|
||||
<div class="desc">Hvem bestiller?</div>
|
||||
<input name="client" value="{{ client }}" />
|
||||
</div>
|
||||
|
||||
<div class="formitem">
|
||||
<h2 class="title">Frist</h2>
|
||||
<div class="desc">
|
||||
<p>Fristen må være tidligst to uker etter bestilling.</p>
|
||||
<p>Tidsfristen for oppdraget skal være forsvarlig i henhold til estimert arbeidsmengde. Dersom bestillingen er et hastoppdrag, må det gjerne presiseres, men Kommunikasjonsavdelingen kan ikke garantere at bestillingen prioriteres fremfor øvrige oppdrag.</p>
|
||||
</div>
|
||||
<input id = "deadline_field" value="" name="deadline" />
|
||||
<div id="deadline"></div>
|
||||
</div>
|
||||
<div class="formitem">
|
||||
<h2 class="title">Kontaktperson</h2>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><label for="contact_name">Navn:</label></td>
|
||||
<td><input name="contact_name" value="{{ contact_name }}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="contact_email">Email:</label></td>
|
||||
<td><input name="contact_email" value="{{ contact_email }}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="contact_number">Tlf.:</label></td>
|
||||
<td><input name="contact_number" value="{{ contact_number }}" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="formitem">
|
||||
<h2 class="title">Format</h2>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<input name="format" type="radio" value="Trykk - Flyer" {% if format = 'Trykk - Flyer' %} checked="checked" {% endif %}>Trykk - Flyer</input>
|
||||
</li>
|
||||
<li>
|
||||
<input name="format" type="radio" value="Trykk - Plakat" {% if format = 'Trykk - Plakat' %} checked="checked" {% endif %}>Trykk - Plakat</input>
|
||||
</li>
|
||||
<li>
|
||||
<input name="format" type="radio" value="Trykk - Banner" {% if format = 'Trykk - Banner' %} checked="checked" {% endif %}>Trykk - Banner</input>
|
||||
</li>
|
||||
<li>
|
||||
<input name="format" type="radio" value="Web - Annonse" {% if format = 'Web - Annonse' %} checked="checked" {% endif %}>Web - Annonse</input>
|
||||
</li>
|
||||
<li>
|
||||
<input name="format" type="radio" value="Web - Banner" {% if format = 'Web - Banner' %} checked="checked" {% endif %}>Web - Banner</input>
|
||||
</li>
|
||||
<li>
|
||||
<input name="format" type="radio" value="Web - Bilde" {% if format = 'Web - Bilde' %} checked="checked" {% endif %}>Web - Bilde</input>
|
||||
</li>
|
||||
<li>
|
||||
<input name="format" type="radio" value="other" {% if format = 'other' %} checked="checked" {% endif %}>annet :
|
||||
<input name="format_other" value="{{ format_other }}" />
|
||||
</input>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="formitem">
|
||||
<h2 class="title">Størrelse</h2>
|
||||
<ul>
|
||||
<li>
|
||||
<input name="paper_size" type="radio" value="A2" {% if paper_size = 'A2' %} checked="checked" {% endif %}>A2</input>
|
||||
</li>
|
||||
<li>
|
||||
<input name="paper_size" type="radio" value="A3" {% if paper_size = 'A3' %} checked="checked" {% endif %}>A3</input>
|
||||
</li>
|
||||
<li>
|
||||
<input name="paper_size" type="radio" value="A4" {% if paper_size = 'A4' %} checked="checked" {% endif %}>A4</input>
|
||||
</li>
|
||||
<li>
|
||||
<input name="paper_size" type="radio" value="A5" {% if paper_size = 'A5' %} checked="checked" {% endif %}>A5</input>
|
||||
</li>
|
||||
<li>
|
||||
<input name="paper_size" type="radio" value="A6" {% if paper_size = 'A6' %} checked="checked" {% endif %}>A6</input>
|
||||
</li>
|
||||
<li>
|
||||
<input name="paper_size" type="radio" value="other" {% if paper_size = 'other' %} checked="checked" {% endif %}>annet :
|
||||
<input name="paper_size_other" value="{{ paper_size_other }}" />
|
||||
</input>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="formitem">
|
||||
<h2 class="title">Farger eller svart/hvitt</h2>
|
||||
<ul>
|
||||
<li>
|
||||
<input name="colour" type="radio" value="Farge" {% if colour = 'Farge' %} checked="checked" {% endif %}>Farge</input>
|
||||
</li>
|
||||
<li>
|
||||
<input name="colour" type="radio" value="Svart/hvitt" {% if colour = 'Svart/hvitt' %} checked="checked" {% endif %}>Svart/hvitt</input>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="formitem">
|
||||
<h2 class="title">Profesjonell print eller skrive ut selv</h2>
|
||||
<ul>
|
||||
<li>
|
||||
<input name="marger" type="radio" value="Jeg skal sende dette til et trykkeri" {% if marger = 'Jeg skal sende dette til et trykkeri' %} checked="checked" {% endif %}>Jeg skal sende dette til et trykkeri</input>
|
||||
</li>
|
||||
<li>
|
||||
<input name="marger" type="radio" value="Jeg skal skrive ut dette på min egen printer" {% if marger = 'Jeg skal skrive ut dette på min egen printer' %} checked="checked" {% endif %}>Jeg skal skrive ut dette på min egen printer</input>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="formitem">
|
||||
<h2 class="title">Innhold</h2>
|
||||
<div class="desc">
|
||||
<p>Hvem, hva, hvor og når</p>
|
||||
<p>Oppdragsgiver er pliktet til å forsyne oppdragstaker med tilstrekkelig og korrekt informasjon. Det er heller ikke oppdragstakers oppgave å sørge for at oppgitt informasjon/data er korrekt, og er følgelig fraskrevet alt ansvar dersom informasjonen er ukorrekt.</p>
|
||||
<p>Bestillingen skal inneha en klar og tydelig formulering.</p>
|
||||
<p>Oppdragstaker er pliktet til å ta kontakt med oppdragsgiver så fort bestillingen er tildelt den.</p>
|
||||
</div>
|
||||
<textarea name="content">{{ content }}</textarea>
|
||||
</div>
|
||||
<div class="submit">
|
||||
|
||||
<input type="submit" value="Send bestilling" name="bestill" />
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,17 +1,17 @@
|
||||
from django.conf.urls import patterns, include, url
|
||||
from django.contrib import admin
|
||||
|
||||
# Uncomment the next two lines to enable the admin:
|
||||
# from django.contrib import admin
|
||||
# admin.autodiscover()
|
||||
admin.autodiscover()
|
||||
|
||||
urlpatterns = patterns('',
|
||||
(r'^design/', include('design.urls')),
|
||||
# Examples:
|
||||
# url(r'^$', 'bestilling.views.home', name='home'),
|
||||
# url(r'^bestilling/', include('bestilling.foo.urls')),
|
||||
|
||||
# Uncomment the admin/doc line below to enable admin documentation:
|
||||
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
|
||||
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
|
||||
|
||||
# Uncomment the next line to enable the admin:
|
||||
# url(r'^admin/', include(admin.site.urls)),
|
||||
(r'^admin/', include(admin.site.urls)),
|
||||
)
|
||||
Whitespace-only changes.
@@ -0,0 +1,5 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
class DesignOrder(models.Model):
|
||||
created = models.DateTimeField(auto_now_add=True)
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,178 @@
|
||||
/*!
|
||||
* jQuery UI Datepicker 1.10.2
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright 2013 jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Datepicker#theming
|
||||
*/
|
||||
.ui-datepicker {
|
||||
width: 17em;
|
||||
padding: .2em .2em 0;
|
||||
display: none;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-header {
|
||||
position: relative;
|
||||
padding: .2em 0;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-prev,
|
||||
.ui-datepicker .ui-datepicker-next {
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
width: 1.8em;
|
||||
height: 1.8em;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-prev-hover,
|
||||
.ui-datepicker .ui-datepicker-next-hover {
|
||||
top: 1px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-prev {
|
||||
left: 2px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-next {
|
||||
right: 2px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-prev-hover {
|
||||
left: 1px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-next-hover {
|
||||
right: 1px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-prev span,
|
||||
.ui-datepicker .ui-datepicker-next span {
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
margin-left: -8px;
|
||||
top: 50%;
|
||||
margin-top: -8px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-title {
|
||||
margin: 0 2.3em;
|
||||
line-height: 1.8em;
|
||||
text-align: center;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-title select {
|
||||
font-size: 1em;
|
||||
margin: 1px 0;
|
||||
}
|
||||
.ui-datepicker select.ui-datepicker-month-year {
|
||||
width: 100%;
|
||||
}
|
||||
.ui-datepicker select.ui-datepicker-month,
|
||||
.ui-datepicker select.ui-datepicker-year {
|
||||
width: 49%;
|
||||
}
|
||||
.ui-datepicker table {
|
||||
width: 100%;
|
||||
font-size: .9em;
|
||||
border-collapse: collapse;
|
||||
margin: 0 0 .4em;
|
||||
}
|
||||
.ui-datepicker th {
|
||||
padding: .7em .3em;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
border: 0;
|
||||
}
|
||||
.ui-datepicker td {
|
||||
border: 0;
|
||||
padding: 1px;
|
||||
}
|
||||
.ui-datepicker td span,
|
||||
.ui-datepicker td a {
|
||||
display: block;
|
||||
padding: .2em;
|
||||
text-align: right;
|
||||
text-decoration: none;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-buttonpane {
|
||||
background-image: none;
|
||||
margin: .7em 0 0 0;
|
||||
padding: 0 .2em;
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
border-bottom: 0;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-buttonpane button {
|
||||
float: right;
|
||||
margin: .5em .2em .4em;
|
||||
cursor: pointer;
|
||||
padding: .2em .6em .3em .6em;
|
||||
width: auto;
|
||||
overflow: visible;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
|
||||
float: left;
|
||||
}
|
||||
|
||||
/* with multiple calendars */
|
||||
.ui-datepicker.ui-datepicker-multi {
|
||||
width: auto;
|
||||
}
|
||||
.ui-datepicker-multi .ui-datepicker-group {
|
||||
float: left;
|
||||
}
|
||||
.ui-datepicker-multi .ui-datepicker-group table {
|
||||
width: 95%;
|
||||
margin: 0 auto .4em;
|
||||
}
|
||||
.ui-datepicker-multi-2 .ui-datepicker-group {
|
||||
width: 50%;
|
||||
}
|
||||
.ui-datepicker-multi-3 .ui-datepicker-group {
|
||||
width: 33.3%;
|
||||
}
|
||||
.ui-datepicker-multi-4 .ui-datepicker-group {
|
||||
width: 25%;
|
||||
}
|
||||
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
|
||||
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
|
||||
border-left-width: 0;
|
||||
}
|
||||
.ui-datepicker-multi .ui-datepicker-buttonpane {
|
||||
clear: left;
|
||||
}
|
||||
.ui-datepicker-row-break {
|
||||
clear: both;
|
||||
width: 100%;
|
||||
font-size: 0;
|
||||
}
|
||||
|
||||
/* RTL support */
|
||||
.ui-datepicker-rtl {
|
||||
direction: rtl;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-prev {
|
||||
right: 2px;
|
||||
left: auto;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-next {
|
||||
left: 2px;
|
||||
right: auto;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-prev:hover {
|
||||
right: 1px;
|
||||
left: auto;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-next:hover {
|
||||
left: 1px;
|
||||
right: auto;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane {
|
||||
clear: right;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button {
|
||||
float: left;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
|
||||
.ui-datepicker-rtl .ui-datepicker-group {
|
||||
float: right;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
|
||||
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
|
||||
border-right-width: 0;
|
||||
border-left-width: 1px;
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
.title
|
||||
{
|
||||
margin:0px;
|
||||
}
|
||||
.desc
|
||||
{
|
||||
font-style:italic;
|
||||
color:gray;
|
||||
}
|
||||
ul
|
||||
{
|
||||
list-style:none;
|
||||
padding:0px;
|
||||
}
|
||||
body.center
|
||||
{
|
||||
margin:auto;
|
||||
width:800px;
|
||||
}
|
||||
|
||||
textarea
|
||||
{
|
||||
width:99%;
|
||||
height:250px;
|
||||
}
|
||||
|
||||
div.formitem
|
||||
{
|
||||
padding:10px;
|
||||
margin:5px;
|
||||
border:1px solid gray;
|
||||
}
|
||||
|
||||
.error
|
||||
{
|
||||
color:red;
|
||||
font-style:italic;
|
||||
padding-top:5px;
|
||||
}
|
||||
|
||||
tr.alt td, tr.alt th
|
||||
{
|
||||
background-color:rgb(200,200,200);
|
||||
}
|
||||
|
||||
tr.warning td
|
||||
{
|
||||
background-color:yellow;
|
||||
}
|
||||
|
||||
tr.critical td
|
||||
{
|
||||
background-color:red;
|
||||
}
|
||||
+8755
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,320 @@
|
||||
/*!
|
||||
* jQuery UI Core 1.10.2
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright 2013 jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://api.jqueryui.com/category/ui-core/
|
||||
*/
|
||||
(function( $, undefined ) {
|
||||
|
||||
var uuid = 0,
|
||||
runiqueId = /^ui-id-\d+$/;
|
||||
|
||||
// $.ui might exist from components with no dependencies, e.g., $.ui.position
|
||||
$.ui = $.ui || {};
|
||||
|
||||
$.extend( $.ui, {
|
||||
version: "1.10.2",
|
||||
|
||||
keyCode: {
|
||||
BACKSPACE: 8,
|
||||
COMMA: 188,
|
||||
DELETE: 46,
|
||||
DOWN: 40,
|
||||
END: 35,
|
||||
ENTER: 13,
|
||||
ESCAPE: 27,
|
||||
HOME: 36,
|
||||
LEFT: 37,
|
||||
NUMPAD_ADD: 107,
|
||||
NUMPAD_DECIMAL: 110,
|
||||
NUMPAD_DIVIDE: 111,
|
||||
NUMPAD_ENTER: 108,
|
||||
NUMPAD_MULTIPLY: 106,
|
||||
NUMPAD_SUBTRACT: 109,
|
||||
PAGE_DOWN: 34,
|
||||
PAGE_UP: 33,
|
||||
PERIOD: 190,
|
||||
RIGHT: 39,
|
||||
SPACE: 32,
|
||||
TAB: 9,
|
||||
UP: 38
|
||||
}
|
||||
});
|
||||
|
||||
// plugins
|
||||
$.fn.extend({
|
||||
focus: (function( orig ) {
|
||||
return function( delay, fn ) {
|
||||
return typeof delay === "number" ?
|
||||
this.each(function() {
|
||||
var elem = this;
|
||||
setTimeout(function() {
|
||||
$( elem ).focus();
|
||||
if ( fn ) {
|
||||
fn.call( elem );
|
||||
}
|
||||
}, delay );
|
||||
}) :
|
||||
orig.apply( this, arguments );
|
||||
};
|
||||
})( $.fn.focus ),
|
||||
|
||||
scrollParent: function() {
|
||||
var scrollParent;
|
||||
if (($.ui.ie && (/(static|relative)/).test(this.css("position"))) || (/absolute/).test(this.css("position"))) {
|
||||
scrollParent = this.parents().filter(function() {
|
||||
return (/(relative|absolute|fixed)/).test($.css(this,"position")) && (/(auto|scroll)/).test($.css(this,"overflow")+$.css(this,"overflow-y")+$.css(this,"overflow-x"));
|
||||
}).eq(0);
|
||||
} else {
|
||||
scrollParent = this.parents().filter(function() {
|
||||
return (/(auto|scroll)/).test($.css(this,"overflow")+$.css(this,"overflow-y")+$.css(this,"overflow-x"));
|
||||
}).eq(0);
|
||||
}
|
||||
|
||||
return (/fixed/).test(this.css("position")) || !scrollParent.length ? $(document) : scrollParent;
|
||||
},
|
||||
|
||||
zIndex: function( zIndex ) {
|
||||
if ( zIndex !== undefined ) {
|
||||
return this.css( "zIndex", zIndex );
|
||||
}
|
||||
|
||||
if ( this.length ) {
|
||||
var elem = $( this[ 0 ] ), position, value;
|
||||
while ( elem.length && elem[ 0 ] !== document ) {
|
||||
// Ignore z-index if position is set to a value where z-index is ignored by the browser
|
||||
// This makes behavior of this function consistent across browsers
|
||||
// WebKit always returns auto if the element is positioned
|
||||
position = elem.css( "position" );
|
||||
if ( position === "absolute" || position === "relative" || position === "fixed" ) {
|
||||
// IE returns 0 when zIndex is not specified
|
||||
// other browsers return a string
|
||||
// we ignore the case of nested elements with an explicit value of 0
|
||||
// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
|
||||
value = parseInt( elem.css( "zIndex" ), 10 );
|
||||
if ( !isNaN( value ) && value !== 0 ) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
elem = elem.parent();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
},
|
||||
|
||||
uniqueId: function() {
|
||||
return this.each(function() {
|
||||
if ( !this.id ) {
|
||||
this.id = "ui-id-" + (++uuid);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
removeUniqueId: function() {
|
||||
return this.each(function() {
|
||||
if ( runiqueId.test( this.id ) ) {
|
||||
$( this ).removeAttr( "id" );
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// selectors
|
||||
function focusable( element, isTabIndexNotNaN ) {
|
||||
var map, mapName, img,
|
||||
nodeName = element.nodeName.toLowerCase();
|
||||
if ( "area" === nodeName ) {
|
||||
map = element.parentNode;
|
||||
mapName = map.name;
|
||||
if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
|
||||
return false;
|
||||
}
|
||||
img = $( "img[usemap=#" + mapName + "]" )[0];
|
||||
return !!img && visible( img );
|
||||
}
|
||||
return ( /input|select|textarea|button|object/.test( nodeName ) ?
|
||||
!element.disabled :
|
||||
"a" === nodeName ?
|
||||
element.href || isTabIndexNotNaN :
|
||||
isTabIndexNotNaN) &&
|
||||
// the element and all of its ancestors must be visible
|
||||
visible( element );
|
||||
}
|
||||
|
||||
function visible( element ) {
|
||||
return $.expr.filters.visible( element ) &&
|
||||
!$( element ).parents().addBack().filter(function() {
|
||||
return $.css( this, "visibility" ) === "hidden";
|
||||
}).length;
|
||||
}
|
||||
|
||||
$.extend( $.expr[ ":" ], {
|
||||
data: $.expr.createPseudo ?
|
||||
$.expr.createPseudo(function( dataName ) {
|
||||
return function( elem ) {
|
||||
return !!$.data( elem, dataName );
|
||||
};
|
||||
}) :
|
||||
// support: jQuery <1.8
|
||||
function( elem, i, match ) {
|
||||
return !!$.data( elem, match[ 3 ] );
|
||||
},
|
||||
|
||||
focusable: function( element ) {
|
||||
return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
|
||||
},
|
||||
|
||||
tabbable: function( element ) {
|
||||
var tabIndex = $.attr( element, "tabindex" ),
|
||||
isTabIndexNaN = isNaN( tabIndex );
|
||||
return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
|
||||
}
|
||||
});
|
||||
|
||||
// support: jQuery <1.8
|
||||
if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
|
||||
$.each( [ "Width", "Height" ], function( i, name ) {
|
||||
var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
|
||||
type = name.toLowerCase(),
|
||||
orig = {
|
||||
innerWidth: $.fn.innerWidth,
|
||||
innerHeight: $.fn.innerHeight,
|
||||
outerWidth: $.fn.outerWidth,
|
||||
outerHeight: $.fn.outerHeight
|
||||
};
|
||||
|
||||
function reduce( elem, size, border, margin ) {
|
||||
$.each( side, function() {
|
||||
size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
|
||||
if ( border ) {
|
||||
size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
|
||||
}
|
||||
if ( margin ) {
|
||||
size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
|
||||
}
|
||||
});
|
||||
return size;
|
||||
}
|
||||
|
||||
$.fn[ "inner" + name ] = function( size ) {
|
||||
if ( size === undefined ) {
|
||||
return orig[ "inner" + name ].call( this );
|
||||
}
|
||||
|
||||
return this.each(function() {
|
||||
$( this ).css( type, reduce( this, size ) + "px" );
|
||||
});
|
||||
};
|
||||
|
||||
$.fn[ "outer" + name] = function( size, margin ) {
|
||||
if ( typeof size !== "number" ) {
|
||||
return orig[ "outer" + name ].call( this, size );
|
||||
}
|
||||
|
||||
return this.each(function() {
|
||||
$( this).css( type, reduce( this, size, true, margin ) + "px" );
|
||||
});
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
// support: jQuery <1.8
|
||||
if ( !$.fn.addBack ) {
|
||||
$.fn.addBack = function( selector ) {
|
||||
return this.add( selector == null ?
|
||||
this.prevObject : this.prevObject.filter( selector )
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
// support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413)
|
||||
if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
|
||||
$.fn.removeData = (function( removeData ) {
|
||||
return function( key ) {
|
||||
if ( arguments.length ) {
|
||||
return removeData.call( this, $.camelCase( key ) );
|
||||
} else {
|
||||
return removeData.call( this );
|
||||
}
|
||||
};
|
||||
})( $.fn.removeData );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// deprecated
|
||||
$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
|
||||
|
||||
$.support.selectstart = "onselectstart" in document.createElement( "div" );
|
||||
$.fn.extend({
|
||||
disableSelection: function() {
|
||||
return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +
|
||||
".ui-disableSelection", function( event ) {
|
||||
event.preventDefault();
|
||||
});
|
||||
},
|
||||
|
||||
enableSelection: function() {
|
||||
return this.unbind( ".ui-disableSelection" );
|
||||
}
|
||||
});
|
||||
|
||||
$.extend( $.ui, {
|
||||
// $.ui.plugin is deprecated. Use the proxy pattern instead.
|
||||
plugin: {
|
||||
add: function( module, option, set ) {
|
||||
var i,
|
||||
proto = $.ui[ module ].prototype;
|
||||
for ( i in set ) {
|
||||
proto.plugins[ i ] = proto.plugins[ i ] || [];
|
||||
proto.plugins[ i ].push( [ option, set[ i ] ] );
|
||||
}
|
||||
},
|
||||
call: function( instance, name, args ) {
|
||||
var i,
|
||||
set = instance.plugins[ name ];
|
||||
if ( !set || !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
for ( i = 0; i < set.length; i++ ) {
|
||||
if ( instance.options[ set[ i ][ 0 ] ] ) {
|
||||
set[ i ][ 1 ].apply( instance.element, args );
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// only used by resizable
|
||||
hasScroll: function( el, a ) {
|
||||
|
||||
//If overflow is hidden, the element might have extra content, but the user wants to hide it
|
||||
if ( $( el ).css( "overflow" ) === "hidden") {
|
||||
return false;
|
||||
}
|
||||
|
||||
var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
|
||||
has = false;
|
||||
|
||||
if ( el[ scroll ] > 0 ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// TODO: determine which cases actually cause this to happen
|
||||
// if the element doesn't have the scroll set, see if it's possible to
|
||||
// set the scroll
|
||||
el[ scroll ] = 1;
|
||||
has = ( el[ scroll ] > 0 );
|
||||
el[ scroll ] = 0;
|
||||
return has;
|
||||
}
|
||||
});
|
||||
|
||||
})( jQuery );
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,16 @@
|
||||
"""
|
||||
This file demonstrates writing tests using the unittest module. These will pass
|
||||
when you run "manage.py test".
|
||||
|
||||
Replace this with more appropriate tests for your application.
|
||||
"""
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
|
||||
class SimpleTest(TestCase):
|
||||
def test_basic_addition(self):
|
||||
"""
|
||||
Tests that 1 + 1 always equals 2.
|
||||
"""
|
||||
self.assertEqual(1 + 1, 2)
|
||||
@@ -0,0 +1,6 @@
|
||||
from django.conf.urls import patterns, include, url
|
||||
|
||||
urlpatterns = patterns('design.views',
|
||||
(r'^$', 'form'),
|
||||
(r'^submit$', 'submit'),
|
||||
)
|
||||
@@ -0,0 +1,57 @@
|
||||
from django.core.context_processors import csrf
|
||||
from django.http import HttpResponse, Http404
|
||||
from django.template import Context, Template
|
||||
from django.template.loader import get_template
|
||||
from django.views.decorators.http import require_GET, require_POST
|
||||
|
||||
@require_GET
|
||||
def form(request):
|
||||
template = get_template('design/form.html')
|
||||
context_data = {}
|
||||
context_data.update(csrf(request))
|
||||
|
||||
response = template.render(Context(context_data))
|
||||
return HttpResponse(response)
|
||||
|
||||
@require_POST
|
||||
def submit(request):
|
||||
params = {
|
||||
'client' : request.POST.get('client', ''),
|
||||
'deadline' : request.POST.get('deadline', ''),
|
||||
'contact_name' : request.POST.get('contact_name', ''),
|
||||
'contact_email' : request.POST.get('contact_email', ''),
|
||||
'contact_number' : request.POST.get('contact_number', ''),
|
||||
'format' : request.POST.get('format', ''),
|
||||
'format_other' : request.POST.get('format_other', ''),
|
||||
'paper_size' : request.POST.get('paper_size', ''),
|
||||
'paper_size_other' : request.POST.get('paper_size_other', ''),
|
||||
'colour' : request.POST.get('colour', ''),
|
||||
'marger' : request.POST.get('marger', ''),
|
||||
'content' : request.POST.get('content', ''),
|
||||
}
|
||||
|
||||
errors = {
|
||||
'client_error' : params['client'] == '',
|
||||
'deadline_error' : params['deadline'] == '',
|
||||
'contact_name_error' : params['contact_name'] == '',
|
||||
'contact_email_error' : params['contact_email'] == '',
|
||||
'contact_number_error' : params['contact_number'] == '',
|
||||
'format_error' : params['format'] == '',
|
||||
'format_other_error' : params['format'] == 'other' and params['format_other'] == '',
|
||||
'paper_size_error' : params['paper_size'] == '',
|
||||
'paper_size_other_error' : params['paper_size'] == 'other' and params['paper_size_other'] == '',
|
||||
'colour_error' : params['colour'] == '',
|
||||
'marger_error' : params['marger'] == '',
|
||||
'content_error' : params['content'] == '',
|
||||
}
|
||||
|
||||
# For debugging purposes:
|
||||
#all_errors = map(lambda x: x[0],filter(lambda item: item[1], errors.items()))
|
||||
|
||||
template = get_template('design/form.html')
|
||||
context_data = params.copy()
|
||||
context_data['errors'] = errors
|
||||
context_data.update(csrf(request))
|
||||
|
||||
response = template.render(Context(context_data))
|
||||
return HttpResponse(response)
|
||||
Reference in new issue
Block a user