-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
15,385 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ db.sqlite3 | |
/gagawag/media | ||
/gagawag/static | ||
/gagawag/gagawag/settings/local.py | ||
_dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line. | ||
SPHINXOPTS = | ||
SPHINXBUILD = sphinx-build | ||
SPHINXPROJ = WagtailCalendar | ||
SOURCEDIR = . | ||
BUILDDIR = _build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: 94808024c223b34b95e53e7aca27e59a | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
Customize | ||
========= | ||
|
||
Changing the event data | ||
----------------------- | ||
|
||
You can add a `get_page_event_data` method to your page model to change the data used by the calendar. | ||
The default data are: | ||
|
||
.. code-block:: python | ||
return { | ||
'type': 'page', | ||
'pk': page.pk, | ||
'author': str(page.owner), | ||
'description': page.search_description, # description can be HTML to allow more customization of the popup | ||
} | ||
Adding events | ||
------------- | ||
|
||
There are two wagtail hooks available to add events. `wagtail_calendar_register_events` is used to add events to the calendar. | ||
The properties of the events are the one from `fullcalendar <https://fullcalendar.io/docs/event_data/Event_Object/>`_. | ||
The hook take the request, a start date, a end date and a list of events already in the calendar. | ||
You must return the whole list of events which will appear in the calendar. | ||
|
||
.. code-block:: python | ||
@hooks.register('wagtail_calendar_register_events') | ||
def my_events(request, start, end, events): | ||
if start is not None: | ||
start = parse_datetime(start) | ||
if end is not None: | ||
end = parse_datetime(end) | ||
my_events = [] | ||
for event in MyEvent.objects.filter(start__gte=start, end__lte=end): | ||
my_events.append({ | ||
'id': event.pk, | ||
'title': event.title, | ||
'start': event.start.isoformat(), | ||
'end': event.end.isoformat(), | ||
'url': event.get_absolute_url(), | ||
'editable': False, | ||
'color': '#ff0000', | ||
}) | ||
return events + my_events | ||
`wagtail_calendar_register_side_events` is used to add events to the sidebar of the calendar. It is used for events which are not planned yet. | ||
The properties of the events are the one from `fullcalendar <https://fullcalendar.io/docs/event_data/Event_Object/>`_. | ||
The hook take the request and a list of events already in the sidebar. | ||
You must return the whole list of events which will appear in the sidebar. | ||
|
||
.. code-block:: python | ||
@hooks.register('wagtail_calendar_register_side_events') | ||
def my_events(request, start, end, events): | ||
my_events = [] | ||
for event in MyEvent.objects.filter(start__isnull=True): | ||
my_events.append({ | ||
'id': event.pk, | ||
'title': event.title, | ||
'url': event.get_absolute_url(), | ||
'editable': True, | ||
'color': '#ff0000', | ||
}) | ||
return events + my_events |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Getting started | ||
=============== | ||
|
||
It is as simple as installing it and adding it to the installed apps: | ||
|
||
.. code-block:: bash | ||
$ pip install wagtail-calendar | ||
.. code-block:: python | ||
INSTALLED_APPS = [ | ||
... | ||
'wagtail_calendar', | ||
... | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.. Wagtail Calendar documentation master file, created by | ||
sphinx-quickstart on Sat Jan 27 10:39:16 2018. | ||
You can adapt this file completely to your liking, but it should at least | ||
contain the root `toctree` directive. | ||
Welcome to Wagtail Calendar's documentation! | ||
============================================ | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Contents: | ||
|
||
getting_started | ||
customize | ||
|
||
|
||
Indices and tables | ||
================== | ||
|
||
* :ref:`genindex` | ||
* :ref:`modindex` | ||
* :ref:`search` |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.