Add calendar plugin
This commit is contained in:
parent
5f78d35ab1
commit
7ba91cd1c9
31 changed files with 7619 additions and 98 deletions
BIN
app.db
BIN
app.db
Binary file not shown.
19
db_repository/versions/002_migration.py
Normal file
19
db_repository/versions/002_migration.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
from sqlalchemy import *
|
||||
from migrate import *
|
||||
|
||||
|
||||
from migrate.changeset import schema
|
||||
pre_meta = MetaData()
|
||||
post_meta = MetaData()
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
# Upgrade operations go here. Don't create your own engine; bind
|
||||
# migrate_engine to your metadata
|
||||
pre_meta.bind = migrate_engine
|
||||
post_meta.bind = migrate_engine
|
||||
|
||||
|
||||
def downgrade(migrate_engine):
|
||||
# Operations to reverse the above upgrade go here.
|
||||
pre_meta.bind = migrate_engine
|
||||
post_meta.bind = migrate_engine
|
||||
|
|
@ -6,10 +6,13 @@ from flask.ext.openid import OpenID
|
|||
from config import basedir
|
||||
from flask import Flask
|
||||
from flask.ext.sqlalchemy import SQLAlchemy
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
|
||||
app = Flask(__name__)
|
||||
app.config.from_object('config')
|
||||
|
||||
db = SQLAlchemy(app)
|
||||
Base = declarative_base()
|
||||
|
||||
lm = LoginManager()
|
||||
lm.init_app(app)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from flask.ext.wtf import Form, TextField, BooleanField
|
||||
from flask.ext.wtf import Form, TextField, BooleanField, DateField
|
||||
from flask.ext.wtf import Required
|
||||
|
||||
|
||||
|
|
@ -7,9 +7,15 @@ class LoginForm(Form):
|
|||
remember_me = BooleanField('remember_me', default=False)
|
||||
|
||||
|
||||
class CreateProjectForm(Form):
|
||||
project_name = TextField('project_name', validators=[Required()])
|
||||
start_date = TextField('start_date', validators=[Required()])
|
||||
end_date = TextField('end_date', validators=[Required()])
|
||||
info = TextField('info')
|
||||
team = TextField('team', validators=[Required()])
|
||||
class CreateTaskForm(Form):
|
||||
name = TextField('Task Name', validators=[Required(), ])
|
||||
info = TextField('Info', description='Some helpful text')
|
||||
start_date = DateField('Start Date', validators=[Required()])
|
||||
end_date = DateField('End Date', validators=[Required()])
|
||||
team = TextField('Team', validators=[Required()])
|
||||
|
||||
|
||||
class CreateProjectForm(CreateTaskForm):
|
||||
name = TextField('Project Name', validators=[Required()])
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +1,55 @@
|
|||
from megaproject import db
|
||||
from megaproject import db, Base
|
||||
|
||||
ROLE_USER = 0
|
||||
ROLE_ADMIN = 1
|
||||
|
||||
|
||||
class Project(db.Model):
|
||||
__tablename__ = 'project'
|
||||
__table_args__ = {'extend_existing':True}
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
name = db.Column(db.String(256), index=True)
|
||||
start_date = db.Column(db.Date)
|
||||
end_date = db.Column(db.Date)
|
||||
info = db.Column(db.String(256))
|
||||
owner_id = db.Column(db.Integer, db.ForeignKey('user.id'))
|
||||
|
||||
tasks = db.relationship('Task')
|
||||
|
||||
def __repr__(self):
|
||||
return '<Project %d %s owner %s>' % (self.id, self.name, self.owner_id)
|
||||
|
||||
|
||||
class Task(db.Model):
|
||||
__tablename__ = 'task'
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
name = db.Column(db.String(256), index=True)
|
||||
start_date = db.Column(db.Date)
|
||||
end_date = db.Column(db.Date)
|
||||
info = db.Column(db.String(256))
|
||||
project_id = db.Column(db.Integer, db.ForeignKey('project.id'))
|
||||
owner_id = db.Column(db.Integer, db.ForeignKey('user.id'))
|
||||
parent_task = db.Column(db.Integer, db.ForeignKey('task.id'))
|
||||
|
||||
def __repr__(self):
|
||||
return '<Task %r>' % self.name
|
||||
|
||||
|
||||
association_table = db.Table('UserTask', Base.metadata,
|
||||
db.Column('user_id', db.Integer, db.ForeignKey('user.id')),
|
||||
db.Column('task_id', db.Integer, db.ForeignKey('task.id'))
|
||||
)
|
||||
|
||||
|
||||
class User(db.Model):
|
||||
__tablename__ = 'user'
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
nickname = db.Column(db.String(64), index=True, unique=True)
|
||||
email = db.Column(db.String(120), index=True, unique=True)
|
||||
role = db.Column(db.SmallInteger, default=ROLE_USER)
|
||||
projects = db.relationship('Project', backref='owner', lazy='dynamic')
|
||||
#tasks = db.relationship('Task', backref='workers', lazy='dynamic')
|
||||
# children = db.relationship("Task",
|
||||
# secondary=association_table,
|
||||
# backref="users")
|
||||
|
||||
def is_authenticated(self):
|
||||
return True
|
||||
|
|
@ -38,17 +77,3 @@ class User(db.Model):
|
|||
|
||||
def __repr__(self):
|
||||
return '<User %r>' % self.nickname
|
||||
|
||||
|
||||
class Project(db.Model):
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
name = db.Column(db.String(256), index=True)
|
||||
start_date = db.Column(db.Date)
|
||||
end_date = db.Column(db.Date)
|
||||
progress = db.Column(db.Integer)
|
||||
owner_id = db.Column(db.Integer, db.ForeignKey('user.id'))
|
||||
# members = db.relationship('Members', backref='members', lazy='dynamic')
|
||||
# subtasks = db.relationship('Task', backref='subtasks', lazy='dynamic')
|
||||
|
||||
# class Task(db.Model):
|
||||
# pass
|
||||
|
|
|
|||
182
megaproject/static/css/datepicker.css
Executable file
182
megaproject/static/css/datepicker.css
Executable file
|
|
@ -0,0 +1,182 @@
|
|||
/*!
|
||||
* Datepicker for Bootstrap
|
||||
*
|
||||
* Copyright 2012 Stefan Petre
|
||||
* Licensed under the Apache License v2.0
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*/
|
||||
.datepicker {
|
||||
top: 0;
|
||||
left: 0;
|
||||
padding: 4px;
|
||||
margin-top: 1px;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
/*.dow {
|
||||
border-top: 1px solid #ddd !important;
|
||||
}*/
|
||||
|
||||
}
|
||||
.datepicker:before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
border-left: 7px solid transparent;
|
||||
border-right: 7px solid transparent;
|
||||
border-bottom: 7px solid #ccc;
|
||||
border-bottom-color: rgba(0, 0, 0, 0.2);
|
||||
position: absolute;
|
||||
top: -7px;
|
||||
left: 6px;
|
||||
}
|
||||
.datepicker:after {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
border-left: 6px solid transparent;
|
||||
border-right: 6px solid transparent;
|
||||
border-bottom: 6px solid #ffffff;
|
||||
position: absolute;
|
||||
top: -6px;
|
||||
left: 7px;
|
||||
}
|
||||
.datepicker > div {
|
||||
display: none;
|
||||
}
|
||||
.datepicker table {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
.datepicker td,
|
||||
.datepicker th {
|
||||
text-align: center;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.datepicker td.day:hover {
|
||||
background: #eeeeee;
|
||||
cursor: pointer;
|
||||
}
|
||||
.datepicker td.day.disabled {
|
||||
color: #eeeeee;
|
||||
}
|
||||
.datepicker td.old,
|
||||
.datepicker td.new {
|
||||
color: #999999;
|
||||
}
|
||||
.datepicker td.active,
|
||||
.datepicker td.active:hover {
|
||||
color: #ffffff;
|
||||
background-color: #006dcc;
|
||||
background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
|
||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
|
||||
background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
|
||||
background-image: -o-linear-gradient(top, #0088cc, #0044cc);
|
||||
background-image: linear-gradient(to bottom, #0088cc, #0044cc);
|
||||
background-repeat: repeat-x;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);
|
||||
border-color: #0044cc #0044cc #002a80;
|
||||
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
||||
*background-color: #0044cc;
|
||||
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
|
||||
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
|
||||
color: #fff;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
.datepicker td.active:hover,
|
||||
.datepicker td.active:hover:hover,
|
||||
.datepicker td.active:focus,
|
||||
.datepicker td.active:hover:focus,
|
||||
.datepicker td.active:active,
|
||||
.datepicker td.active:hover:active,
|
||||
.datepicker td.active.active,
|
||||
.datepicker td.active:hover.active,
|
||||
.datepicker td.active.disabled,
|
||||
.datepicker td.active:hover.disabled,
|
||||
.datepicker td.active[disabled],
|
||||
.datepicker td.active:hover[disabled] {
|
||||
color: #ffffff;
|
||||
background-color: #0044cc;
|
||||
*background-color: #003bb3;
|
||||
}
|
||||
.datepicker td.active:active,
|
||||
.datepicker td.active:hover:active,
|
||||
.datepicker td.active.active,
|
||||
.datepicker td.active:hover.active {
|
||||
background-color: #003399 \9;
|
||||
}
|
||||
.datepicker td span {
|
||||
display: block;
|
||||
width: 47px;
|
||||
height: 54px;
|
||||
line-height: 54px;
|
||||
float: left;
|
||||
margin: 2px;
|
||||
cursor: pointer;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.datepicker td span:hover {
|
||||
background: #eeeeee;
|
||||
}
|
||||
.datepicker td span.active {
|
||||
color: #ffffff;
|
||||
background-color: #006dcc;
|
||||
background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
|
||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
|
||||
background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
|
||||
background-image: -o-linear-gradient(top, #0088cc, #0044cc);
|
||||
background-image: linear-gradient(to bottom, #0088cc, #0044cc);
|
||||
background-repeat: repeat-x;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);
|
||||
border-color: #0044cc #0044cc #002a80;
|
||||
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
||||
*background-color: #0044cc;
|
||||
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
|
||||
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
|
||||
color: #fff;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
.datepicker td span.active:hover,
|
||||
.datepicker td span.active:focus,
|
||||
.datepicker td span.active:active,
|
||||
.datepicker td span.active.active,
|
||||
.datepicker td span.active.disabled,
|
||||
.datepicker td span.active[disabled] {
|
||||
color: #ffffff;
|
||||
background-color: #0044cc;
|
||||
*background-color: #003bb3;
|
||||
}
|
||||
.datepicker td span.active:active,
|
||||
.datepicker td span.active.active {
|
||||
background-color: #003399 \9;
|
||||
}
|
||||
.datepicker td span.old {
|
||||
color: #999999;
|
||||
}
|
||||
.datepicker th.switch {
|
||||
width: 145px;
|
||||
}
|
||||
.datepicker th.next,
|
||||
.datepicker th.prev {
|
||||
font-size: 21px;
|
||||
}
|
||||
.datepicker thead tr:first-child th {
|
||||
cursor: pointer;
|
||||
}
|
||||
.datepicker thead tr:first-child th:hover {
|
||||
background: #eeeeee;
|
||||
}
|
||||
.input-append.date .add-on i,
|
||||
.input-prepend.date .add-on i {
|
||||
display: block;
|
||||
cursor: pointer;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
569
megaproject/static/css/fullcalendar.css
Executable file
569
megaproject/static/css/fullcalendar.css
Executable file
|
|
@ -0,0 +1,569 @@
|
|||
/*!
|
||||
* FullCalendar v1.6.1 Stylesheet
|
||||
* Docs & License: http://arshaw.com/fullcalendar/
|
||||
* (c) 2013 Adam Shaw
|
||||
*/
|
||||
|
||||
.fc {
|
||||
direction: ltr;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.fc table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
html .fc,
|
||||
.fc table {
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
.fc td,
|
||||
.fc th {
|
||||
padding: 0;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
/* Header
|
||||
------------------------------------------------------------------------*/
|
||||
|
||||
.fc-header td {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.fc-header-left {
|
||||
width: 25%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.fc-header-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.fc-header-right {
|
||||
width: 25%;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.fc-header-title {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.fc-header-title h2 {
|
||||
margin-top: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.fc .fc-header-space {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.fc-header .fc-button {
|
||||
margin-bottom: 1em;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
/* buttons edges butting together */
|
||||
|
||||
.fc-header .fc-button {
|
||||
margin-right: -1px;
|
||||
}
|
||||
|
||||
.fc-header .fc-corner-right, /* non-theme */
|
||||
.fc-header .ui-corner-right {
|
||||
/* theme */
|
||||
margin-right: 0; /* back to normal */
|
||||
}
|
||||
|
||||
/* button layering (for border precedence) */
|
||||
|
||||
.fc-header .fc-state-hover,
|
||||
.fc-header .ui-state-hover {
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.fc-header .fc-state-down {
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.fc-header .fc-state-active,
|
||||
.fc-header .ui-state-active {
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
/* Content
|
||||
------------------------------------------------------------------------*/
|
||||
|
||||
.fc-content {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.fc-view {
|
||||
width: 100%; /* needed for view switching (when view is absolute) */
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Cell Styles
|
||||
------------------------------------------------------------------------*/
|
||||
|
||||
.fc-widget-header, /* <th>, usually */
|
||||
.fc-widget-content {
|
||||
/* <td>, usually */
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.fc-state-highlight {
|
||||
/* <td> today cell */
|
||||
/* TODO: add .fc-today to <th> */
|
||||
background: #fcf8e3;
|
||||
}
|
||||
|
||||
.fc-cell-overlay {
|
||||
/* semi-transparent rectangle while dragging */
|
||||
background: #bce8f1;
|
||||
opacity: .3;
|
||||
filter: alpha(opacity=30); /* for IE */
|
||||
}
|
||||
|
||||
/* Buttons
|
||||
------------------------------------------------------------------------*/
|
||||
|
||||
.fc-button {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
padding: 0 .6em;
|
||||
overflow: hidden;
|
||||
height: 1.9em;
|
||||
line-height: 1.9em;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.fc-state-default {
|
||||
/* non-theme */
|
||||
border: 1px solid;
|
||||
}
|
||||
|
||||
.fc-state-default.fc-corner-left {
|
||||
/* non-theme */
|
||||
border-top-left-radius: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
}
|
||||
|
||||
.fc-state-default.fc-corner-right {
|
||||
/* non-theme */
|
||||
border-top-right-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
|
||||
/*
|
||||
Our default prev/next buttons use HTML entities like ‹ › « »
|
||||
and we'll try to make them look good cross-browser.
|
||||
*/
|
||||
|
||||
.fc-text-arrow {
|
||||
margin: 0 .1em;
|
||||
font-size: 2em;
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
vertical-align: baseline; /* for IE7 */
|
||||
}
|
||||
|
||||
.fc-button-prev .fc-text-arrow,
|
||||
.fc-button-next .fc-text-arrow {
|
||||
/* for ‹ › */
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* icon (for jquery ui) */
|
||||
|
||||
.fc-button .fc-icon-wrap {
|
||||
position: relative;
|
||||
float: left;
|
||||
top: 50%;
|
||||
}
|
||||
|
||||
.fc-button .ui-icon {
|
||||
position: relative;
|
||||
float: left;
|
||||
margin-top: -50%;
|
||||
*margin-top: 0;
|
||||
*top: -50%;
|
||||
}
|
||||
|
||||
/*
|
||||
button states
|
||||
borrowed from twitter bootstrap (http://twitter.github.com/bootstrap/)
|
||||
*/
|
||||
|
||||
.fc-state-default {
|
||||
background-color: #f5f5f5;
|
||||
background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
|
||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
|
||||
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
|
||||
background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
|
||||
background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
|
||||
background-repeat: repeat-x;
|
||||
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
|
||||
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
||||
color: #333;
|
||||
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.fc-state-hover,
|
||||
.fc-state-down,
|
||||
.fc-state-active,
|
||||
.fc-state-disabled {
|
||||
color: #333333;
|
||||
background-color: #e6e6e6;
|
||||
}
|
||||
|
||||
.fc-state-hover {
|
||||
color: #333333;
|
||||
text-decoration: none;
|
||||
background-position: 0 -15px;
|
||||
-webkit-transition: background-position 0.1s linear;
|
||||
-moz-transition: background-position 0.1s linear;
|
||||
-o-transition: background-position 0.1s linear;
|
||||
transition: background-position 0.1s linear;
|
||||
}
|
||||
|
||||
.fc-state-down,
|
||||
.fc-state-active {
|
||||
background-color: #cccccc;
|
||||
background-image: none;
|
||||
outline: 0;
|
||||
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.fc-state-disabled {
|
||||
cursor: default;
|
||||
background-image: none;
|
||||
opacity: 0.65;
|
||||
filter: alpha(opacity=65);
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
/* Global Event Styles
|
||||
------------------------------------------------------------------------*/
|
||||
|
||||
.fc-event {
|
||||
border: 1px solid #bce8f1; /* default BORDER color */
|
||||
background-color: #d9edf7; /* default BACKGROUND color */
|
||||
color: #3a87ad; /* default TEXT color */
|
||||
font-size: .85em;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
a.fc-event {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.fc-event,
|
||||
.fc-event-draggable {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.fc-rtl .fc-event {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.fc-event-inner {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.fc-event-time,
|
||||
.fc-event-title {
|
||||
padding: 0 1px;
|
||||
}
|
||||
|
||||
.fc .ui-resizable-handle {
|
||||
display: block;
|
||||
position: absolute;
|
||||
z-index: 99999;
|
||||
overflow: hidden; /* hacky spaces (IE6/7) */
|
||||
font-size: 300%; /* */
|
||||
line-height: 50%; /* */
|
||||
}
|
||||
|
||||
/* Horizontal Events
|
||||
------------------------------------------------------------------------*/
|
||||
|
||||
.fc-event-hori {
|
||||
border-width: 1px 0;
|
||||
margin-bottom: 1px;
|
||||
}
|
||||
|
||||
.fc-ltr .fc-event-hori.fc-event-start,
|
||||
.fc-rtl .fc-event-hori.fc-event-end {
|
||||
border-left-width: 1px;
|
||||
border-top-left-radius: 3px;
|
||||
border-bottom-left-radius: 3px;
|
||||
}
|
||||
|
||||
.fc-ltr .fc-event-hori.fc-event-end,
|
||||
.fc-rtl .fc-event-hori.fc-event-start {
|
||||
border-right-width: 1px;
|
||||
border-top-right-radius: 3px;
|
||||
border-bottom-right-radius: 3px;
|
||||
}
|
||||
|
||||
/* resizable */
|
||||
|
||||
.fc-event-hori .ui-resizable-e {
|
||||
top: 0 !important; /* importants override pre jquery ui 1.7 styles */
|
||||
right: -3px !important;
|
||||
width: 7px !important;
|
||||
height: 100% !important;
|
||||
cursor: e-resize;
|
||||
}
|
||||
|
||||
.fc-event-hori .ui-resizable-w {
|
||||
top: 0 !important;
|
||||
left: -3px !important;
|
||||
width: 7px !important;
|
||||
height: 100% !important;
|
||||
cursor: w-resize;
|
||||
}
|
||||
|
||||
.fc-event-hori .ui-resizable-handle {
|
||||
_padding-bottom: 14px; /* IE6 had 0 height */
|
||||
}
|
||||
|
||||
/* Reusable Separate-border Table
|
||||
------------------------------------------------------------*/
|
||||
|
||||
table.fc-border-separate {
|
||||
border-collapse: separate;
|
||||
}
|
||||
|
||||
.fc-border-separate th,
|
||||
.fc-border-separate td {
|
||||
border-width: 1px 0 0 1px;
|
||||
}
|
||||
|
||||
.fc-border-separate th.fc-last,
|
||||
.fc-border-separate td.fc-last {
|
||||
border-right-width: 1px;
|
||||
}
|
||||
|
||||
.fc-border-separate tr.fc-last th,
|
||||
.fc-border-separate tr.fc-last td {
|
||||
border-bottom-width: 1px;
|
||||
}
|
||||
|
||||
.fc-border-separate tbody tr.fc-first td,
|
||||
.fc-border-separate tbody tr.fc-first th {
|
||||
border-top-width: 0;
|
||||
}
|
||||
|
||||
/* Month View, Basic Week View, Basic Day View
|
||||
------------------------------------------------------------------------*/
|
||||
|
||||
.fc-grid th {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.fc .fc-week-number {
|
||||
width: 22px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.fc .fc-week-number div {
|
||||
padding: 0 2px;
|
||||
}
|
||||
|
||||
.fc-grid .fc-day-number {
|
||||
float: right;
|
||||
padding: 0 2px;
|
||||
}
|
||||
|
||||
.fc-grid .fc-other-month .fc-day-number {
|
||||
opacity: 0.3;
|
||||
filter: alpha(opacity=30); /* for IE */
|
||||
/* opacity with small font can sometimes look too faded
|
||||
might want to set the 'color' property instead
|
||||
making day-numbers bold also fixes the problem */
|
||||
}
|
||||
|
||||
.fc-grid .fc-day-content {
|
||||
clear: both;
|
||||
padding: 2px 2px 1px; /* distance between events and day edges */
|
||||
}
|
||||
|
||||
/* event styles */
|
||||
|
||||
.fc-grid .fc-event-time {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* right-to-left */
|
||||
|
||||
.fc-rtl .fc-grid .fc-day-number {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.fc-rtl .fc-grid .fc-event-time {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* Agenda Week View, Agenda Day View
|
||||
------------------------------------------------------------------------*/
|
||||
|
||||
.fc-agenda table {
|
||||
border-collapse: separate;
|
||||
}
|
||||
|
||||
.fc-agenda-days th {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.fc-agenda .fc-agenda-axis {
|
||||
width: 50px;
|
||||
padding: 0 4px;
|
||||
vertical-align: middle;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.fc-agenda .fc-week-number {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.fc-agenda .fc-day-content {
|
||||
padding: 2px 2px 1px;
|
||||
}
|
||||
|
||||
/* make axis border take precedence */
|
||||
|
||||
.fc-agenda-days .fc-agenda-axis {
|
||||
border-right-width: 1px;
|
||||
}
|
||||
|
||||
.fc-agenda-days .fc-col0 {
|
||||
border-left-width: 0;
|
||||
}
|
||||
|
||||
/* all-day area */
|
||||
|
||||
.fc-agenda-allday th {
|
||||
border-width: 0 1px;
|
||||
}
|
||||
|
||||
.fc-agenda-allday .fc-day-content {
|
||||
min-height: 34px; /* TODO: doesnt work well in quirksmode */
|
||||
_height: 34px;
|
||||
}
|
||||
|
||||
/* divider (between all-day and slots) */
|
||||
|
||||
.fc-agenda-divider-inner {
|
||||
height: 2px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.fc-widget-header .fc-agenda-divider-inner {
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
/* slot rows */
|
||||
|
||||
.fc-agenda-slots th {
|
||||
border-width: 1px 1px 0;
|
||||
}
|
||||
|
||||
.fc-agenda-slots td {
|
||||
border-width: 1px 0 0;
|
||||
background: none;
|
||||
}
|
||||
|
||||
.fc-agenda-slots td div {
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.fc-agenda-slots tr.fc-slot0 th,
|
||||
.fc-agenda-slots tr.fc-slot0 td {
|
||||
border-top-width: 0;
|
||||
}
|
||||
|
||||
.fc-agenda-slots tr.fc-minor th,
|
||||
.fc-agenda-slots tr.fc-minor td {
|
||||
border-top-style: dotted;
|
||||
}
|
||||
|
||||
.fc-agenda-slots tr.fc-minor th.ui-widget-header {
|
||||
*border-top-style: solid; /* doesn't work with background in IE6/7 */
|
||||
}
|
||||
|
||||
/* Vertical Events
|
||||
------------------------------------------------------------------------*/
|
||||
|
||||
.fc-event-vert {
|
||||
border-width: 0 1px;
|
||||
}
|
||||
|
||||
.fc-event-vert.fc-event-start {
|
||||
border-top-width: 1px;
|
||||
border-top-left-radius: 3px;
|
||||
border-top-right-radius: 3px;
|
||||
}
|
||||
|
||||
.fc-event-vert.fc-event-end {
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-left-radius: 3px;
|
||||
border-bottom-right-radius: 3px;
|
||||
}
|
||||
|
||||
.fc-event-vert .fc-event-time {
|
||||
white-space: nowrap;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.fc-event-vert .fc-event-inner {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.fc-event-vert .fc-event-bg {
|
||||
/* makes the event lighter w/ a semi-transparent overlay */
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
opacity: .25;
|
||||
filter: alpha(opacity=25);
|
||||
}
|
||||
|
||||
.fc .ui-draggable-dragging .fc-event-bg, /* TODO: something nicer like .fc-opacity */
|
||||
.fc-select-helper .fc-event-bg {
|
||||
display: none\9; /* for IE6/7/8. nested opacity filters while dragging don't work */
|
||||
}
|
||||
|
||||
/* resizable */
|
||||
|
||||
.fc-event-vert .ui-resizable-s {
|
||||
bottom: 0 !important; /* importants override pre jquery ui 1.7 styles */
|
||||
width: 100% !important;
|
||||
height: 8px !important;
|
||||
overflow: hidden !important;
|
||||
line-height: 8px !important;
|
||||
font-size: 11px !important;
|
||||
font-family: monospace;
|
||||
text-align: center;
|
||||
cursor: s-resize;
|
||||
}
|
||||
|
||||
.fc-agenda .ui-resizable-resizing {
|
||||
/* TODO: better selector */
|
||||
_overflow: hidden;
|
||||
}
|
||||
|
||||
|
||||
32
megaproject/static/css/fullcalendar.print.css
Executable file
32
megaproject/static/css/fullcalendar.print.css
Executable file
|
|
@ -0,0 +1,32 @@
|
|||
/*!
|
||||
* FullCalendar v1.6.1 Print Stylesheet
|
||||
* Docs & License: http://arshaw.com/fullcalendar/
|
||||
* (c) 2013 Adam Shaw
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include this stylesheet on your page to get a more printer-friendly calendar.
|
||||
* When including this stylesheet, use the media='print' attribute of the <link> tag.
|
||||
* Make sure to include this stylesheet IN ADDITION to the regular fullcalendar.css.
|
||||
*/
|
||||
|
||||
|
||||
/* Events
|
||||
-----------------------------------------------------*/
|
||||
|
||||
.fc-event {
|
||||
background: #fff !important;
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
/* for vertical events */
|
||||
|
||||
.fc-event-bg {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.fc-event .ui-resizable-handle {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
|
||||
BIN
megaproject/static/img/animated-overlay.gif
Executable file
BIN
megaproject/static/img/animated-overlay.gif
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
BIN
megaproject/static/img/aol.png
Executable file
BIN
megaproject/static/img/aol.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
BIN
megaproject/static/img/flickr.png
Executable file
BIN
megaproject/static/img/flickr.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
BIN
megaproject/static/img/google.png
Executable file
BIN
megaproject/static/img/google.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
BIN
megaproject/static/img/myopenid.png
Executable file
BIN
megaproject/static/img/myopenid.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
BIN
megaproject/static/img/yahoo.png
Executable file
BIN
megaproject/static/img/yahoo.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
474
megaproject/static/js/bootstrap-datepicker.js
vendored
Executable file
474
megaproject/static/js/bootstrap-datepicker.js
vendored
Executable file
|
|
@ -0,0 +1,474 @@
|
|||
/* =========================================================
|
||||
* bootstrap-datepicker.js
|
||||
* http://www.eyecon.ro/bootstrap-datepicker
|
||||
* =========================================================
|
||||
* Copyright 2012 Stefan Petre
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ========================================================= */
|
||||
|
||||
!function( $ ) {
|
||||
|
||||
// Picker object
|
||||
|
||||
var Datepicker = function(element, options){
|
||||
this.element = $(element);
|
||||
this.format = DPGlobal.parseFormat(options.format||this.element.data('date-format')||'mm/dd/yyyy');
|
||||
this.picker = $(DPGlobal.template)
|
||||
.appendTo('body')
|
||||
.on({
|
||||
click: $.proxy(this.click, this)//,
|
||||
//mousedown: $.proxy(this.mousedown, this)
|
||||
});
|
||||
this.isInput = this.element.is('input');
|
||||
this.component = this.element.is('.date') ? this.element.find('.add-on') : false;
|
||||
|
||||
if (this.isInput) {
|
||||
this.element.on({
|
||||
focus: $.proxy(this.show, this),
|
||||
//blur: $.proxy(this.hide, this),
|
||||
keyup: $.proxy(this.update, this)
|
||||
});
|
||||
} else {
|
||||
if (this.component){
|
||||
this.component.on('click', $.proxy(this.show, this));
|
||||
} else {
|
||||
this.element.on('click', $.proxy(this.show, this));
|
||||
}
|
||||
}
|
||||
|
||||
this.minViewMode = options.minViewMode||this.element.data('date-minviewmode')||0;
|
||||
if (typeof this.minViewMode === 'string') {
|
||||
switch (this.minViewMode) {
|
||||
case 'months':
|
||||
this.minViewMode = 1;
|
||||
break;
|
||||
case 'years':
|
||||
this.minViewMode = 2;
|
||||
break;
|
||||
default:
|
||||
this.minViewMode = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.viewMode = options.viewMode||this.element.data('date-viewmode')||0;
|
||||
if (typeof this.viewMode === 'string') {
|
||||
switch (this.viewMode) {
|
||||
case 'months':
|
||||
this.viewMode = 1;
|
||||
break;
|
||||
case 'years':
|
||||
this.viewMode = 2;
|
||||
break;
|
||||
default:
|
||||
this.viewMode = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.startViewMode = this.viewMode;
|
||||
this.weekStart = options.weekStart||this.element.data('date-weekstart')||0;
|
||||
this.weekEnd = this.weekStart === 0 ? 6 : this.weekStart - 1;
|
||||
this.onRender = options.onRender;
|
||||
this.fillDow();
|
||||
this.fillMonths();
|
||||
this.update();
|
||||
this.showMode();
|
||||
};
|
||||
|
||||
Datepicker.prototype = {
|
||||
constructor: Datepicker,
|
||||
|
||||
show: function(e) {
|
||||
this.picker.show();
|
||||
this.height = this.component ? this.component.outerHeight() : this.element.outerHeight();
|
||||
this.place();
|
||||
$(window).on('resize', $.proxy(this.place, this));
|
||||
if (e ) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
}
|
||||
if (!this.isInput) {
|
||||
}
|
||||
var that = this;
|
||||
$(document).on('mousedown', function(ev){
|
||||
if ($(ev.target).closest('.datepicker').length == 0) {
|
||||
that.hide();
|
||||
}
|
||||
});
|
||||
this.element.trigger({
|
||||
type: 'show',
|
||||
date: this.date
|
||||
});
|
||||
},
|
||||
|
||||
hide: function(){
|
||||
this.picker.hide();
|
||||
$(window).off('resize', this.place);
|
||||
this.viewMode = this.startViewMode;
|
||||
this.showMode();
|
||||
if (!this.isInput) {
|
||||
$(document).off('mousedown', this.hide);
|
||||
}
|
||||
//this.set();
|
||||
this.element.trigger({
|
||||
type: 'hide',
|
||||
date: this.date
|
||||
});
|
||||
},
|
||||
|
||||
set: function() {
|
||||
var formated = DPGlobal.formatDate(this.date, this.format);
|
||||
if (!this.isInput) {
|
||||
if (this.component){
|
||||
this.element.find('input').prop('value', formated);
|
||||
}
|
||||
this.element.data('date', formated);
|
||||
} else {
|
||||
this.element.prop('value', formated);
|
||||
}
|
||||
},
|
||||
|
||||
setValue: function(newDate) {
|
||||
if (typeof newDate === 'string') {
|
||||
this.date = DPGlobal.parseDate(newDate, this.format);
|
||||
} else {
|
||||
this.date = new Date(newDate);
|
||||
}
|
||||
this.set();
|
||||
this.viewDate = new Date(this.date.getFullYear(), this.date.getMonth(), 1, 0, 0, 0, 0);
|
||||
this.fill();
|
||||
},
|
||||
|
||||
place: function(){
|
||||
var offset = this.component ? this.component.offset() : this.element.offset();
|
||||
this.picker.css({
|
||||
top: offset.top + this.height,
|
||||
left: offset.left
|
||||
});
|
||||
},
|
||||
|
||||
update: function(newDate){
|
||||
this.date = DPGlobal.parseDate(
|
||||
typeof newDate === 'string' ? newDate : (this.isInput ? this.element.prop('value') : this.element.data('date')),
|
||||
this.format
|
||||
);
|
||||
this.viewDate = new Date(this.date.getFullYear(), this.date.getMonth(), 1, 0, 0, 0, 0);
|
||||
this.fill();
|
||||
},
|
||||
|
||||
fillDow: function(){
|
||||
var dowCnt = this.weekStart;
|
||||
var html = '<tr>';
|
||||
while (dowCnt < this.weekStart + 7) {
|
||||
html += '<th class="dow">'+DPGlobal.dates.daysMin[(dowCnt++)%7]+'</th>';
|
||||
}
|
||||
html += '</tr>';
|
||||
this.picker.find('.datepicker-days thead').append(html);
|
||||
},
|
||||
|
||||
fillMonths: function(){
|
||||
var html = '';
|
||||
var i = 0
|
||||
while (i < 12) {
|
||||
html += '<span class="month">'+DPGlobal.dates.monthsShort[i++]+'</span>';
|
||||
}
|
||||
this.picker.find('.datepicker-months td').append(html);
|
||||
},
|
||||
|
||||
fill: function() {
|
||||
var d = new Date(this.viewDate),
|
||||
year = d.getFullYear(),
|
||||
month = d.getMonth(),
|
||||
currentDate = this.date.valueOf();
|
||||
this.picker.find('.datepicker-days th:eq(1)')
|
||||
.text(DPGlobal.dates.months[month]+' '+year);
|
||||
var prevMonth = new Date(year, month-1, 28,0,0,0,0),
|
||||
day = DPGlobal.getDaysInMonth(prevMonth.getFullYear(), prevMonth.getMonth());
|
||||
prevMonth.setDate(day);
|
||||
prevMonth.setDate(day - (prevMonth.getDay() - this.weekStart + 7)%7);
|
||||
var nextMonth = new Date(prevMonth);
|
||||
nextMonth.setDate(nextMonth.getDate() + 42);
|
||||
nextMonth = nextMonth.valueOf();
|
||||
var html = [];
|
||||
var clsName,
|
||||
prevY,
|
||||
prevM;
|
||||
while(prevMonth.valueOf() < nextMonth) {
|
||||
if (prevMonth.getDay() === this.weekStart) {
|
||||
html.push('<tr>');
|
||||
}
|
||||
clsName = this.onRender(prevMonth);
|
||||
prevY = prevMonth.getFullYear();
|
||||
prevM = prevMonth.getMonth();
|
||||
if ((prevM < month && prevY === year) || prevY < year) {
|
||||
clsName += ' old';
|
||||
} else if ((prevM > month && prevY === year) || prevY > year) {
|
||||
clsName += ' new';
|
||||
}
|
||||
if (prevMonth.valueOf() === currentDate) {
|
||||
clsName += ' active';
|
||||
}
|
||||
html.push('<td class="day '+clsName+'">'+prevMonth.getDate() + '</td>');
|
||||
if (prevMonth.getDay() === this.weekEnd) {
|
||||
html.push('</tr>');
|
||||
}
|
||||
prevMonth.setDate(prevMonth.getDate()+1);
|
||||
}
|
||||
this.picker.find('.datepicker-days tbody').empty().append(html.join(''));
|
||||
var currentYear = this.date.getFullYear();
|
||||
|
||||
var months = this.picker.find('.datepicker-months')
|
||||
.find('th:eq(1)')
|
||||
.text(year)
|
||||
.end()
|
||||
.find('span').removeClass('active');
|
||||
if (currentYear === year) {
|
||||
months.eq(this.date.getMonth()).addClass('active');
|
||||
}
|
||||
|
||||
html = '';
|
||||
year = parseInt(year/10, 10) * 10;
|
||||
var yearCont = this.picker.find('.datepicker-years')
|
||||
.find('th:eq(1)')
|
||||
.text(year + '-' + (year + 9))
|
||||
.end()
|
||||
.find('td');
|
||||
year -= 1;
|
||||
for (var i = -1; i < 11; i++) {
|
||||
html += '<span class="year'+(i === -1 || i === 10 ? ' old' : '')+(currentYear === year ? ' active' : '')+'">'+year+'</span>';
|
||||
year += 1;
|
||||
}
|
||||
yearCont.html(html);
|
||||
},
|
||||
|
||||
click: function(e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
var target = $(e.target).closest('span, td, th');
|
||||
if (target.length === 1) {
|
||||
switch(target[0].nodeName.toLowerCase()) {
|
||||
case 'th':
|
||||
switch(target[0].className) {
|
||||
case 'switch':
|
||||
this.showMode(1);
|
||||
break;
|
||||
case 'prev':
|
||||
case 'next':
|
||||
this.viewDate['set'+DPGlobal.modes[this.viewMode].navFnc].call(
|
||||
this.viewDate,
|
||||
this.viewDate['get'+DPGlobal.modes[this.viewMode].navFnc].call(this.viewDate) +
|
||||
DPGlobal.modes[this.viewMode].navStep * (target[0].className === 'prev' ? -1 : 1)
|
||||
);
|
||||
this.fill();
|
||||
this.set();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'span':
|
||||
if (target.is('.month')) {
|
||||
var month = target.parent().find('span').index(target);
|
||||
this.viewDate.setMonth(month);
|
||||
} else {
|
||||
var year = parseInt(target.text(), 10)||0;
|
||||
this.viewDate.setFullYear(year);
|
||||
}
|
||||
if (this.viewMode !== 0) {
|
||||
this.date = new Date(this.viewDate);
|
||||
this.element.trigger({
|
||||
type: 'changeDate',
|
||||
date: this.date,
|
||||
viewMode: DPGlobal.modes[this.viewMode].clsName
|
||||
});
|
||||
}
|
||||
this.showMode(-1);
|
||||
this.fill();
|
||||
this.set();
|
||||
break;
|
||||
case 'td':
|
||||
if (target.is('.day') && !target.is('.disabled')){
|
||||
var day = parseInt(target.text(), 10)||1;
|
||||
var month = this.viewDate.getMonth();
|
||||
if (target.is('.old')) {
|
||||
month -= 1;
|
||||
} else if (target.is('.new')) {
|
||||
month += 1;
|
||||
}
|
||||
var year = this.viewDate.getFullYear();
|
||||
this.date = new Date(year, month, day,0,0,0,0);
|
||||
this.viewDate = new Date(year, month, Math.min(28, day),0,0,0,0);
|
||||
this.fill();
|
||||
this.set();
|
||||
this.element.trigger({
|
||||
type: 'changeDate',
|
||||
date: this.date,
|
||||
viewMode: DPGlobal.modes[this.viewMode].clsName
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
mousedown: function(e){
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
},
|
||||
|
||||
showMode: function(dir) {
|
||||
if (dir) {
|
||||
this.viewMode = Math.max(this.minViewMode, Math.min(2, this.viewMode + dir));
|
||||
}
|
||||
this.picker.find('>div').hide().filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName).show();
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.datepicker = function ( option, val ) {
|
||||
return this.each(function () {
|
||||
var $this = $(this),
|
||||
data = $this.data('datepicker'),
|
||||
options = typeof option === 'object' && option;
|
||||
if (!data) {
|
||||
$this.data('datepicker', (data = new Datepicker(this, $.extend({}, $.fn.datepicker.defaults,options))));
|
||||
}
|
||||
if (typeof option === 'string') data[option](val);
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.datepicker.defaults = {
|
||||
onRender: function(date) {
|
||||
return '';
|
||||
}
|
||||
};
|
||||
$.fn.datepicker.Constructor = Datepicker;
|
||||
|
||||
var DPGlobal = {
|
||||
modes: [
|
||||
{
|
||||
clsName: 'days',
|
||||
navFnc: 'Month',
|
||||
navStep: 1
|
||||
},
|
||||
{
|
||||
clsName: 'months',
|
||||
navFnc: 'FullYear',
|
||||
navStep: 1
|
||||
},
|
||||
{
|
||||
clsName: 'years',
|
||||
navFnc: 'FullYear',
|
||||
navStep: 10
|
||||
}],
|
||||
dates:{
|
||||
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
|
||||
daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
|
||||
daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
|
||||
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
|
||||
monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
|
||||
},
|
||||
isLeapYear: function (year) {
|
||||
return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0))
|
||||
},
|
||||
getDaysInMonth: function (year, month) {
|
||||
return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]
|
||||
},
|
||||
parseFormat: function(format){
|
||||
var separator = format.match(/[.\/\-\s].*?/),
|
||||
parts = format.split(/\W+/);
|
||||
if (!separator || !parts || parts.length === 0){
|
||||
throw new Error("Invalid date format.");
|
||||
}
|
||||
return {separator: separator, parts: parts};
|
||||
},
|
||||
parseDate: function(date, format) {
|
||||
var parts = date.split(format.separator),
|
||||
date = new Date(),
|
||||
val;
|
||||
date.setHours(0);
|
||||
date.setMinutes(0);
|
||||
date.setSeconds(0);
|
||||
date.setMilliseconds(0);
|
||||
if (parts.length === format.parts.length) {
|
||||
var year = date.getFullYear(), day = date.getDate(), month = date.getMonth();
|
||||
for (var i=0, cnt = format.parts.length; i < cnt; i++) {
|
||||
val = parseInt(parts[i], 10)||1;
|
||||
switch(format.parts[i]) {
|
||||
case 'dd':
|
||||
case 'd':
|
||||
day = val;
|
||||
date.setDate(val);
|
||||
break;
|
||||
case 'mm':
|
||||
case 'm':
|
||||
month = val - 1;
|
||||
date.setMonth(val - 1);
|
||||
break;
|
||||
case 'yy':
|
||||
year = 2000 + val;
|
||||
date.setFullYear(2000 + val);
|
||||
break;
|
||||
case 'yyyy':
|
||||
year = val;
|
||||
date.setFullYear(val);
|
||||
break;
|
||||
}
|
||||
}
|
||||
date = new Date(year, month, day, 0 ,0 ,0);
|
||||
}
|
||||
return date;
|
||||
},
|
||||
formatDate: function(date, format){
|
||||
var val = {
|
||||
d: date.getDate(),
|
||||
m: date.getMonth() + 1,
|
||||
yy: date.getFullYear().toString().substring(2),
|
||||
yyyy: date.getFullYear()
|
||||
};
|
||||
val.dd = (val.d < 10 ? '0' : '') + val.d;
|
||||
val.mm = (val.m < 10 ? '0' : '') + val.m;
|
||||
var date = [];
|
||||
for (var i=0, cnt = format.parts.length; i < cnt; i++) {
|
||||
date.push(val[format.parts[i]]);
|
||||
}
|
||||
return date.join(format.separator);
|
||||
},
|
||||
headTemplate: '<thead>'+
|
||||
'<tr>'+
|
||||
'<th class="prev">‹</th>'+
|
||||
'<th colspan="5" class="switch"></th>'+
|
||||
'<th class="next">›</th>'+
|
||||
'</tr>'+
|
||||
'</thead>',
|
||||
contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>'
|
||||
};
|
||||
DPGlobal.template = '<div class="datepicker dropdown-menu">'+
|
||||
'<div class="datepicker-days">'+
|
||||
'<table class=" table-condensed">'+
|
||||
DPGlobal.headTemplate+
|
||||
'<tbody></tbody>'+
|
||||
'</table>'+
|
||||
'</div>'+
|
||||
'<div class="datepicker-months">'+
|
||||
'<table class="table-condensed">'+
|
||||
DPGlobal.headTemplate+
|
||||
DPGlobal.contTemplate+
|
||||
'</table>'+
|
||||
'</div>'+
|
||||
'<div class="datepicker-years">'+
|
||||
'<table class="table-condensed">'+
|
||||
DPGlobal.headTemplate+
|
||||
DPGlobal.contTemplate+
|
||||
'</table>'+
|
||||
'</div>'+
|
||||
'</div>';
|
||||
|
||||
}( window.jQuery );
|
||||
5378
megaproject/static/js/fullcalendar.js
Executable file
5378
megaproject/static/js/fullcalendar.js
Executable file
File diff suppressed because it is too large
Load diff
7
megaproject/static/js/fullcalendar.min.js
vendored
Executable file
7
megaproject/static/js/fullcalendar.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
107
megaproject/static/js/gcal.js
Executable file
107
megaproject/static/js/gcal.js
Executable file
|
|
@ -0,0 +1,107 @@
|
|||
/*!
|
||||
* FullCalendar v1.6.1 Google Calendar Plugin
|
||||
* Docs & License: http://arshaw.com/fullcalendar/
|
||||
* (c) 2013 Adam Shaw
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
|
||||
|
||||
var fc = $.fullCalendar;
|
||||
var formatDate = fc.formatDate;
|
||||
var parseISO8601 = fc.parseISO8601;
|
||||
var addDays = fc.addDays;
|
||||
var applyAll = fc.applyAll;
|
||||
|
||||
|
||||
fc.sourceNormalizers.push(function (sourceOptions) {
|
||||
if (sourceOptions.dataType == 'gcal' ||
|
||||
sourceOptions.dataType === undefined &&
|
||||
(sourceOptions.url || '').match(/^(http|https):\/\/www.google.com\/calendar\/feeds\//)) {
|
||||
sourceOptions.dataType = 'gcal';
|
||||
if (sourceOptions.editable === undefined) {
|
||||
sourceOptions.editable = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
fc.sourceFetchers.push(function (sourceOptions, start, end) {
|
||||
if (sourceOptions.dataType == 'gcal') {
|
||||
return transformOptions(sourceOptions, start, end);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function transformOptions(sourceOptions, start, end) {
|
||||
|
||||
var success = sourceOptions.success;
|
||||
var data = $.extend({}, sourceOptions.data || {}, {
|
||||
'start-min': formatDate(start, 'u'),
|
||||
'start-max': formatDate(end, 'u'),
|
||||
'singleevents': true,
|
||||
'max-results': 9999
|
||||
});
|
||||
|
||||
var ctz = sourceOptions.currentTimezone;
|
||||
if (ctz) {
|
||||
data.ctz = ctz = ctz.replace(' ', '_');
|
||||
}
|
||||
|
||||
return $.extend({}, sourceOptions, {
|
||||
url: sourceOptions.url.replace(/\/basic$/, '/full') + '?alt=json-in-script&callback=?',
|
||||
dataType: 'jsonp',
|
||||
data: data,
|
||||
startParam: false,
|
||||
endParam: false,
|
||||
success: function (data) {
|
||||
var events = [];
|
||||
if (data.feed.entry) {
|
||||
$.each(data.feed.entry, function (i, entry) {
|
||||
var startStr = entry['gd$when'][0]['startTime'];
|
||||
var start = parseISO8601(startStr, true);
|
||||
var end = parseISO8601(entry['gd$when'][0]['endTime'], true);
|
||||
var allDay = startStr.indexOf('T') == -1;
|
||||
var url;
|
||||
$.each(entry.link, function (i, link) {
|
||||
if (link.type == 'text/html') {
|
||||
url = link.href;
|
||||
if (ctz) {
|
||||
url += (url.indexOf('?') == -1 ? '?' : '&') + 'ctz=' + ctz;
|
||||
}
|
||||
}
|
||||
});
|
||||
if (allDay) {
|
||||
addDays(end, -1); // make inclusive
|
||||
}
|
||||
events.push({
|
||||
id: entry['gCal$uid']['value'],
|
||||
title: entry['title']['$t'],
|
||||
url: url,
|
||||
start: start,
|
||||
end: end,
|
||||
allDay: allDay,
|
||||
location: entry['gd$where'][0]['valueString'],
|
||||
description: entry['content']['$t']
|
||||
});
|
||||
});
|
||||
}
|
||||
var args = [events].concat(Array.prototype.slice.call(arguments, 1));
|
||||
var res = applyAll(success, this, args);
|
||||
if ($.isArray(res)) {
|
||||
return res;
|
||||
}
|
||||
return events;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
// legacy
|
||||
fc.gcalFeed = function (url, sourceOptions) {
|
||||
return $.extend({}, sourceOptions, { url: url, dataType: 'gcal' });
|
||||
};
|
||||
|
||||
|
||||
})(jQuery);
|
||||
5
megaproject/static/js/jquery-1.9.1.min.js
vendored
Executable file
5
megaproject/static/js/jquery-1.9.1.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
6
megaproject/static/js/jquery-ui-1.10.2.custom.min.js
vendored
Executable file
6
megaproject/static/js/jquery-ui-1.10.2.custom.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
|
|
@ -11,7 +11,59 @@
|
|||
<link href="../../static/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="../../static/css/bootstrap-responsive.min.css" rel="stylesheet">
|
||||
|
||||
{% block header %}{% endblock %}
|
||||
{% block header %}
|
||||
<style type="text/css">
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
/* The html and body elements cannot have any padding or margin. */
|
||||
}
|
||||
|
||||
/* Wrapper for page content to push down footer */
|
||||
#wrap {
|
||||
min-height: 100%;
|
||||
height: auto !important;
|
||||
height: 100%;
|
||||
/* Negative indent footer by it's height */
|
||||
margin: 0 auto -60px;
|
||||
}
|
||||
|
||||
/* Set the fixed height of the footer here */
|
||||
#push,
|
||||
#footer {
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
#footer {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
/* Lastly, apply responsive CSS fixes as necessary */
|
||||
@media (max-width: 767px) {
|
||||
#footer {
|
||||
margin-left: -20px;
|
||||
margin-right: -20px;
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Custom page CSS
|
||||
-------------------------------------------------- */
|
||||
/* Not required for template or sticky footer method. */
|
||||
|
||||
.container {
|
||||
width: auto;
|
||||
max-width: 680px;
|
||||
}
|
||||
|
||||
.container .credit {
|
||||
margin: 20px 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
{% block css_base %}{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
|
||||
<!--[if lt IE 9]>
|
||||
|
|
@ -34,7 +86,19 @@
|
|||
================================================== -->
|
||||
<!-- Placed at the end of the document so the pages load faster -->
|
||||
<script src="http://code.jquery.com/jquery.js"></script>
|
||||
<script src="../../static/js/bootstrap.min.js"></script>
|
||||
<script src="../../static/js/bootstrap.js"></script>
|
||||
|
||||
{% block footer %}
|
||||
{% block footer_content %}{% endblock %}
|
||||
|
||||
<div id="footer">
|
||||
<div class="container">
|
||||
<p class="muted credit">
|
||||
© megaproject
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
|
||||
}
|
||||
</style>
|
||||
{% block css %}{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
|
|
|
|||
112
megaproject/templates/base/base_with_nav_responsive.html
Normal file
112
megaproject/templates/base/base_with_nav_responsive.html
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
{% extends "base/base.html" %}
|
||||
|
||||
{% block css_base %}
|
||||
<style>
|
||||
.navbar .square {
|
||||
-webkit-border-radius: 0;
|
||||
-moz-border-radius: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
</style>
|
||||
{% block css %}{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="navbar navbar-inverse">
|
||||
<div class="navbar-inner square">
|
||||
<div class="container-fluid">
|
||||
<a class="btn btn-navbar" data-toggle="collapse" data-target=".navbar-responsive-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</a>
|
||||
<a class="brand" href="#">mega<span style="color: #f5f5f5">project</span></a>
|
||||
|
||||
<div class="nav-collapse collapse navbar-responsive-collapse">
|
||||
<ul class="nav">
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#">Action</a></li>
|
||||
<li><a href="#">Another action</a></li>
|
||||
<li><a href="#">Something else here</a></li>
|
||||
<li class="divider"></li>
|
||||
<li class="nav-header">Nav header</li>
|
||||
<li><a href="#">Separated link</a></li>
|
||||
<li><a href="#">One more separated link</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="navbar-search pull-left" action="">
|
||||
<input type="text" class="typeahead search-query span2" id="typeahead" placeholder="Search">
|
||||
</form>
|
||||
<ul class="nav pull-right">
|
||||
<li><a href="#">Link</a></li>
|
||||
<li class="divider-vertical"></li>
|
||||
{% if g.user.is_authenticated() %}
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
{{ user.nickname }}
|
||||
<b class="caret"></b>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#">Profile</a></li>
|
||||
<li class="divider"></li>
|
||||
<li class="nav-header">Actions</li>
|
||||
<li><a href="{{ url_for('logout') }}">Logout</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- /.nav-collapse -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /navbar-inner -->
|
||||
</div>
|
||||
|
||||
<div id="wrap">
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="row-fluid">
|
||||
|
||||
<div class="span9">
|
||||
{% include "flashes.html" %}
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
|
||||
<div class="span3">
|
||||
{% block content_side %}{% endblock %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="push"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block footer_content %}
|
||||
{% block scripts %}{% endblock %}
|
||||
|
||||
<script type="text/javascript">
|
||||
$('#typeahead').typeahead({
|
||||
source: function (query, process) {
|
||||
$.post(
|
||||
'/typeahead',
|
||||
{
|
||||
data: query
|
||||
},
|
||||
function (data) {
|
||||
process(data.options);
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
|
|
@ -1,39 +1,37 @@
|
|||
{% extends "base/base_with_nav.html" %}
|
||||
{% block content %}
|
||||
<h1>Create Project</h1>
|
||||
{% from "macros.html" import alert, field, input, date %}
|
||||
|
||||
<form action="" method="post" name="create-project">
|
||||
{{ form.hidden_tag() }}
|
||||
|
||||
<input type="text" class="input-block-level"
|
||||
placeholder="Project Name"
|
||||
id="{{ form.project_name.id }}"
|
||||
name="{{ form.project_name.id }}">
|
||||
|
||||
<input type="text" class="input-block-level"
|
||||
placeholder="Start Date"
|
||||
id="{{ form.start_date.id }}"
|
||||
name="{{ form.start_date.id }}">
|
||||
|
||||
<input type="text" class="input-block-level"
|
||||
placeholder="End Date"
|
||||
id="{{ form.end_date.id }}"
|
||||
name="{{ form.end_date.id }}">
|
||||
|
||||
<input type="text" class="input-block-level"
|
||||
placeholder="Info"
|
||||
id="{{ form.info.id }}"
|
||||
name="{{ form.info.id }}">
|
||||
|
||||
<input type="text" class="input-block-level"
|
||||
placeholder="Team"
|
||||
id="{{ form.team.id }}"
|
||||
name="{{ form.team.id }}">
|
||||
|
||||
{% for error in form.errors %}
|
||||
<span class="help-inline">{{ error }}</span>
|
||||
{% endfor %}
|
||||
|
||||
<button class="btn btn-large btn-primary" type="submit">Create</button>
|
||||
</form>
|
||||
{% block css %}
|
||||
<link rel="stylesheet" href="../static/css/datepicker.css" media="screen"/>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="span8">
|
||||
<form class="form-horizontal" action="" method="post" name="create-project">
|
||||
<fieldset>
|
||||
<legend>Create Project</legend>
|
||||
|
||||
{{ field(form.name) }}
|
||||
{{ field(form.info) }}
|
||||
{{ date(form.start_date) }}
|
||||
{{ date(form.end_date) }}
|
||||
{{ field(form.team) }}
|
||||
|
||||
<div class="form-actions">
|
||||
{{ form.hidden_tag() }}
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
<a href="#" class="btn">Cancel</a>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<script type="text/javascript" src="../static/js/bootstrap-datepicker.js"></script>
|
||||
<script type="text/javascript">
|
||||
$('.datepicker').datepicker()
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
|
|||
10
megaproject/templates/flashes.html
Normal file
10
megaproject/templates/flashes.html
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{% with messages = get_flashed_messages() %}
|
||||
{% if messages %}
|
||||
{% for message in messages %}
|
||||
<div class="alert alert-info">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
{{ message }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
|
@ -1 +1,144 @@
|
|||
{% extends "base/base_with_nav.html" %}
|
||||
{% extends "base/base_with_nav_responsive.html" %}
|
||||
{% from "macros.html" import alert, field, input, date %}
|
||||
|
||||
{% block css %}
|
||||
<style type="text/css">
|
||||
body {
|
||||
padding-bottom: 60px;
|
||||
}
|
||||
|
||||
/* Custom container */
|
||||
.container {
|
||||
margin: 0 auto;
|
||||
max-width: 1000px;
|
||||
}
|
||||
|
||||
.container > hr {
|
||||
margin: 60px 0;
|
||||
}
|
||||
|
||||
/* Customize the navbar links to be fill the entire space of the .navbar */
|
||||
.navbar .navbar-inner {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.navbar .navbar-justified .nav {
|
||||
margin: 0;
|
||||
display: table;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.navbar .navbar-justified .nav li {
|
||||
display: table-cell;
|
||||
width: 1%;
|
||||
float: none;
|
||||
}
|
||||
|
||||
.navbar .navbar-justified .nav li a {
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
border-left: 1px solid rgba(255, 255, 255, .75);
|
||||
border-right: 1px solid rgba(0, 0, 0, .1);
|
||||
}
|
||||
|
||||
.navbar .navbar-justified .nav li:first-child a {
|
||||
border-left: 0;
|
||||
border-radius: 3px 0 0 3px;
|
||||
}
|
||||
|
||||
.navbar .navbar-justified .nav li:last-child a {
|
||||
border-right: 0;
|
||||
border-radius: 0 3px 3px 0;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="navbar tabbable">
|
||||
<div class="navbar-inner navbar-justified">
|
||||
|
||||
<!-- .btn-navbar is used as the toggle for collapsed navbar content -->
|
||||
<a class="btn btn-navbar" data-toggle="collapse" data-target="#justified-nav-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</a>
|
||||
|
||||
<div id="justified-nav-collapse" class="nav-collapse collapse">
|
||||
<ul id="justified-nav" class="nav">
|
||||
<li class="active"><a href="#overview" data-toggle="tab">Overview</a></li>
|
||||
<li><a href="#todo" data-toggle="tab">To-Do</a></li>
|
||||
<li><a href="#team" data-toggle="tab">Team Members</a></li>
|
||||
<li><a href="#settings" data-toggle="tab">Settings</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.navbar -->
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="overview">Loading...</div>
|
||||
<div class="tab-pane" id="todo">Loading...</div>
|
||||
<div class="tab-pane" id="team">Loading...</div>
|
||||
<div class="tab-pane" id="settings">Loading...</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# <div class="span8">#}
|
||||
{# <form class="form-horizontal" action="" method="post" name="create-task">#}
|
||||
{# <fieldset>#}
|
||||
{# <legend>Create Task</legend>#}
|
||||
{##}
|
||||
{# {{ field(form.name) }}#}
|
||||
{# {{ field(form.info) }}#}
|
||||
{# {{ date(form.start_date) }}#}
|
||||
{# {{ date(form.end_date) }}#}
|
||||
{# {{ field(form.team) }}#}
|
||||
{##}
|
||||
{# <div class="form-actions">#}
|
||||
{# {{ form.hidden_tag() }}#}
|
||||
{# <button type="submit" class="btn btn-primary">Submit</button>#}
|
||||
{# <a href="#" class="btn">Cancel</a>#}
|
||||
{# </div>#}
|
||||
{# </fieldset>#}
|
||||
{# </form>#}
|
||||
{# </div>#}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block content_side %}
|
||||
<div class="thumbnail">
|
||||
<div class="caption">
|
||||
<h3>Thumbnail label</h3>
|
||||
|
||||
<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus.
|
||||
Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
|
||||
|
||||
<p><a href="#" class="btn btn-primary">Action</a> <a href="#" class="btn">Action</a></p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var baseURL = '/';
|
||||
//load content for first tab and initialize
|
||||
$('#overview').load(baseURL + 'overview', function () {
|
||||
$('#justified-nav').tab(); //initialize tabs
|
||||
});
|
||||
$('#justified-nav').bind('show', function (e) {
|
||||
var pattern = /#.+/gi //use regex to get anchor(==selector)
|
||||
var contentID = e.target.toString().match(pattern)[0]; //get anchor
|
||||
//load content for selected tab
|
||||
$(contentID).load(baseURL + contentID.replace('#', ''), function () {
|
||||
$('#justified-nav').tab(); //reinitialize tabs
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
}
|
||||
|
||||
.form-signin {
|
||||
max-width: 400px;
|
||||
max-width: 700px;
|
||||
padding: 19px 29px 29px;
|
||||
margin: 0 auto 20px;
|
||||
background-color: #fff;
|
||||
|
|
@ -39,40 +39,43 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
|
||||
<form class="form-signin" action="" method="post" name="login">
|
||||
<h2 class="form-signin-heading">Please sign in</h2>
|
||||
{{ form.hidden_tag() }}
|
||||
|
||||
{% if form.errors.openid %}
|
||||
<div class="control-group error">
|
||||
<div class="controls">
|
||||
<input type="text" class="input-block-level"
|
||||
placeholder="OpenID"
|
||||
id="{{ form.openid.id }}"
|
||||
name="{{ form.openid.name }}">
|
||||
{% for error in form.errors.openid %}
|
||||
<span class="help-inline">{{ error }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% include "flashes.html" %}
|
||||
|
||||
<div class="help-block">Click on your OpenID provider below:</div>
|
||||
<div class="control-group">
|
||||
{% for pr in providers %}
|
||||
<a href="javascript:set_openid('{{ pr.url }}', '{{ pr.name }}');"><img
|
||||
src="/static/img/{{ pr.name.lower() }}.png" class="img-polaroid" style="margin:2px;"/></a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="control-group{% if form.errors.openid %} error{% endif %}">
|
||||
<label class="control-label" for="openid">Or enter your OpenID here:</label>
|
||||
|
||||
<div class="controls">
|
||||
{{ form.openid(size = 80, class = "span4") }}
|
||||
{% for error in form.errors.openid %}
|
||||
<span class="help-inline">[{{ error }}]</span><br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<input type="text" class="input-block-level"
|
||||
placeholder="OpenID"
|
||||
id="{{ form.openid.id }}"
|
||||
name="{{ form.openid.name }}">
|
||||
{% endif %}
|
||||
|
||||
{% for pr in providers %}
|
||||
<a href="javascript:set_openid('{{ pr.url }}', '{{ pr.name }}');">{{ pr.name }}</a> |
|
||||
{% endfor %}
|
||||
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" value="remember-me"
|
||||
id="{{ form.remember_me.id }}"
|
||||
name="{{ form.remember_me.name }}">
|
||||
Remember me
|
||||
</label>
|
||||
<button class="btn btn-large btn-primary" type="submit">Sign in</button>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="checkbox" for="remember_me">
|
||||
{{ form.remember_me }} Remember Me
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<input class="btn btn-primary" type="submit" value="Sign In">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
|
@ -85,6 +88,9 @@
|
|||
}
|
||||
form = document.forms['login'];
|
||||
form.elements['openid'].value = openid
|
||||
form.submit()
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
|
|
|||
98
megaproject/templates/macros.html
Normal file
98
megaproject/templates/macros.html
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
{% macro alert(content, type=None, alert_header=None, close_button=True) -%}
|
||||
{# type can be success, error (or danger), info. Defaults to a warning style. #}
|
||||
<div class="alert
|
||||
{%- if alert_header %} alert-block{% endif -%}
|
||||
{%- if type %} alert-{{ type }}{% endif -%}
|
||||
{%- if close_button %} fade in{% endif %}">
|
||||
{% if close_button -%}
|
||||
<a class="close" data-dismiss="alert">×</a>
|
||||
{%- endif %}
|
||||
{% if alert_header -%}
|
||||
<h4 class="alert-heading">{{ alert_header|safe }}</h4>
|
||||
{%- endif %}
|
||||
|
||||
{{ content|safe }}
|
||||
|
||||
</div>
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro label(content, type='warning') -%}
|
||||
<span class="label label-{{ type }}">{{ content|safe }}</span>
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro non_field_errors(form) %}
|
||||
{% if form.non_field_errors %}
|
||||
{% for error in form.non_field_errors() %}
|
||||
{{ alert(content=error, type='error', close_button=False) }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro label(field) -%}
|
||||
<label class="control-label"{% if field.auto_id %} for="{{ field.auto_id|safe }}"{% endif %}>{{ field.label|safe }}</label>
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro input(field, prepend_content=None, append_content=None) -%}
|
||||
{# Helper macro for rendering the input itself #}
|
||||
|
||||
{% if prepend_content %}
|
||||
<div class="input-prepend">
|
||||
{% elif append_content %}
|
||||
<div class="input-append">
|
||||
{% endif %}
|
||||
{%- if prepend_content -%}
|
||||
<span class="add-on">{{ prepend_content }}</span>
|
||||
{%- endif -%}
|
||||
|
||||
{{ field|safe }}
|
||||
|
||||
{%- if append_content -%}
|
||||
<span class="add-on">{{ append_content }}</span>
|
||||
{%- endif -%}
|
||||
|
||||
{% if field.errors %}
|
||||
<span class="help-inline">{{ field.errors|join(' ')|safe }}</span>
|
||||
{% endif %}
|
||||
|
||||
{% if append_content or prepend_content %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro field(field, classes=None, prepend_content=None, append_content=None, hide_label=False, inline=False) -%}
|
||||
{% if field.is_hidden %}
|
||||
{{ field|safe }}
|
||||
{% else %}
|
||||
<div class="control-group{% if field.errors %} error{% endif -%}{%- if classes %} {{ classes }}{% endif %}">
|
||||
{% if not hide_label %}
|
||||
{{ label(field) }}
|
||||
{% endif %}
|
||||
<div class="controls">
|
||||
|
||||
{{ input(field, prepend_content, append_content) }}
|
||||
|
||||
{% if field.description %}
|
||||
<p class="help-block">{{ field.description|safe }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro date(field) %}
|
||||
<div class="control-group{% if field.errors %} error{% endif -%}{%- if classes %} {{ classes }}{% endif %}">
|
||||
{{ label(field) }}
|
||||
<div class="controls">
|
||||
<div class="input-append date datepicker"
|
||||
data-date="12-02-2012"
|
||||
data-date-format="dd-mm-yyyy">
|
||||
<input class="span" size="16" type="date" value="12-02-2012" id="{{ field.id }}"
|
||||
name="{{ field.id }}">
|
||||
<span class="add-on"><i class="icon-th"></i></span>
|
||||
</div>
|
||||
{% if field.errors %}
|
||||
<span class="help-inline">{{ field.errors|join(' ')|safe }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
97
megaproject/templates/views/gantt.html
Normal file
97
megaproject/templates/views/gantt.html
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
{% block content %}
|
||||
|
||||
<style type="text/css">
|
||||
.show-grid {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.show-grid [class*="span"] {
|
||||
background-color: #d9edf7;
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
min-height: 40px;
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
.show-grid [class*="span"]:hover {
|
||||
background-color: #ddd;
|
||||
}
|
||||
|
||||
.show-grid .show-grid {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.show-grid .show-grid [class*="span"] {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.show-grid [class*="span"] [class*="span"] {
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
.show-grid [class*="span"] [class*="span"] [class*="span"] {
|
||||
background-color: #999;
|
||||
}
|
||||
|
||||
.gantt-container {
|
||||
border: 1px solid #eee;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.gantt-container blockquote {
|
||||
margin: 0;
|
||||
padding: 10px 10px 10px 15px
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="gantt">
|
||||
|
||||
<div class="gantt-container">
|
||||
|
||||
<div class="row-fluid show-grid">
|
||||
<div class="span4">
|
||||
<blockquote>
|
||||
<p>Buy bricks</p>
|
||||
<small>james</small>
|
||||
</blockquote>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /row -->
|
||||
<div class="row-fluid show-grid">
|
||||
<div class="span3 offset3">
|
||||
<blockquote>
|
||||
<p>Buy cement</p>
|
||||
<small>justin</small>
|
||||
</blockquote>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /row -->
|
||||
<div class="row-fluid show-grid">
|
||||
<div class="span6 offset5">
|
||||
<blockquote>
|
||||
<p>Build house</p>
|
||||
<small>james</small>
|
||||
</blockquote>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /row -->
|
||||
<div class="row-fluid show-grid">
|
||||
<div class="span2 offset10">
|
||||
<blockquote>
|
||||
<p>Sell house</p>
|
||||
<small>justin</small>
|
||||
</blockquote>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /row -->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
123
megaproject/templates/views/selectable.html
Executable file
123
megaproject/templates/views/selectable.html
Executable file
|
|
@ -0,0 +1,123 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link href='../../static/css/fullcalendar.css' rel='stylesheet'/>
|
||||
<link href='../../static/css/fullcalendar.print.css' rel='stylesheet' media='print'/>
|
||||
<script src='../../static/js/jquery-1.9.1.min.js'></script>
|
||||
<script src='../../static/js/jquery-ui-1.10.2.custom.min.js'></script>
|
||||
<script src='../../static/js/fullcalendar.min.js'></script>
|
||||
<script>
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
var date = new Date();
|
||||
var d = date.getDate();
|
||||
var m = date.getMonth();
|
||||
var y = date.getFullYear();
|
||||
|
||||
var calendar = $('#calendar').fullCalendar({
|
||||
header: {
|
||||
left: 'prev,next today',
|
||||
center: 'title',
|
||||
right: 'month,agendaWeek,agendaDay'
|
||||
},
|
||||
selectable: true,
|
||||
selectHelper: true,
|
||||
select: function (start, end, allDay) {
|
||||
var title = prompt('Event Title:');
|
||||
if (title) {
|
||||
calendar.fullCalendar('renderEvent',
|
||||
{
|
||||
title: title,
|
||||
start: start,
|
||||
end: end,
|
||||
allDay: allDay
|
||||
},
|
||||
true // make the event "stick"
|
||||
);
|
||||
}
|
||||
calendar.fullCalendar('unselect');
|
||||
},
|
||||
editable: true,
|
||||
events: 'http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic',
|
||||
|
||||
eventClick: function (event) {
|
||||
// opens events in a popup window
|
||||
window.open(event.url, 'gcalevent', 'width=700,height=600');
|
||||
return false;
|
||||
},
|
||||
|
||||
loading: function (bool) {
|
||||
if (bool) {
|
||||
$('#loading').show();
|
||||
} else {
|
||||
$('#loading').hide();
|
||||
}
|
||||
},
|
||||
|
||||
events: [
|
||||
{
|
||||
title: 'All Day Event',
|
||||
start: new Date(y, m, 1)
|
||||
},
|
||||
{
|
||||
title: 'Long Event',
|
||||
start: new Date(y, m, d - 5),
|
||||
end: new Date(y, m, d - 2)
|
||||
},
|
||||
{
|
||||
id: 999,
|
||||
title: 'Repeating Event',
|
||||
start: new Date(y, m, d - 3, 16, 0),
|
||||
allDay: false
|
||||
},
|
||||
{
|
||||
id: 999,
|
||||
title: 'Repeating Event',
|
||||
start: new Date(y, m, d + 4, 16, 0),
|
||||
allDay: false
|
||||
},
|
||||
{
|
||||
title: 'Meeting',
|
||||
start: new Date(y, m, d, 10, 30),
|
||||
allDay: false
|
||||
},
|
||||
{
|
||||
title: 'Lunch',
|
||||
start: new Date(y, m, d, 12, 0),
|
||||
end: new Date(y, m, d, 14, 0),
|
||||
allDay: false
|
||||
},
|
||||
{
|
||||
title: 'Birthday Party',
|
||||
start: new Date(y, m, d + 1, 19, 0),
|
||||
end: new Date(y, m, d + 1, 22, 30),
|
||||
allDay: false
|
||||
},
|
||||
{
|
||||
title: 'Click for Google',
|
||||
start: new Date(y, m, 28),
|
||||
end: new Date(y, m, 29),
|
||||
url: 'http://google.com/'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
<style>
|
||||
|
||||
#calendar {
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id='calendar'></div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,17 +1,23 @@
|
|||
from flask import render_template, flash, redirect, session, url_for, g, request
|
||||
from flask import render_template, flash, redirect, session, url_for, g, request, jsonify
|
||||
from flask.ext.login import login_user, current_user, login_required, logout_user
|
||||
from megaproject import app, lm, oid, db
|
||||
from forms import LoginForm, CreateProjectForm
|
||||
from forms import LoginForm, CreateProjectForm, CreateTaskForm
|
||||
|
||||
from models import User, ROLE_USER
|
||||
from models import User, ROLE_USER, Project
|
||||
|
||||
|
||||
@app.route('/')
|
||||
@app.route('/index')
|
||||
@login_required
|
||||
def index():
|
||||
flash("test flash")
|
||||
user = g.user
|
||||
return render_template('index.html', title='Index', user=user)
|
||||
projects = Project.query.all()
|
||||
meta = db.metadata.tables.keys()
|
||||
|
||||
form = CreateTaskForm()
|
||||
|
||||
return render_template('index.html', title='Index', user=user, projects=projects, meta=meta, form=form)
|
||||
|
||||
|
||||
@lm.user_loader
|
||||
|
|
@ -57,6 +63,7 @@ def after_login(resp):
|
|||
remember_me = session['remember_me']
|
||||
session.pop('remember_me', None)
|
||||
login_user(user, remember=remember_me)
|
||||
|
||||
return redirect(request.args.get('next') or url_for('index'))
|
||||
|
||||
|
||||
|
|
@ -73,8 +80,57 @@ def create_project():
|
|||
form = CreateProjectForm()
|
||||
|
||||
if form.validate_on_submit():
|
||||
return 'ok'
|
||||
for project in Project.query.all():
|
||||
if project.name == form.name.data:
|
||||
flash('project already exists')
|
||||
return redirect(url_for('create_project'))
|
||||
app.logger.debug('form.validate_on_submit')
|
||||
project = Project(name=form.name.data,
|
||||
start_date=form.start_date.data,
|
||||
end_date=form.end_date.data,
|
||||
info=form.info.data)
|
||||
print 'team: ' + form.team.data
|
||||
db.session.add(project)
|
||||
db.session.commit()
|
||||
flash('created project %s' % form.name.data)
|
||||
return redirect(url_for('index'))
|
||||
|
||||
return render_template('create_project.html', title='Create Project', user=user, form=form)
|
||||
|
||||
|
||||
@app.route('/create-task', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
def create_task():
|
||||
user = g.user
|
||||
|
||||
|
||||
@app.route('/overview', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
def overview():
|
||||
return render_template('views/selectable.html')
|
||||
|
||||
|
||||
@app.route('/todo', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
def todo():
|
||||
return "todo"
|
||||
|
||||
|
||||
@app.route('/team', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
def team():
|
||||
return "team"
|
||||
|
||||
|
||||
@app.route('/settings', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
def settings():
|
||||
return "settings"
|
||||
|
||||
|
||||
@app.route('/typeahead', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
def typeahead():
|
||||
response = jsonify(options=['red', 'blue', 'green', 'yellow'])
|
||||
return response
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue