Skip to content
Browse files

Create basic package architecture

  • Loading branch information...
1 parent b624201 commit cb1f1a244af6b2a69bd3490b15e2fa9504c4789a Rémy HUBSCHER committed Sep 22, 2012
Showing with 937 additions and 0 deletions.
  1. +3 −0 .gitignore
  2. +7 −0 AUTHORS.rst
  3. +8 −0 CHANGELOG.rst
  4. +38 −0 INSTALL.rst
  5. +33 −0 LICENSE
  6. +5 −0 MANIFEST.in
  7. +75 −0 Makefile
  8. +1 −0 VERSION
  9. +153 −0 docs/Makefile
  10. 0 docs/_static/.gitkeep
  11. +109 −0 docs/api.rst
  12. +249 −0 docs/conf.py
  13. +18 −0 docs/index.rst
  14. +2 −0 docs/install.rst
  15. +197 −0 docs/themes.rst
  16. +39 −0 setup.py
View
3 .gitignore
@@ -0,0 +1,3 @@
+*.pyc
+*~
+/docs/_build/
View
7 AUTHORS.rst
@@ -0,0 +1,7 @@
+######################
+Authors & contributors
+######################
+
+* Sébastien Barbier <sebastien.barbier@ionyse.com>
+* Rémy Hubscher <remy.hubscher@ionyse.com>
+* Amaury Pernette <amaury.pernette@ionyse.com>
View
8 CHANGELOG.rst
@@ -0,0 +1,8 @@
+Changelog
+=========
+
+0.1 (unreleased)
+----------------
+
+- Initialize the depot
+- Port the draft code to the new depot
View
38 INSTALL.rst
@@ -0,0 +1,38 @@
+===============
+Getting Started
+===============
+
+1. Get the code
+===============
+
+The development version
+-----------------------
+
+To be able to hack on the code::
+
+ $ cd ~/git/
+ $ git clone https://github.com/ionyse/ionyweb.git
+ $ cd ionyweb
+ $ mkvirtualenv ionyweb
+ (ionyweb)$ python setup.py develop
+
+
+To install the last stable version
+----------------------------------
+
+Using pip::
+
+ $ pip install ionyweb
+
+or::
+
+ $ pip install -e git+git://github.com/ionyse/ionyweb.git#egg=ionyweb
+
+2. Starts a new Ionyweb project
+===============================
+
+::
+
+ $ workon ionyweb
+ (ionyweb)$ ionyweb-quickstart <NewProject>
+
View
33 LICENSE
@@ -0,0 +1,33 @@
+#######
+License
+#######
+
+Copyright (c) 2009-2012, Sébastien Barbier
+Copyright (c) 2009-2012, Rémy Hubscher
+Copyright (c) 2009-2012, Amaury Pernette
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+* Neither the name of wardrobe nor the names of its contributors
+ may be used to endorse or promote products derived from this software without
+ specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
View
5 MANIFEST.in
@@ -0,0 +1,5 @@
+recursive-include ionyweb *
+global-exclude *.pyc .*.swp
+include *.txt
+include *.rst
+include AUTHORS CHANGELOG INSTALL LICENSE README VERSION
View
75 Makefile
@@ -0,0 +1,75 @@
+# Makefile for development.
+# See INSTALL and docs/dev.txt for details.
+SHELL = /bin/bash
+PROJECT = 'django-downloadview'
+ROOT_DIR = $(shell pwd)
+DATA_DIR = $(ROOT_DIR)/var
+VIRTUALENV = virtualenv
+VIRTUALENV_DIR = $(ROOT_DIR)/lib/virtualenv
+PIP = $(VIRTUALENV_DIR)/bin/pip
+BUILDOUT = $(ROOT_DIR)/bin/buildout
+BUILDOUT_ARGS = -N
+
+
+virtualenv:
+ if [ ! -x $(PIP) ]; then \
+ if [[ "`$(VIRTUALENV) --version`" < "`echo '1.8'`" ]]; then \
+ $(VIRTUALENV) --no-site-packages --distribute $(VIRTUALENV_DIR); \
+ else \
+ $(VIRTUALENV) $(VIRTUALENV_DIR); \
+ fi; \
+ $(PIP) install -U pip; \
+ fi
+
+
+buildout:
+ # Install zc.buildout.
+ if [ ! -x $(BUILDOUT) ]; then \
+ mkdir -p $(ROOT_DIR)/lib/buildout; \
+ $(PIP) install zc.buildout; \
+ mkdir -p `dirname $(BUILDOUT)`; \
+ ln -s $(VIRTUALENV_DIR)/bin/buildout $(BUILDOUT); \
+ fi
+ # Run zc.buildout.
+ $(BUILDOUT) $(BUILDOUT_ARGS)
+
+
+develop: virtualenv buildout
+
+
+update: develop
+
+
+clean:
+ find $(ROOT_DIR)/ -name "*.pyc" -delete
+ find $(ROOT_DIR)/ -name ".noseids" -delete
+ rm nosetests.xml
+
+
+distclean: clean
+ rm -rf $(ROOT_DIR)/*.egg-info
+
+
+maintainer-clean: distclean
+ rm -rf $(ROOT_DIR)/bin/
+ rm -rf $(ROOT_DIR)/lib/
+
+
+test:
+ bin/demo test demo
+
+
+apidoc:
+ rm -rf docs/api/*
+ bin/sphinx-apidoc --suffix txt --output-dir $(ROOT_DIR)/docs/api django_downloadview
+
+
+sphinx:
+ make --directory=docs clean html doctest
+
+
+documentation: apidoc sphinx
+
+
+release:
+ bin/fullrelease
View
1 VERSION
@@ -0,0 +1 @@
+0.1dev
View
153 docs/Makefile
@@ -0,0 +1,153 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS =
+SPHINXBUILD = sphinx-build
+PAPER =
+BUILDDIR = _build
+
+# Internal variables.
+PAPEROPT_a4 = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
+
+help:
+ @echo "Please use \`make <target>' where <target> is one of"
+ @echo " html to make standalone HTML files"
+ @echo " dirhtml to make HTML files named index.html in directories"
+ @echo " singlehtml to make a single large HTML file"
+ @echo " pickle to make pickle files"
+ @echo " json to make JSON files"
+ @echo " htmlhelp to make HTML files and a HTML help project"
+ @echo " qthelp to make HTML files and a qthelp project"
+ @echo " devhelp to make HTML files and a Devhelp project"
+ @echo " epub to make an epub"
+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+ @echo " latexpdf to make LaTeX files and run them through pdflatex"
+ @echo " text to make text files"
+ @echo " man to make manual pages"
+ @echo " texinfo to make Texinfo files"
+ @echo " info to make Texinfo files and run them through makeinfo"
+ @echo " gettext to make PO message catalogs"
+ @echo " changes to make an overview of all changed/added/deprecated items"
+ @echo " linkcheck to check all external links for integrity"
+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+ -rm -rf $(BUILDDIR)/*
+
+html:
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+ @echo
+ @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+ @echo
+ @echo "Build finished; now you can process the pickle files."
+
+json:
+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+ @echo
+ @echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+ @echo
+ @echo "Build finished; now you can run HTML Help Workshop with the" \
+ ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+ $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+ @echo
+ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
+ ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/django-downloadview.qhcp"
+ @echo "To view the help file:"
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/django-downloadview.qhc"
+
+devhelp:
+ $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+ @echo
+ @echo "Build finished."
+ @echo "To view the help file:"
+ @echo "# mkdir -p $$HOME/.local/share/devhelp/django-downloadview"
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/django-downloadview"
+ @echo "# devhelp"
+
+epub:
+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+ @echo
+ @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo
+ @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+ @echo "Run \`make' in that directory to run these through (pdf)latex" \
+ "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through pdflatex..."
+ $(MAKE) -C $(BUILDDIR)/latex all-pdf
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+ $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+ @echo
+ @echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+ @echo
+ @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+texinfo:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo
+ @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+ @echo "Run \`make' in that directory to run these through makeinfo" \
+ "(use \`make info' here to do that automatically)."
+
+info:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo "Running Texinfo files through makeinfo..."
+ make -C $(BUILDDIR)/texinfo info
+ @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
+
+gettext:
+ $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+ @echo
+ @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+
+changes:
+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+ @echo
+ @echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+ @echo
+ @echo "Link check complete; look for any errors in the above output " \
+ "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+ @echo "Testing of doctests in the sources finished, look at the " \
+ "results in $(BUILDDIR)/doctest/output.txt."
View
0 docs/_static/.gitkeep
No changes.
View
109 docs/api.rst
@@ -0,0 +1,109 @@
+=========
+Admin API
+=========
+
+Describe informations about the admin API.
+
+Status Code Response
+====================
+
+1. **GET** Method :
+
+ * *200 - OK* :
+ The resource has been found and the response contains datas.
+
+ * *400 - Bad Request* :
+ Indicates a bad request (e.g. wrong parameter).
+
+ * *404 - Not Found* :
+ The asked resource does not exist.
+
+2. **PUT** Method :
+ * *200 - OK* :
+ The new resource has been created and the response contains datas.
+
+ * *400 - Bad Request* :
+ Indicates a bad request (e.g. wrong parameter).
+
+3. **POST** Method :
+ * *200 - OK* :
+ The existing resource has been updated the response contains datas.
+
+ * *202 - ACCEPTED* :
+ The existing resource has been updated the page must be reloaded.
+ The json contains the location of the redirection.
+
+ * *400 - Bad Request* :
+ Indicates a bad request (e.g. wrong parameter).
+
+ * *404 - Not Found* :
+ The asked resource for updating does not exist.
+
+4. **DELETE** Method :
+ * *200 - OK* :
+ The existing resource has been deleted.
+
+ * *400 - Bad Request* :
+ Indicates a bad request (e.g. wrong parameter).
+
+ * *404 - Not Found* :
+ The asked resource does not exist.
+
+ * *409 - Conflict* :
+ A BDD conflict has been occured during deletion (e.g. resource is used by another resource).
+
+
+Default Data Response
+---------------------
+
+* **Message** - ``msg`` :
+
+By default, all responses contains the ``msg`` parameter which
+will be displayed in the interface.
+
+The *200* and *400* status displays the message with standard message design
+(``admin.messages.alert()`` method).
+For *404*, *409* and *500* status, the interface displays the message using
+standard error message design (``admin.messages.error()`` method).
+
+* **Content** - ``html`` :
+
+By default, only *200* and *400* response contains the ``html`` parameter.
+
+This parameters contains the new HTML content which will use by the admin to refresh the center panel.
+
+
+Custom actions
+--------------
+
+If you want custom the admin actions for a particular status code, just define a new function for this status
+in your request method.
+
+**Be careful about data object in the response :**
+
+ If the request is successful (*200* and *400* status codes), the status code functions take a ``json``
+ parameter which contains the data returned from the server;
+ if it results in an error (*404*, *409* and *500* status codes) they take ``jqXHRan`` paramater which
+ have to be transformed with ``admin.xhr2json()`` method before to be used.
+
+ See the `jQuery doc <http://api.jquery.com/jQuery.ajax/>`_ for more precisions.
+
+
+For example, sending a POST request and override the *400* and *500* status codes actions::
+
+ admin.POST({
+ url: '/my/custom/url/',
+ data: {'first_data': "Value #1", },
+ statusCode: {
+ 400: function(json) {
+ // Put your actions here...
+ admin.messages.alert('My custom action !!');
+ },
+ 500: function(json) {
+ // Convert jqXHRan object
+ json = admin.xhr2json(json);
+ // Put your actions here...
+ admin.messages.alert(json.myData);
+ }
+ });
+
View
249 docs/conf.py
@@ -0,0 +1,249 @@
+# -*- coding: utf-8 -*-
+#
+# django-downloadview documentation build configuration file, created by
+# sphinx-quickstart on Mon Aug 27 11:37:23 2012.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+
+doc_dir = os.path.dirname(os.path.abspath(__file__))
+project_dir = os.path.dirname(doc_dir)
+version_filename = os.path.join(project_dir, 'VERSION')
+
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.autosummary',
+ 'sphinx.ext.doctest', 'sphinx.ext.coverage']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'django-downloadview'
+copyright = u'2012, Benoît Bryon'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = open(version_filename).read().strip()
+# The full version, including alpha/beta/rc tags.
+release = version
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+language = 'en'
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'django-downloadviewdoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+latex_elements = {
+# The paper size ('letterpaper' or 'a4paper').
+#'papersize': 'letterpaper',
+
+# The font size ('10pt', '11pt' or '12pt').
+#'pointsize': '10pt',
+
+# Additional stuff for the LaTeX preamble.
+#'preamble': '',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+ ('index', 'django-downloadview.tex', u'django-downloadview Documentation',
+ u'Benoît Bryon', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ ('index', 'django-downloadview', u'django-downloadview Documentation',
+ [u'Benoît Bryon'], 1)
+]
+
+# If true, show URL addresses after external links.
+#man_show_urls = False
+
+
+# -- Options for Texinfo output ------------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+# dir menu entry, description, category)
+texinfo_documents = [
+ ('index', 'django-downloadview', u'django-downloadview Documentation',
+ u'Benoît Bryon', 'django-downloadview', 'One line description of project.',
+ 'Miscellaneous'),
+]
+
+# Documents to append as an appendix to all manuals.
+#texinfo_appendices = []
+
+# If false, no module index is generated.
+#texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#texinfo_show_urls = 'footnote'
View
18 docs/index.rst
@@ -0,0 +1,18 @@
+.. ionyweb documentation master file, created by
+ sphinx-quickstart on Sat Sep 22 11:25:23 2012.
+ You can adapt this file completely to your liking, but it should at least
+ contain the root `toctree` directive.
+
+.. include:: ../README.rst
+
+
+********
+Contents
+********
+
+.. toctree::
+ :maxdepth: 2
+
+ install
+ themes.rst
+ api.rst
View
2 docs/install.rst
@@ -0,0 +1,2 @@
+
+.. include:: ../INSTALL.rst
View
197 docs/themes.rst
@@ -0,0 +1,197 @@
+===============================
+Working with Themes and Layouts
+===============================
+
+Some themes and layouts are provided with modulo.
+
+In the code they are on `modulo/contrib`.
+
+In your modulo project, you can also put some local themes and layout.
+
+Don't forget to define the `LAYOUTS_DIR` and `THEMES_DIR` in you settings. ::
+
+ LAYOUTS_DIRS = (
+ os.path.join(ABSOLUTE_PATH, 'layouts'),
+ )
+
+ THEMES_DIRS = (
+ os.path.join(ABSOLUTE_PATH, 'themes'),
+ )
+
+Files tree of a theme
+=====================
+
+On a theme, you must create a `MANIFEST.json`::
+
+ {"title": "Jungle Land",
+ "description": "A stylish warm brown design suitable for environmental community and nature business website.",
+ "author": "styleshout",
+ "website": "http://www.styleshout.com/",
+ "date": "01/09/2009",
+ "preview": ["jungleland.jpg"]
+ }
+
+You can define one or more preview images that will slideshow to present your theme.
+
+Then you must to have a `templates` directory with all your template
+inside. They will be find there by the
+`modulo.loaders.themes_templates.Loader` when you are looking for
+`'themes/jungleland/index.html'`
+
+All the other file outside the `templates` dir are static files and will be collected.
+
+For example::
+
+ themes/
+ └── jungleland
+ ├── css
+ │   ├── ie6.css
+ │   ├── Jungleland.css
+ │   ├── reset.css
+ │   └── screen.css
+ ├── images
+ │   ├── arrow-up.gif
+ │   ├── bg.gif
+ │   ├── bullet.gif
+ │   ├── button-bg.png
+ │   ├── button-hover-bg.png
+ │   ├── clock.gif
+ │   ├── comment.gif
+ │   ├── content-bg.jpg
+ │   ├── email.gif
+ │   ├── feed-icon14.gif
+ │   ├── feed-icon16.gif
+ │   ├── firefox-gray.jpg
+ │   ├── footer-bg.png
+ │   ├── gravatar.jpg
+ │   ├── header-bg.jpg
+ │   ├── header-search.png
+ │   ├── img-featured.jpg
+ │   ├── img-post.jpg
+ │   ├── left-nav-bg.gif
+ │   ├── quote.gif
+ │   ├── ribbon.gif
+ │   ├── ribbon.png
+ │   ├── right-nav-bg.gif
+ │   ├── search.png
+ │   ├── sep-bg.jpg
+ │   ├── thumb-1.jpg
+ │   ├── thumb-2.jpg
+ │   ├── thumb-3.jpg
+ │   ├── thumb-4.jpg
+ │   ├── thumb.jpg
+ │   └── twitter.gif
+ ├── jungleland.jpg
+ ├── MANIFEST.json
+ └── templates
+ ├── archives.html
+ ├── blog.html
+ ├── index.html
+ └── style.html
+
+ 4 directories, 41 files
+
+Files tree of a layout
+======================
+
+The layout works the same way except that there is no MAFIFEST.json or preview.
+
+The layout is defined in the `layout.html` file. Every other file in
+this directory is considered as a staticfiles and may be access with a browser.
+
+You may access them using `/static/layouts/<slug>/file.png`
+
+To access the layout template you can use `layouts/<slug>.html` or even `layouts/<slug>/`.
+
+For example, see the contrib layouts of modulo::
+
+ layouts
+ ├── 100
+ │   ├── layout.css
+ │   └── layout.html
+ │   └── MANIFEST.json
+ │   └── icon-layout.png
+ ├── 100_100
+ │   ├── layout.css
+ │   └── layout.html
+ ├── 100_100_100
+ │   ├── layout.css
+ │   └── layout.html
+ ├── 100_100_100_100
+ │   ├── layout.css
+ │   └── layout.html
+ ├── 100_65-35
+ │   ├── layout.css
+ │   └── layout.html
+ └── 50-50_100
+ ├── layout.css
+ └── layout.html
+
+ 6 directories, 12 files
+
+Each slug of the list represents the structure of the layout.
+The char '_' is a new row and the char '-' represents a column of the current row.
+The values ​​used represent the width of each placeholder, as a percentage of the width of the site.
+
+For example, layout `100_100_100` is a layout of three lines, each containing a placeholder of 100% of the width.
+Similarly, the layout `100_65-35` consists of two lines. The first one contains a placeholder 100% width
+and the second 2 placeholders 65% and 35% of the width.
+
+
+Create customs layouts
+======================
+
+To add your customs layouts, create a new dir in your layouts project dir. The name of the dir will be the slug of the layout.
+
+Now, create a `layout.html` file which contains the structure of the layout, i.e. the number of placeholders you want.
+`Modulo` contains 10 default structures for layouts.
+
+For example, this is the standard `layout.html` file to create a layout with 5 placeholders::
+
+ {% extends "layout/5-placeholders.html" %}
+
+You can use the default structure `x-placeholders.html` file, where `x` is between 1 and 10.
+The rendered template looks like this ::
+
+ {% extends "layout/base.html" %}
+ {% load page_extras %}
+
+ {% block layout %}
+
+ {% render_placeholder "1" %}
+ {% render_placeholder "2" %}
+ {% render_placeholder "3" %}
+ {% render_placeholder "4" %}
+ {% render_placeholder "5" %}
+
+ {% endblock layout %}
+
+You can also define a custom structure file on the same schema.
+You must extend the `layout/base.html` and load the `page_extras` templatetags.
+Then, overlaod the block `layout` with your own code and use the `render_placeholder` tag to define a placeholder area.
+
+
+Then, you MUST create the `layout.css` to design the placeholders.
+
+If your design file is empty, each placeholder will be a 100% line of the layout.
+
+For example, this file discribes a layout with a first line of 2 columns (50%-50%), 1 line of 1 column (100%) and 1 third row with 2 placeholders (65%-35%)::
+
+ #placeholder-1 { width: 49%; float: left; }
+ #placeholder-2 { width: 49%; float: right; }
+ #placeholder-3 { clear: both; }
+ #placeholder-4 { width: 64%; float: left; }
+ #placeholder-5 { width: 34%; float: right; }
+ #footer { clear: both; }
+
+Then you have to create a `MANIFEST.json` file than will give some informations about your layout::
+
+ {"title": "100% - 1 placeholder",
+ "preview": "icon-layout.png"
+ }
+
+By default, the title will be the directory slug of the layout and the
+preview will load `/static/layouts/icon-layout.png`.
+
+Just define the `LAYOUTS_DIRS` in your personnal settings, and now,
+you can configure your pages with your new layout !
View
39 setup.py
@@ -0,0 +1,39 @@
+# coding=utf-8
+"""Python packaging."""
+import os
+from setuptools import setup
+
+
+def read_relative_file(filename):
+ """Returns contents of the given file, which path is supposed relative
+ to this module."""
+ with open(os.path.join(os.path.dirname(__file__), filename)) as f:
+ return f.read()
+
+
+NAME = 'ionyweb'
+README = read_relative_file('README.rst')
+VERSION = read_relative_file('VERSION').strip()
+PACKAGES = ['ionyweb']
+REQUIRES = ['django>=1.4', 'Jinja2']
+
+
+setup(name=NAME,
+ version=VERSION,
+ description='A javascript UI based on REST API CMS based on Django.',
+ long_description=README,
+ classifiers=['Development Status :: 1 - Planning',
+ 'License :: OSI Approved :: BSD License',
+ 'Programming Language :: Python :: 2.7',
+ 'Framework :: Django',
+ ],
+ keywords='django cms',
+ author='Ionyse',
+ author_email='contact@ionyse.com',
+ url='https://github.com/ionyse/%s' % NAME,
+ license='BSD',
+ packages=PACKAGES,
+ include_package_data=True,
+ zip_safe=False,
+ install_requires=REQUIRES,
+ )

0 comments on commit cb1f1a2

Please sign in to comment.
Something went wrong with that request. Please try again.