templates

This commit is contained in:
vaishk 2017-06-10 15:29:00 +05:30
parent c929add2bf
commit 162af16b32
17 changed files with 25003 additions and 5 deletions

View File

@ -119,7 +119,6 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images) # Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/ # https://docs.djangoproject.com/en/1.11/howto/static-files/
STATIC_URL = '/static/' STATIC_URL = '/static/'
try: try:

View File

@ -14,9 +14,13 @@ Including another URLconf
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
""" """
from django.conf.urls import url from django.conf.urls import url
from content import views
from django.contrib import admin from django.contrib import admin
urlpatterns = [ urlpatterns = [
url(r'^admin/', admin.site.urls), url(r'^admin/', admin.site.urls),
url(r'^$', views.index, name='index'),
url(r'^content/(?P<shortname>\w+)/$', views.content, name='content'),
url(r'^project/', views.project)
] ]

View File

@ -64,7 +64,7 @@ class Content(models.Model):
opttext2 = models.TextField(db_column='optText2', blank=True, null=True) # Field name made lowercase. opttext2 = models.TextField(db_column='optText2', blank=True, null=True) # Field name made lowercase.
optbtn3 = models.CharField(db_column='optBtn3', max_length=127, blank=True, null=True) # Field name made lowercase. optbtn3 = models.CharField(db_column='optBtn3', max_length=127, blank=True, null=True) # Field name made lowercase.
opttext3 = models.TextField(db_column='optText3', blank=True, null=True) # Field name made lowercase. opttext3 = models.TextField(db_column='optText3', blank=True, null=True) # Field name made lowercase.
technotes = models.TextField() technotes = models.TextField(db_column='technotes', blank=True, null=True)
image = models.CharField(max_length=150, blank=True, null=True) image = models.CharField(max_length=150, blank=True, null=True)
postedby = models.CharField(db_column='postedBy', max_length=50, blank=True, null=True) # Field name made lowercase. postedby = models.CharField(db_column='postedBy', max_length=50, blank=True, null=True) # Field name made lowercase.
datestart = models.DateField(db_column='dateStart', blank=True, null=True) # Field name made lowercase. datestart = models.DateField(db_column='dateStart', blank=True, null=True) # Field name made lowercase.
@ -73,7 +73,7 @@ class Content(models.Model):
datemodified = models.DateTimeField(db_column='dateModified', blank=True, null=True) # Field name made lowercase. datemodified = models.DateTimeField(db_column='dateModified', blank=True, null=True) # Field name made lowercase.
published = models.IntegerField() published = models.IntegerField()
view = models.ForeignKey("Views", null=True, blank=True, db_column="view") view = models.ForeignKey("Views", null=True, blank=True, db_column="view")
place = models.CharField(max_length=255) place = models.CharField(max_length=255, null=True, blank=True)
parentid = models.ForeignKey("Content", null=True, db_column='parentID', blank=True, limit_choices_to={'type_id': 3}, related_name="please_run") # Field name made lowercase. parentid = models.ForeignKey("Content", null=True, db_column='parentID', blank=True, limit_choices_to={'type_id': 3}, related_name="please_run") # Field name made lowercase.
content_related = models.ManyToManyField('Content', through='ContentContent', related_name= "run_run_run") content_related = models.ManyToManyField('Content', through='ContentContent', related_name= "run_run_run")

View File

4398
content/static/css/foundation.css vendored Normal file

File diff suppressed because it is too large Load Diff

2
content/static/css/foundation.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,84 @@
body {
background-color: #ffffff !important;
font-size: 14px !important;
}
.content_detail {
width: 70%;
padding-left: 5%;
}
.right-items {
padding-bottom: 0.5em;
padding-top: 0.5em;
}
body, h1, h2, h3, h4, h5, h6 {
font-family: Open Sans !important;
}
.sidebar-h4 {
font-weight: 600;
text-transform: uppercase;
font-size: 1em;
}
.sidebar-title {
text-transform: capitalize;
font-weight: 800;
font-style: italic;
font-size: 1em;
color: #000000;
}
.sidebar-date {
text-transform: uppercase;
font-size: 0.7em;
}
.special-column {
padding-left: 0em !important;
}
.index-text {
padding-left: 3%;
padding-right: 1%;
padding-top: 10px;
}
.index-text p {
text-align: justify;
}
.title-bar-right {
margin-right: 2em;
margin-top: 1em;
}
.menu-icon::after{
background: #111111 none repeat scroll 0 0 !important;
box-shadow: 0 7px 0 #111111, 0 14px 0 #111111 !important;
}
.vertical-menu li {
list-style: none;
padding-top: 2em;
padding-left: 1em;
font-weight: 600;
font-size: 1em;
color: #ef4e5c;
background-color: #eeeeee;
}
.off-canvas {
background-color: #eeeeee !important;
}
.position-right.is-transition-push::after {
box-shadow: none !important;
}

1
content/static/js/app.js Normal file
View File

@ -0,0 +1 @@
$(document).foundation()

10207
content/static/js/foundation.js vendored Normal file

File diff suppressed because it is too large Load Diff

4
content/static/js/foundation.min.js vendored Normal file

File diff suppressed because one or more lines are too long

9814
content/static/js/jquery.js vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,335 @@
/**
* what-input - A global utility for tracking the current input method (mouse, keyboard or touch).
* @version v4.0.4
* @link https://github.com/ten1seven/what-input
* @license MIT
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define("whatInput", [], factory);
else if(typeof exports === 'object')
exports["whatInput"] = factory();
else
root["whatInput"] = factory();
})(this, function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports) {
module.exports = (function() {
/*
---------------
Variables
---------------
*/
// cache document.documentElement
var docElem = document.documentElement;
// last used input type
var currentInput = 'initial';
// last used input intent
var currentIntent = null;
// form input types
var formInputs = [
'input',
'select',
'textarea'
];
// list of modifier keys commonly used with the mouse and
// can be safely ignored to prevent false keyboard detection
var ignoreMap = [
16, // shift
17, // control
18, // alt
91, // Windows key / left Apple cmd
93 // Windows menu / right Apple cmd
];
// mapping of events to input types
var inputMap = {
'keyup': 'keyboard',
'mousedown': 'mouse',
'mousemove': 'mouse',
'MSPointerDown': 'pointer',
'MSPointerMove': 'pointer',
'pointerdown': 'pointer',
'pointermove': 'pointer',
'touchstart': 'touch'
};
// array of all used input types
var inputTypes = [];
// boolean: true if touch buffer timer is running
var isBuffering = false;
// map of IE 10 pointer events
var pointerMap = {
2: 'touch',
3: 'touch', // treat pen like touch
4: 'mouse'
};
// touch buffer timer
var touchTimer = null;
/*
---------------
Set up
---------------
*/
var setUp = function() {
// add correct mouse wheel event mapping to `inputMap`
inputMap[detectWheel()] = 'mouse';
addListeners();
setInput();
};
/*
---------------
Events
---------------
*/
var addListeners = function() {
// `pointermove`, `MSPointerMove`, `mousemove` and mouse wheel event binding
// can only demonstrate potential, but not actual, interaction
// and are treated separately
// pointer events (mouse, pen, touch)
if (window.PointerEvent) {
docElem.addEventListener('pointerdown', updateInput);
docElem.addEventListener('pointermove', setIntent);
} else if (window.MSPointerEvent) {
docElem.addEventListener('MSPointerDown', updateInput);
docElem.addEventListener('MSPointerMove', setIntent);
} else {
// mouse events
docElem.addEventListener('mousedown', updateInput);
docElem.addEventListener('mousemove', setIntent);
// touch events
if ('ontouchstart' in window) {
docElem.addEventListener('touchstart', touchBuffer);
}
}
// mouse wheel
docElem.addEventListener(detectWheel(), setIntent);
// keyboard events
docElem.addEventListener('keydown', updateInput);
docElem.addEventListener('keyup', updateInput);
};
// checks conditions before updating new input
var updateInput = function(event) {
// only execute if the touch buffer timer isn't running
if (!isBuffering) {
var eventKey = event.which;
var value = inputMap[event.type];
if (value === 'pointer') value = pointerType(event);
if (
currentInput !== value ||
currentIntent !== value
) {
var activeInput = (
document.activeElement &&
formInputs.indexOf(document.activeElement.nodeName.toLowerCase()) === -1
) ? true : false;
if (
value === 'touch' ||
// ignore mouse modifier keys
(value === 'mouse' && ignoreMap.indexOf(eventKey) === -1) ||
// don't switch if the current element is a form input
(value === 'keyboard' && activeInput)
) {
// set the current and catch-all variable
currentInput = currentIntent = value;
setInput();
}
}
}
};
// updates the doc and `inputTypes` array with new input
var setInput = function() {
docElem.setAttribute('data-whatinput', currentInput);
docElem.setAttribute('data-whatintent', currentInput);
if (inputTypes.indexOf(currentInput) === -1) {
inputTypes.push(currentInput);
docElem.className += ' whatinput-types-' + currentInput;
}
};
// updates input intent for `mousemove` and `pointermove`
var setIntent = function(event) {
// only execute if the touch buffer timer isn't running
if (!isBuffering) {
var value = inputMap[event.type];
if (value === 'pointer') value = pointerType(event);
if (currentIntent !== value) {
currentIntent = value;
docElem.setAttribute('data-whatintent', currentIntent);
}
}
};
// buffers touch events because they frequently also fire mouse events
var touchBuffer = function(event) {
// clear the timer if it happens to be running
window.clearTimeout(touchTimer);
// set the current input
updateInput(event);
// set the isBuffering to `true`
isBuffering = true;
// run the timer
touchTimer = window.setTimeout(function() {
// if the timer runs out, set isBuffering back to `false`
isBuffering = false;
}, 200);
};
/*
---------------
Utilities
---------------
*/
var pointerType = function(event) {
if (typeof event.pointerType === 'number') {
return pointerMap[event.pointerType];
} else {
return (event.pointerType === 'pen') ? 'touch' : event.pointerType; // treat pen like touch
}
};
// detect version of mouse wheel event to use
// via https://developer.mozilla.org/en-US/docs/Web/Events/wheel
var detectWheel = function() {
return 'onwheel' in document.createElement('div') ?
'wheel' : // Modern browsers support "wheel"
document.onmousewheel !== undefined ?
'mousewheel' : // Webkit and IE support at least "mousewheel"
'DOMMouseScroll'; // let's assume that remaining browsers are older Firefox
};
/*
---------------
Init
don't start script unless browser cuts the mustard
(also passes if polyfills are used)
---------------
*/
if (
'addEventListener' in window &&
Array.prototype.indexOf
) {
setUp();
}
/*
---------------
API
---------------
*/
return {
// returns string: the current input type
// opt: 'loose'|'strict'
// 'strict' (default): returns the same value as the `data-whatinput` attribute
// 'loose': includes `data-whatintent` value if it's more current than `data-whatinput`
ask: function(opt) { return (opt === 'loose') ? currentIntent : currentInput; },
// returns array: all the detected input types
types: function() { return inputTypes; }
};
}());
/***/ }
/******/ ])
});
;

View File

@ -0,0 +1,54 @@
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Studio CAMP</title>
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans"/>
{% load static %}
<link rel="stylesheet" type="text/css" href="{% static "css/main.css" %}">
<link rel="stylesheet" type="text/css" href="{% static "css/app.css" %}">
<link rel="stylesheet" type="text/css" href="{% static "css/foundation.css" %}">
</head>
<body>
<div class="off-canvas-wrapper-inner" data-off-canvas-wrapper>
<div class="off-canvas position-right" id="offCanvasRight" data-off-canvas data-position="right">
<ul class="vertical-menu">
<li>HOME</li>
<li>ABOUT</li>
<li><a href="/project">PROJECTS</a></li>
<li>EVENTS</li>
<li>WORKS</li>
<li>TEXTS</li>
<li>CONTACT</li>
</ul>
</div>
<div class="off-canvas-content" data-off-canvas-content>
<div class="title-bar-right">
<button class="menu-icon" type="button" data-toggle="offCanvasRight"></button>
</div>
</div>
</div>
{% block content %}
{% endblock %}
{% load static %}
<script src="{% static "js/jquery.js" %}"></script>
<script src="{% static "js/app.js" %}"></script>
<script src="{% static "js/foundation.js" %}"></script>
<script src="{% static "js/what-input.js" %}"></script>
<script>
$(document).foundation();
</script>
</body>
</html>

View File

@ -0,0 +1,14 @@
{% extends 'base.html' %}
{% block content %}
<img src="http://camputer.org/images/{{ content.image }}" width="75%">
<div class="content_detail">
<h1>{{ content.title }}</h1>
<h4>{{ content.header|safe }} </h4>
<p>{{ content.body|safe }}</p>
</div>
{% endblock %}

View File

@ -0,0 +1,45 @@
{% extends 'base.html' %}
{% block content %}
{% if latest_content_list %}
{% for content in latest_content_list %}
{% if forloop.counter == 3 %}
<div class="large-8 medium-8 columns special-column">
<img src="http://camputer.org/images/{{content.image}}">
<div class="index-text">
<h4><a href="/content/{{ content.shortname }}/">{{content.title}} </a></h4>
<h6>Tate Modern <br />
29th March, 2017, 7:00 pm <br />
South Tank <br /> </h6>
<p> {{content.body|striptags|truncatechars:250}} <a href="/content/{{ content.shortname }}">read more</a> </p>
</div>
{% endif %}
{% endfor %}
</div>
<div class="large-4 medium-4 columns">
<h4 class="sidebar-h4"> Upcoming Events </h4>
<div class="row">
{% for content in latest_content_list %}
<div class="row right-items">
<div class="small-6 columns">
<img src="http://camputer.org/images/{{ content.image }}">
</div>
<div class="small-6 columns">
<a href="/content/{{ content.shortname }}/" class="sidebar-title">{{ content.title }}</a>
<h6 class="sidebar-date"> <font color="#ef4e5c"> <b> {{ content.datestart }} </b></font> <br/>
We will add a place to fill this text </h6>
</div>
</div>
{% endfor %}
{% else %}
<p>No polls are available.</p>
{% endif %}
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,23 @@
{% extends 'base.html' %}
{% block content %}
<div class="large-4 medium-4 columns">
<h4 class="sidebar-h4"> Upcoming Events </h4>
<div class="row">
{% for content in content %}
<div class="row right-items">
<div class="small-6 columns">
<img src="http://camputer.org/images/{{ content.image }}">
</div>
<div class="small-6 columns">
<a href="/content/{{ content.shortname }}/" class="sidebar-title">{{ content.title }}</a>
<h6 class="sidebar-date"> <font color="#ef4e5c"> <b> {{ content.datestart }} </b></font> <br/>
We will add a place to fill this text </h6>
</div>
</div>
{% endfor %}
</div>
</div>
{% endblock %}

View File

@ -1,6 +1,20 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import unicode_literals from __future__ import unicode_literals
from django.http import HttpResponse
from django.shortcuts import render from django.shortcuts import get_object_or_404, render
from .models import Content
# Create your views here. # Create your views here.
def index(request):
latest_content_list = Content.objects.order_by('-datestart')[:5]
context = {'latest_content_list': latest_content_list}
return render(request, 'index.html', context)
def content(request, shortname):
content = get_object_or_404(Content, shortname = shortname)
return render(request, 'detail.html', {'content': content})
def project(request):
content = Content.objects.filter(type=3)
return render(request, 'project.html', {'content': content})