Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make schedule compatible with Django 1.4 #47

Open
wants to merge 51 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
68a3613
Added optional weekcal js view (read-only for now)
bartekgorny Oct 13, 2009
d997c5a
something works - editing occurrences through dialogs
bartekgorny Oct 15, 2009
efe8bbc
bugfix - wrong dates
bartekgorny Oct 19, 2009
4e7dba5
externalized generic js into library
bartekgorny Oct 19, 2009
374eadb
pass weekcal parameters in a civilised way
bartekgorny Oct 19, 2009
5a01ff8
impl. drag and resize
bartekgorny Oct 19, 2009
fa050f7
fixed a problem of current week's boxes rendered twice
bartekgorny Oct 19, 2009
c471d4e
code formatting and cleanup
bartekgorny Oct 20, 2009
7bad7f1
added view dialog for read-only events
bartekgorny Oct 20, 2009
87bed5b
deleting (cancelling) occurrences
bartekgorny Oct 20, 2009
5eacf57
err... forgot to classify occurrences...
bartekgorny Oct 20, 2009
adfb07e
pass info about recurrence and persistence to UI
bartekgorny Oct 20, 2009
88a5cee
show which events are parts of recurrence chain
bartekgorny Oct 20, 2009
5472140
we have to return the new object so that we update its id and persist…
bartekgorny Oct 21, 2009
5739754
creating simple non-recurring events
bartekgorny Oct 21, 2009
43c92e0
improved error handling and communication (JSON only)
bartekgorny Oct 21, 2009
2b25779
deleting a non-recurring event
bartekgorny Oct 21, 2009
d72860f
bugfix; also saving event when non-recurring
bartekgorny Oct 21, 2009
38b09f5
blocked event creation for anonymous users
bartekgorny Oct 22, 2009
bbf5601
fixed url name
bartekgorny Oct 22, 2009
220c00a
half-way to editing recurring events and their occurrences
bartekgorny Oct 22, 2009
16bc218
refresh all after deleting an event (it could be recurring)
bartekgorny Oct 23, 2009
d82abbe
cleanup and todo
bartekgorny Oct 23, 2009
e1bb5ea
getting events for editing by separate method
bartekgorny Oct 27, 2009
58a374a
support for event start and end_recurring_date (with datepicker)
bartekgorny Oct 27, 2009
bc5b46e
removed unused dialogs
bartekgorny Oct 27, 2009
884a761
removed unused arg
bartekgorny Oct 28, 2009
08aeb64
bugfix - options were getting longer every time a dialog was open
bartekgorny Oct 28, 2009
ed27a20
bugfix - for some reason the standard jquery find failed on the first…
bartekgorny Oct 28, 2009
670dff0
no dialog for read-only events
bartekgorny Nov 3, 2009
572416a
escape linebreak in description
bartekgorny Nov 3, 2009
3ed7ab3
moved styling to css file; improved marking of recurring events;
bartekgorny Nov 3, 2009
ee0ccf0
cleanup (use simple inclusion instead of those ugly hacks)
bartekgorny Nov 3, 2009
8c451fd
moved weekcal configuration to a separate script
bartekgorny Nov 3, 2009
7ccea4f
Merge branch 'master' into ajax_ui
bartekgorny Nov 7, 2009
84d77c5
Merge branch 'master' into ajax_ui
bartekgorny Nov 7, 2009
e765f8d
bugfix - 'None' broke json parser
bartekgorny Nov 7, 2009
67473c8
hide dialog templates
bartekgorny Nov 7, 2009
6534cc2
fixed bugs in setting start/end time; simplified the code a bit to ma…
bartekgorny Nov 7, 2009
d23dc04
moved weekcal configuration to a separate script (missing hunks)
bartekgorny Nov 12, 2009
ee98da4
Merge branch 'ajax_ui' of [email protected]:thauber/django-schedule into…
bartekgorny Nov 12, 2009
0b682ca
removed debugging func - firebug console does the job much better
bartekgorny Nov 12, 2009
4c9c0ba
fixed bug in event serialization (end_recurring_date would not show up)
bartekgorny Nov 12, 2009
98b0455
fixed a tricky bug (a deprecated feature in javascript - parseInt tre…
bartekgorny Nov 12, 2009
e25290c
Fixed handling of start date in event creation
bartekgorny Nov 12, 2009
2ab9294
some things have been done
bartekgorny Dec 9, 2009
36823a9
conf folder not present in MANIFEST.Inserted the entry for the conf f…
Mar 28, 2012
b272d2c
Make it Django 1.4 compatible
Natim Apr 20, 2012
d641155
Move fixtures directory so tests can find it
Natim Apr 20, 2012
7b90923
Make get_object compliant with django.contrib.syndication.Feed
Natim Apr 20, 2012
265b5a3
Merge kabirkukreti patch
Natim Apr 20, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
recursive-include docs *
recursive-include schedule/templates *
recursive-include schedule/conf *
recursive-include schedule/models/fixtures *.json
recursive-include project_sample *
9 changes: 9 additions & 0 deletions TODO.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
TODO list for ajax_ui branch - weekcalendar:

* cleanup in weekcal.js - lots of copy-and-paste programming there, and handling of dates is awful
* mouseover preview of an event (?)
* make variable naming in weekcal.js consistent (event vs occurrence)

A big question mark:

* support for multi-day events (???)
108 changes: 85 additions & 23 deletions project_sample/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@

MANAGERS = ADMINS

DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = 'project_sample.db' # Or path to database file if using sqlite3.
DATABASE_USER = '' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3.
DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'project_sample.db', # Or path to database file if using sqlite3.
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
}

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
Expand Down Expand Up @@ -45,34 +49,59 @@
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = '/site_media/'

# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
ADMIN_MEDIA_PREFIX = '/media/'
# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = ''

# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)

# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)

# Make this unique, and don't share it with anybody.
SECRET_KEY = '+3^08&lnsm^nl1iozv=a-9!e4x$*o%g6pkx=y$)oc8#r$ndn7t'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
# 'django.template.loaders.eggs.load_template_source',
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)

MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'project_sample.urls'

# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'project_sample.wsgi.application'

TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
# uncomment this to use ajax week view
os.path.join(PROJECT_DIR,"schedule_weekcal/templates"),
os.path.join(PROJECT_DIR,"templates"),
)

Expand All @@ -86,12 +115,45 @@
'schedule',
)

# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error when DEBUG=False.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
}
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
}
}


TEMPLATE_CONTEXT_PROCESSORS = (
"django.core.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.request",
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
'django.core.context_processors.media',
'django.core.context_processors.static',
'django.core.context_processors.tz',
'django.contrib.messages.context_processors.messages',
'django.core.context_processors.request',
)

FIRST_DAY_OF_WEEK = 1 # Monday
191 changes: 191 additions & 0 deletions project_sample/site_media/css/jquery.weekcalendar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@


.week-calendar {
font-size: 14px;
font-family: arial, helvetica;
}

.week-calendar .calendar-nav {
padding: 1em;
text-align: right;
}

.week-calendar .calendar-nav button {
margin: 0 0.5em;
}


.week-calendar table {
border-collapse: collapse;
border-spacing: 0;
}
.week-calendar table td {
margin: 0;
padding: 0;
}

.week-calendar-header {
background: #eee;
border-top: 1px solid #aaa;
border-bottom: 1px solid #aaa;
width: 100%;
}

.week-calendar-header .time-column-header {
width: 5%;
}

.week-calendar-header .scrollbar-shim {
width: 16px;
}

.week-calendar-header .day-column-header {
text-align: center;
padding: 0.4em;
}
.week-calendar-header td {
background-color: #eee;
}

.grid-timeslot-header {
width: 6%;
background: #eee;
}



.calendar-scrollable-grid {
overflow: auto;
overflow-x: hidden !important;
overflow-y: auto !important;
position: relative;
background-color: #fff;
width: 100%;
}


table.week-calendar-time-slots {
width: 100%;
table-layout: fixed;
cursor: default;
}

.week-calendar-time-slots .day-column {
width: 13.5%;
border-left: 1px solid #ddd;
overflow: visible;
vertical-align: top;
}

.week-calendar-time-slots .day-column-inner {
width: 100%;
position:relative;
}

.time-slot-wrapper {
position:relative;
height: 1px;
top: 1px;
}

.time-slots {
position: absolute;
width: 100%;
}


.time-header-cell {
padding: 5px;
height: 80px; /* reference height */
}


.time-slot {
border-bottom: 1px dotted #ddd;
}

.hour-header {
text-align: right;
}

.hour-end, .hour-header {
border-bottom: 1px solid #ccc;
color: #555;
}

.business-hours {
background-color: #E6EEF1;
border-bottom: 1px solid #ccc;
color: #333;
font-size: 1.4em;
}

.business-hours .am-pm {
font-size: 0.6em;
}

.day-header-cell {
text-align: center;
vertical-align: middle;
padding: 5px;
}



.time-slot-header .header-cell {
text-align: right;
padding-right: 10px;
}

.week-calendar-header .today {
font-weight: bold;
}

.week-calendar-time-slots .today {
background-color: #ffffcc;
}


.cal-event {
background-color: #68a1e5;
filter:alpha(opacity=80);
-moz-opacity:0.8;
-khtml-opacity: 0.8;
opacity: 0.8;
position: absolute;
text-align: center;
overflow: hidden;
cursor: pointer;
color: #fff;
width: 100%;
display: none;
}


.cal-event div {
padding: 0 5px;

}

.cal-event .time {
background-color: #2b72d0;
border: 1px solid #1b62c0;
color: #fff;
padding: 0;
font-weight: bold;
}

.ui-draggable .time {
cursor: move;
}

.cal-event .title {
position: relative;
}

.ui-resizable-s {
height: 10px;
bottom: -8px;
}


16 changes: 16 additions & 0 deletions project_sample/site_media/css/schedule_weekcalendar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

table.week-calendar-time-slots div.pastEvent {
background-color:#aaa;
}

table.week-calendar-time-slots div.pastEvent .time {
background-color:#999;
border:1px solid #888;
}

table.week-calendar-time-slots div.partOfChain .time {
border-left:7px solid black !important;
border-right:7px solid black !important;
color:black;

}
Loading