├── .gitignore ├── .svnignore ├── LICENSE ├── MANIFEST.in ├── README.rst ├── docs ├── Makefile ├── _static │ └── menu.png ├── api.rst ├── build │ └── .gitignore ├── conf.py ├── customizing.rst ├── extending.rst ├── index.rst ├── installation.rst ├── make.bat ├── settings.py ├── settings.rst └── source │ ├── _static │ └── menu.png │ └── conf.py ├── requirements.txt ├── scaffold ├── __init__.py ├── admin.py ├── app_settings.py ├── forms.py ├── locale │ └── es │ │ └── LC_MESSAGES │ │ ├── django.mo │ │ └── django.po ├── middleware.py ├── models.py ├── static │ └── scaffold │ │ ├── images │ │ └── jstree │ │ │ ├── bold.gif │ │ │ ├── changelist-filter-button-bg.jpg │ │ │ ├── close.gif │ │ │ ├── cms_toolbar.gif │ │ │ ├── cms_toolbar.png │ │ │ ├── copy.gif │ │ │ ├── cut.gif │ │ │ ├── file_icons │ │ │ ├── flv.gif │ │ │ ├── gif.gif │ │ │ ├── html.gif │ │ │ ├── java.gif │ │ │ ├── jpg.gif │ │ │ ├── mp3.png │ │ │ ├── ods.png │ │ │ ├── odt.png │ │ │ ├── pdf.gif │ │ │ ├── php.gif │ │ │ ├── png.gif │ │ │ ├── swf.gif │ │ │ ├── tgz.png │ │ │ ├── ttf.gif │ │ │ ├── txt.gif │ │ │ ├── txt.png │ │ │ ├── wav.gif │ │ │ └── zip.png │ │ │ ├── icon_extension.gif │ │ │ ├── image.png │ │ │ ├── indicator.gif │ │ │ ├── italic.gif │ │ │ ├── jquery │ │ │ ├── accordion-left-act.png │ │ │ ├── accordion-left-over.png │ │ │ ├── accordion-left.png │ │ │ ├── accordion-middle-act.png │ │ │ ├── accordion-middle-over.png │ │ │ ├── accordion-middle.png │ │ │ ├── accordion-right-act.png │ │ │ ├── accordion-right-over.png │ │ │ ├── accordion-right.png │ │ │ ├── default-bg.gif │ │ │ ├── dialog-e.gif │ │ │ ├── dialog-n.gif │ │ │ ├── dialog-ne.gif │ │ │ ├── dialog-nw.gif │ │ │ ├── dialog-s.gif │ │ │ ├── dialog-se.gif │ │ │ ├── dialog-sw.gif │ │ │ ├── dialog-title.gif │ │ │ ├── dialog-titlebar-close-hover.png │ │ │ ├── dialog-titlebar-close.png │ │ │ ├── dialog-w.gif │ │ │ ├── nav-bg.gif │ │ │ ├── resizable-e.gif │ │ │ ├── resizable-n.gif │ │ │ ├── resizable-ne.gif │ │ │ ├── resizable-nw.gif │ │ │ ├── resizable-s.gif │ │ │ ├── resizable-se.gif │ │ │ ├── resizable-sw.gif │ │ │ ├── resizable-w.gif │ │ │ ├── slider-bg-1.png │ │ │ ├── slider-bg-2.png │ │ │ ├── slider-handle.gif │ │ │ └── tabs.png │ │ │ ├── link.png │ │ │ ├── logo.jpg │ │ │ ├── page_find.gif │ │ │ ├── pluginlist-delete.png │ │ │ ├── pluginlist-holder-bg.gif │ │ │ ├── plugins │ │ │ ├── file.png │ │ │ ├── image.png │ │ │ ├── link.png │ │ │ └── snippet.png │ │ │ ├── sitemap-exim.gif │ │ │ ├── sitemap-exlm.gif │ │ │ ├── sitemap-extm.gif │ │ │ ├── sitemap-li-bg.jpg │ │ │ ├── sitemap-li-drag.gif │ │ │ └── unordered.gif │ │ ├── scripts │ │ ├── jquery.js │ │ ├── jquery.ui.js │ │ ├── jstree │ │ │ ├── _lib │ │ │ │ ├── jquery.cookie.js │ │ │ │ └── jquery.js │ │ │ ├── jquery.jstree.min.js │ │ │ └── themes │ │ │ │ └── django │ │ │ │ ├── bg.gif │ │ │ │ ├── bg_hover.gif │ │ │ │ ├── d.png │ │ │ │ ├── dot_for_ie.gif │ │ │ │ ├── icons.png │ │ │ │ └── style.css │ │ └── scaffold-listview.js │ │ └── styles │ │ ├── jquery.ui.start │ │ ├── images │ │ │ ├── ui-bg_flat_55_999999_40x100.png │ │ │ ├── ui-bg_flat_75_aaaaaa_40x100.png │ │ │ ├── ui-bg_glass_45_0078ae_1x400.png │ │ │ ├── ui-bg_glass_55_f8da4e_1x400.png │ │ │ ├── ui-bg_glass_75_79c9ec_1x400.png │ │ │ ├── ui-bg_gloss-wave_45_e14f1c_500x100.png │ │ │ ├── ui-bg_gloss-wave_50_6eac2c_500x100.png │ │ │ ├── ui-bg_gloss-wave_75_2191c0_500x100.png │ │ │ ├── ui-bg_inset-hard_100_fcfdfd_1x100.png │ │ │ ├── ui-icons_0078ae_256x240.png │ │ │ ├── ui-icons_056b93_256x240.png │ │ │ ├── ui-icons_d8e7f3_256x240.png │ │ │ ├── ui-icons_e0fdff_256x240.png │ │ │ ├── ui-icons_f5e175_256x240.png │ │ │ ├── ui-icons_f7a50d_256x240.png │ │ │ └── ui-icons_fcd113_256x240.png │ │ └── jquery.ui.css │ │ ├── scaffold-admin.css │ │ └── scaffold-listview.css ├── templates │ └── scaffold │ │ ├── admin │ │ ├── add.html │ │ ├── change_form.html │ │ ├── delete.html │ │ ├── includes │ │ │ └── fieldset.html │ │ ├── index.html │ │ ├── move.html │ │ ├── order_all_content.html │ │ ├── related_content.html │ │ └── submit_line.html │ │ └── section.html ├── templatetags │ ├── __init__.py │ └── sections.py ├── tests.py ├── urls.py └── views.py └── setup.py /.gitignore: -------------------------------------------------------------------------------- 1 | # ignore all dotfiles... 2 | .* 3 | # except for .gitignore 4 | !.gitignore 5 | # ignore python bytecode 6 | *.pyc 7 | -------------------------------------------------------------------------------- /.svnignore: -------------------------------------------------------------------------------- 1 | # ignore python bytecode 2 | *.pyc 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, James Stevenson 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | * 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. 8 | * Neither the name of the James Stevenson nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 9 | 10 | 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. 11 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include LICENSE 2 | include README.rst 3 | recursive-include scaffold/static * 4 | recursive-include scaffold/templates * 5 | 6 | recursive-include threespot *.css *.png *.jpg *.js *.gif *.html -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | ====================== 2 | About django-scaffold 3 | ====================== 4 | 5 | A Reusable application providing a generic section/subsection hierarchy in Django. 6 | 7 | Aims to solve a common problem: you're building a site that needs sections and 8 | subsections and you not only need to be able to manage that hierarchy, but 9 | also hang other content off of it. 10 | 11 | Requirements 12 | -------------- 13 | 14 | * `Django `_ (1.4 or higher) 15 | * `django-treebeard `_. 16 | 17 | 18 | Django-scaffolding uses the following javascript libraries (these are included in project): 19 | 20 | * `jQuery `_ 21 | * `jQuery UI `_ 22 | * `jstree `_ 23 | 24 | This project is licensed under a BSD License. Admin UI inspired by 25 | `django CMS `_. 26 | 27 | .. image:: http://github.com/mazelife/django-scaffold/raw/master/docs/source/_static/menu.png 28 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | 9 | # Internal variables. 10 | PAPEROPT_a4 = -D latex_paper_size=a4 11 | PAPEROPT_letter = -D latex_paper_size=letter 12 | ALLSPHINXOPTS = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 13 | 14 | .PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest 15 | 16 | help: 17 | @echo "Please use \`make ' where is one of" 18 | @echo " html to make standalone HTML files" 19 | @echo " dirhtml to make HTML files named index.html in directories" 20 | @echo " pickle to make pickle files" 21 | @echo " json to make JSON files" 22 | @echo " htmlhelp to make HTML files and a HTML help project" 23 | @echo " qthelp to make HTML files and a qthelp project" 24 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 25 | @echo " changes to make an overview of all changed/added/deprecated items" 26 | @echo " linkcheck to check all external links for integrity" 27 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 28 | 29 | clean: 30 | -rm -rf build/* 31 | 32 | html: 33 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) build/html 34 | @echo 35 | @echo "Build finished. The HTML pages are in build/html." 36 | 37 | dirhtml: 38 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) build/dirhtml 39 | @echo 40 | @echo "Build finished. The HTML pages are in build/dirhtml." 41 | 42 | pickle: 43 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) build/pickle 44 | @echo 45 | @echo "Build finished; now you can process the pickle files." 46 | 47 | json: 48 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) build/json 49 | @echo 50 | @echo "Build finished; now you can process the JSON files." 51 | 52 | htmlhelp: 53 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) build/htmlhelp 54 | @echo 55 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 56 | ".hhp project file in build/htmlhelp." 57 | 58 | qthelp: 59 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) build/qthelp 60 | @echo 61 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 62 | ".qhcp project file in build/qthelp, like this:" 63 | @echo "# qcollectiongenerator build/qthelp/django-scaffold.qhcp" 64 | @echo "To view the help file:" 65 | @echo "# assistant -collectionFile build/qthelp/django-scaffold.qhc" 66 | 67 | latex: 68 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) build/latex 69 | @echo 70 | @echo "Build finished; the LaTeX files are in build/latex." 71 | @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ 72 | "run these through (pdf)latex." 73 | 74 | changes: 75 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) build/changes 76 | @echo 77 | @echo "The overview file is in build/changes." 78 | 79 | linkcheck: 80 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) build/linkcheck 81 | @echo 82 | @echo "Link check complete; look for any errors in the above output " \ 83 | "or in build/linkcheck/output.txt." 84 | 85 | doctest: 86 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) build/doctest 87 | @echo "Testing of doctests in the sources finished, look at the " \ 88 | "results in build/doctest/output.txt." 89 | -------------------------------------------------------------------------------- /docs/_static/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/docs/_static/menu.png -------------------------------------------------------------------------------- /docs/api.rst: -------------------------------------------------------------------------------- 1 | ============================ 2 | The scaffold API 3 | ============================ 4 | 5 | Model methods 6 | ------------- 7 | 8 | The following methods are provided by ``scaffold.models.BaseSection``: 9 | 10 | .. autoclass:: scaffold.models.BaseSection 11 | :members: type,get_first_populated_field,get_related_content,get_subsections,get_associated_content 12 | 13 | Admin 14 | ------- 15 | 16 | The sections application contains the following views. 17 | 18 | .. autoclass:: scaffold.admin.SectionAdmin 19 | :members: 20 | 21 | Middleware 22 | ----------- 23 | 24 | Use the middleware if you need access to the section outside the view context. 25 | 26 | .. automodule:: scaffold.middleware 27 | :members: 28 | :undoc-members: 29 | -------------------------------------------------------------------------------- /docs/build/.gitignore: -------------------------------------------------------------------------------- 1 | # ignore all files... 2 | * 3 | # except for .gitignore 4 | !.gitignore 5 | 6 | -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # django-scaffold documentation build configuration file, created by 4 | # sphinx-quickstart on Wed Jun 9 08:49:17 2010. 5 | # 6 | # This file is execfile()d with the current directory set to its containing dir. 7 | # 8 | # Note that not all possible configuration values are present in this 9 | # autogenerated file. 10 | # 11 | # All configuration values have a default; values that are commented out 12 | # serve to show the default. 13 | 14 | import sys, os 15 | 16 | # If extensions (or modules to document with autodoc) are in another directory, 17 | # add these directories to sys.path here. If the directory is relative to the 18 | # documentation root, use os.path.abspath to make it absolute, like shown here. 19 | #sys.path.append(os.path.abspath('.')) 20 | 21 | sys.path.append(os.path.dirname(__file__)) 22 | import django 23 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") 24 | if django.VERSION < (1, 4): 25 | from django.core.management import setup_environ 26 | settings = __import__(os.environ["DJANGO_SETTINGS_MODULE"]) 27 | setup_environ(settings) 28 | 29 | # -- General configuration ----------------------------------------------------- 30 | 31 | # Add any Sphinx extension module names here, as strings. They can be extensions 32 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. 33 | extensions = ['sphinx.ext.autodoc'] 34 | 35 | # Add any paths that contain templates here, relative to this directory. 36 | templates_path = ['_templates'] 37 | 38 | # The suffix of source filenames. 39 | source_suffix = '.rst' 40 | 41 | # The encoding of source files. 42 | #source_encoding = 'utf-8' 43 | 44 | # The master toctree document. 45 | master_doc = 'index' 46 | 47 | # General information about the project. 48 | project = u'django-scaffold' 49 | copyright = u'2010, James Stevenson' 50 | 51 | # The version info for the project you're documenting, acts as replacement for 52 | # |version| and |release|, also used in various other places throughout the 53 | # built documents. 54 | # 55 | # The short X.Y version. 56 | version = '1.1.1' 57 | # The full version, including alpha/beta/rc tags. 58 | release = '1.1.1' 59 | 60 | # The language for content autogenerated by Sphinx. Refer to documentation 61 | # for a list of supported languages. 62 | #language = None 63 | 64 | # There are two options for replacing |today|: either, you set today to some 65 | # non-false value, then it is used: 66 | #today = '' 67 | # Else, today_fmt is used as the format for a strftime call. 68 | #today_fmt = '%B %d, %Y' 69 | 70 | # List of documents that shouldn't be included in the build. 71 | #unused_docs = [] 72 | 73 | # List of directories, relative to source directory, that shouldn't be searched 74 | # for source files. 75 | exclude_trees = [] 76 | 77 | # The reST default role (used for this markup: `text`) to use for all documents. 78 | #default_role = None 79 | 80 | # If true, '()' will be appended to :func: etc. cross-reference text. 81 | #add_function_parentheses = True 82 | 83 | # If true, the current module name will be prepended to all description 84 | # unit titles (such as .. function::). 85 | #add_module_names = True 86 | 87 | # If true, sectionauthor and moduleauthor directives will be shown in the 88 | # output. They are ignored by default. 89 | #show_authors = False 90 | 91 | # The name of the Pygments (syntax highlighting) style to use. 92 | pygments_style = 'sphinx' 93 | 94 | # A list of ignored prefixes for module index sorting. 95 | #modindex_common_prefix = [] 96 | 97 | 98 | # -- Options for HTML output --------------------------------------------------- 99 | 100 | # The theme to use for HTML and HTML Help pages. Major themes that come with 101 | # Sphinx are currently 'default' and 'sphinxdoc'. 102 | html_theme = 'default' 103 | 104 | # Theme options are theme-specific and customize the look and feel of a theme 105 | # further. For a list of options available for each theme, see the 106 | # documentation. 107 | #html_theme_options = {} 108 | 109 | # Add any paths that contain custom themes here, relative to this directory. 110 | #html_theme_path = [] 111 | 112 | # The name for this set of Sphinx documents. If None, it defaults to 113 | # " v documentation". 114 | #html_title = None 115 | 116 | # A shorter title for the navigation bar. Default is the same as html_title. 117 | #html_short_title = None 118 | 119 | # The name of an image file (relative to this directory) to place at the top 120 | # of the sidebar. 121 | #html_logo = None 122 | 123 | # The name of an image file (within the static path) to use as favicon of the 124 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 125 | # pixels large. 126 | #html_favicon = None 127 | 128 | # Add any paths that contain custom static files (such as style sheets) here, 129 | # relative to this directory. They are copied after the builtin static files, 130 | # so a file named "default.css" will overwrite the builtin "default.css". 131 | html_static_path = ['_static'] 132 | 133 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, 134 | # using the given strftime format. 135 | #html_last_updated_fmt = '%b %d, %Y' 136 | 137 | # If true, SmartyPants will be used to convert quotes and dashes to 138 | # typographically correct entities. 139 | #html_use_smartypants = True 140 | 141 | # Custom sidebar templates, maps document names to template names. 142 | #html_sidebars = {} 143 | 144 | # Additional templates that should be rendered to pages, maps page names to 145 | # template names. 146 | #html_additional_pages = {} 147 | 148 | # If false, no module index is generated. 149 | #html_use_modindex = True 150 | 151 | # If false, no index is generated. 152 | #html_use_index = True 153 | 154 | # If true, the index is split into individual pages for each letter. 155 | #html_split_index = False 156 | 157 | # If true, links to the reST sources are added to the pages. 158 | #html_show_sourcelink = True 159 | 160 | # If true, an OpenSearch description file will be output, and all pages will 161 | # contain a tag referring to it. The value of this option must be the 162 | # base URL from which the finished HTML is served. 163 | #html_use_opensearch = '' 164 | 165 | # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). 166 | #html_file_suffix = '' 167 | 168 | # Output file base name for HTML help builder. 169 | htmlhelp_basename = 'django-scaffolddoc' 170 | 171 | 172 | # -- Options for LaTeX output -------------------------------------------------- 173 | 174 | # The paper size ('letter' or 'a4'). 175 | #latex_paper_size = 'letter' 176 | 177 | # The font size ('10pt', '11pt' or '12pt'). 178 | #latex_font_size = '10pt' 179 | 180 | # Grouping the document tree into LaTeX files. List of tuples 181 | # (source start file, target name, title, author, documentclass [howto/manual]). 182 | latex_documents = [ 183 | ('index', 'django-scaffold.tex', u'django-scaffold Documentation', 184 | u'James Stevenson', 'manual'), 185 | ] 186 | 187 | # The name of an image file (relative to this directory) to place at the top of 188 | # the title page. 189 | #latex_logo = None 190 | 191 | # For "manual" documents, if this is true, then toplevel headings are parts, 192 | # not chapters. 193 | #latex_use_parts = False 194 | 195 | # Additional stuff for the LaTeX preamble. 196 | #latex_preamble = '' 197 | 198 | # Documents to append as an appendix to all manuals. 199 | #latex_appendices = [] 200 | 201 | # If false, no module index is generated. 202 | #latex_use_modindex = True 203 | -------------------------------------------------------------------------------- /docs/customizing.rst: -------------------------------------------------------------------------------- 1 | ============================= 2 | Customizing scaffold 3 | ============================= 4 | 5 | In the previous section (:doc:`extending`) we created an app that used scaffold, but the only thing we customized was the model the app used. We used the URL conf, views, and templates provided by scaffold, but we don't have to. 6 | 7 | Almost any piece of scaffold can be overridden in your concrete app. For example, let's say we want to create our own view of our ``Section`` model, rather than using scaffold's. And while we're at it, we want to change how the url addressing of sections works. 8 | 9 | Customizing URLs 10 | ----------------- 11 | 12 | By default, scaffold uses a common URL addressing scheme for sections and subsections. A url like ``"/projects/local/water/"`` means give me the section with the slug "water", which is a child of the "local" section, which in turn is a child of the "projects" section. This is a common--and useful way--of orienting the user within the IA of the site using the URL. 13 | 14 | But, let's say you want a simpler scheme, with URLs like ``"/sections/local/"`` or ``"/sections/water/"``. Heres how our URL conf file looked at the end of the last section:: 15 | 16 | try: 17 | from django.conf.urls import * 18 | except ImportError: 19 | from django.conf.urls.defaults import * 20 | 21 | from django.contrib import admin 22 | admin.autodiscover() 23 | urlpatterns = patterns('', 24 | (r'^admin/', include(admin.site.urls)), 25 | url(r'^(?P.+)/$', 'scaffold.views.section', name="section"), 26 | ) 27 | 28 | Now we can make the urlpatterns look like this:: 29 | 30 | urlpatterns = patterns('', 31 | url(r'^sections/(?P[\w-]+)/?$', 'scaffold.views.section', name="section"), 32 | (r'^admin/', include(admin.site.urls)), 33 | ) 34 | 35 | Customizing Views 36 | ------------------ 37 | 38 | The one problem is that we aren't passing scaffold.views.section the arguments it wants anymore, so we'll need to create our own view function:: 39 | 40 | urlpatterns = patterns('', 41 | url(r'^sections/(?P[\w-]+)/?$', 'sections.views.section'), 42 | (r'^admin/', include(admin.site.urls)), 43 | ) 44 | 45 | Then we create a "section" view in our app's *views.py* file:: 46 | 47 | from django.shortcuts import get_object_or_404 48 | from django.views.generic import simple 49 | from models import Section 50 | 51 | def section(request, slug=None): 52 | section = get_object_or_404(Section, slug=slug) 53 | return simple.direct_to_template(request, 54 | template="scaffold/section.html", 55 | extra_context={ 56 | 'section': section, 57 | } 58 | ) 59 | 60 | Customizing Templates 61 | ---------------------- 62 | 63 | We're still using scaffold's template, but this is probably one of the first thing's you'd want to override. You can do this in two ways: create a ``scaffold`` directory in your own project's templates folder, then create a ``section.html`` file where you template the object yourself. Or, if you've written your own view function like we have, then you can call the template whatever you want:: 64 | 65 | from django.shortcuts import get_object_or_404 66 | from django.views.generic import simple 67 | from models import Section 68 | 69 | def section(request, slug=None): 70 | section = get_object_or_404(Section, slug=slug) 71 | return simple.direct_to_template(request, 72 | template="sections/section.html", 73 | extra_context={ 74 | 'section': section, 75 | } 76 | ) 77 | 78 | Customizing the Admin 79 | ------------------------- 80 | 81 | One of scaffold's best features is it's integration with the Django admin. Even this, however, is customizable. All scaffold admin views are located in the ``scaffold.admin.SectionAdmin`` class. Besides custom versions of the usual admin views, (change list, change object, add object, and delete object) scaffold provides views to move nodes in the tree, view all content attached to a node, and and order content attached to a node. Read the Django documentation to find out more about `how to customize `_ a model admin. 82 | 83 | Note that most customizations possible for the ``ModelAdmin`` class are possible for ``SectionsAdmin``, although a few are ignore because of differences in the UI. 84 | 85 | Unspported ``ModelAdmin`` Options 86 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 87 | 88 | * ``date_hierarchy`` 89 | * ``list_display`` 90 | * ``list_editable`` 91 | * ``list_filter`` 92 | * ``list_per_page`` 93 | * ``list_select_related`` 94 | * ``ordering`` 95 | * ``search_fields`` 96 | * ``actions`` 97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /docs/extending.rst: -------------------------------------------------------------------------------- 1 | ===================================== 2 | Creating an app to extend scaffold 3 | ===================================== 4 | 5 | Although you've installed it, scaffold won't do much by itself. Think of it as a kind of *abstract* application, akin to the notion of an abstract class in python. In other words, scaffold is meant to be extended by an application that you create. We'll call this the **concrete app** from here on out. 6 | 7 | This is not to say scaffold doesn't have a lot going on under the hood; like any Django app, scaffold has views, models, templates and media files. However, any one of these elements can--and should be--extended or overridden as needed. Let's walk through the steps we'll need to get a basic **concrete app** working using scaffold. 8 | 9 | A typical use case for scaffolding is creating a tree of sections and subsections for a web site. Let's say we're putting together a simple news site, which will have sections for news, weather, entertainment and shopping. Some of these sections--entertainment--will have sub-sections (say, movies, theater, music, and art). Content creators will be able to create articles which can be attached to any one of these sections and subsections. All in all, a simple, common task for a web developer and one that scaffold can help with. 10 | 11 | 1. Create a new application. 12 | ------------------------------ 13 | Let's start by creating an application for handling sections in the site. We'll even call the application "sections": 14 | 15 | .. code-block:: bash 16 | 17 | python manage.py startapp sections 18 | 19 | 2. Create a model which extends scaffold 20 | ----------------------------------------- 21 | 22 | We decide that a section should have a title, a description (which we'll use in meta tags for SEO purposes), and a photo. We'll start by creating a model in the models.py file that extends the ``scaffold.models.BaseSection`` model. 23 | Here's some of what's in that ``BaseSection`` model:: 24 | 25 | class BaseSection(MP_Node): 26 | 27 | slug = models.SlugField(_("Slug"), help_text=_("Used to construct URL")) 28 | title = models.CharField(_("Title"), max_length=255) 29 | order = models.IntegerField(_("Order of section"), blank=True, default=0) 30 | 31 | Notice that the model only defines 3 fields. Let's ignore "order" for the moment; scaffold assumes that anything that extends ``BaseSection`` will have at least a slug (for constructing the url of the section) and a title. 32 | 33 | Now we can create a model which adds the fields we need. In the ``models.py`` for your new app, add the following:: 34 | 35 | from scaffold.models import BaseSection 36 | 37 | class Section(BaseSection): 38 | description = models.TextField("Description", help_text="For SEO.") 39 | photo = models.ImageField("Photo", upload_to="section_images") 40 | 41 | ...and that's it, we're done. BaseSection provides a number of powerful methods that we'll get into later. 42 | 43 | 3. Setup your URL Configuration 44 | --------------------------------- 45 | 46 | Change the default urls.py file for your Django project to the following:: 47 | 48 | try: 49 | from django.conf.urls import * 50 | except ImportError: 51 | from django.conf.urls.defaults import * 52 | 53 | from django.contrib import admin 54 | admin.autodiscover() 55 | urlpatterns = patterns('', 56 | (r'^admin/', include(admin.site.urls)), 57 | url(r'^(?P.+)/$', 'scaffold.views.section', name="section"), 58 | ) 59 | 60 | 61 | We've done a couple things here. First, we've enabled the admin app by uncommenting the lines which turn on autodiscover and route ``/admin/`` urls to the admin app. That takes care of the admin interface and allows us to manage a sections/subsections tree in the admin (Scaffold provides a number of admin views to manage your models, but these are all handled in a special ``ModelAdmin`` class called ``SectionAdmin`` and do not need to be specially referenced in your URL conf.) 62 | 63 | But how will we actually view a section or subsection on the website? The second url pattern handles this:: 64 | 65 | url(r'^(?P.+)/$', 'scaffold.views.section', name="section") 66 | 67 | This line works for a very specific, but common URL addressing schema: Top level sections will have root-level slugs in the url. Our site has an "Entertainment" section with the slug ``entertainment``. The URL will therefore be **http://www.mysite.com/entertainment/**. There is also a subsection of entertainment, called "Dining Out" with the slug ``dining``. It's URL would be **http://www.mysite.com/entertainment/dining/**. 68 | 69 | Like almost everything about scaffold, you are not required to use this pattern. You can write your own url conf, or completely override the ``scaffold.views.section`` view if you like. 70 | 71 | .. admonition:: Note 72 | 73 | The positioning of the url patterns here is very deliberate. The regular expression '^(?P.+)/$' is rather greedy and will match anything, therefore we put it last. 74 | 75 | 4. Register your Section model in the admin site 76 | ---------------------------------------------------- 77 | 78 | Create an admin.py file in your concrete application and register your new ``Section`` model there:: 79 | 80 | from django.contrib import admin 81 | from models import Section 82 | from scaffold.admin import SectionAdmin 83 | 84 | admin.site.register(Section, SectionAdmin) 85 | 86 | .. admonition:: Note 87 | 88 | You'll notice that we're registering our concrete model with the admin site using the ``SectionAdmin`` class in django-scaffold. This step is crucial if you want scaffold to work properly in the admin interface. The standard ``admin.ModelAdmin`` class does not provide the special properties and views needed to manage scaffold's concrete models. 89 | 90 | 91 | 5. Add the necessary project settings 92 | ----------------------------------------- 93 | 94 | All that's left to do is add a single setting to your Django project. 95 | In your settings.py file, place the following:: 96 | 97 | SCAFFOLD_EXTENDING_APP_NAME = 'sections' 98 | 99 | 100 | Note: this example assumes your concrete app is called `sections`. Use whatever you've named your app as the `SCAFFOLD_EXTENDING_APP_NAME` setting. 101 | 102 | 6. Make the the scaffold media available. 103 | ------------------------------------------ 104 | 105 | Django-scaffold has a number of CSS, JavaScript and image files which it uses in the admin interface. These are stored in media/scaffold in the scaffold application directory. You can copy the ``scaffold`` folder from the scaffold media directory to your own project's media directory, but it's best to simply create a symlink instead. (Make sure, if you're using apache to server this, you have the ``Options FollowSymLinks`` directive in place.) 106 | 107 | At this point, you should be able to start up your Django project, browse to the admin interface and start creating sections. -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | .. _index: 2 | 3 | =========================================== 4 | django-scaffold documentation 5 | =========================================== 6 | 7 | .. rubric:: A guide to using and extending scaffold. 8 | 9 | Contents: 10 | 11 | .. toctree:: 12 | :maxdepth: 2 13 | 14 | Installing scaffold 15 | Creating an application that uses scaffold 16 | Customizing scaffold 17 | Available settings 18 | API 19 | 20 | .. image:: /_static/menu.png 21 | 22 | Indices and tables 23 | ================== 24 | 25 | * :ref:`search` 26 | 27 | -------------------------------------------------------------------------------- /docs/installation.rst: -------------------------------------------------------------------------------- 1 | =========================================== 2 | Installation 3 | =========================================== 4 | 5 | Scaffold is installed like any other Django app:: 6 | 7 | ?>pip install django-scaffold 8 | 9 | or, if you can't use pip:: 10 | 11 | ?>easy_install django-scaffold 12 | 13 | or, if all else fails, place scaffold package where your python interpreter can find it and then 14 | 15 | When you have the package installed, add it to the list of apps in the INSTALLED_APPS setting of your `settings.py` file. -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | REM Command file for Sphinx documentation 4 | 5 | set SPHINXBUILD=sphinx-build 6 | set ALLSPHINXOPTS=-d build/doctrees %SPHINXOPTS% . 7 | if NOT "%PAPER%" == "" ( 8 | set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% 9 | ) 10 | 11 | if "%1" == "" goto help 12 | 13 | if "%1" == "help" ( 14 | :help 15 | echo.Please use `make ^` where ^ is one of 16 | echo. html to make standalone HTML files 17 | echo. dirhtml to make HTML files named index.html in directories 18 | echo. pickle to make pickle files 19 | echo. json to make JSON files 20 | echo. htmlhelp to make HTML files and a HTML help project 21 | echo. qthelp to make HTML files and a qthelp project 22 | echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter 23 | echo. changes to make an overview over all changed/added/deprecated items 24 | echo. linkcheck to check all external links for integrity 25 | echo. doctest to run all doctests embedded in the documentation if enabled 26 | goto end 27 | ) 28 | 29 | if "%1" == "clean" ( 30 | for /d %%i in (build\*) do rmdir /q /s %%i 31 | del /q /s build\* 32 | goto end 33 | ) 34 | 35 | if "%1" == "html" ( 36 | %SPHINXBUILD% -b html %ALLSPHINXOPTS% build/html 37 | echo. 38 | echo.Build finished. The HTML pages are in build/html. 39 | goto end 40 | ) 41 | 42 | if "%1" == "dirhtml" ( 43 | %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% build/dirhtml 44 | echo. 45 | echo.Build finished. The HTML pages are in build/dirhtml. 46 | goto end 47 | ) 48 | 49 | if "%1" == "pickle" ( 50 | %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% build/pickle 51 | echo. 52 | echo.Build finished; now you can process the pickle files. 53 | goto end 54 | ) 55 | 56 | if "%1" == "json" ( 57 | %SPHINXBUILD% -b json %ALLSPHINXOPTS% build/json 58 | echo. 59 | echo.Build finished; now you can process the JSON files. 60 | goto end 61 | ) 62 | 63 | if "%1" == "htmlhelp" ( 64 | %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% build/htmlhelp 65 | echo. 66 | echo.Build finished; now you can run HTML Help Workshop with the ^ 67 | .hhp project file in build/htmlhelp. 68 | goto end 69 | ) 70 | 71 | if "%1" == "qthelp" ( 72 | %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% build/qthelp 73 | echo. 74 | echo.Build finished; now you can run "qcollectiongenerator" with the ^ 75 | .qhcp project file in build/qthelp, like this: 76 | echo.^> qcollectiongenerator build\qthelp\django-scaffold.qhcp 77 | echo.To view the help file: 78 | echo.^> assistant -collectionFile build\qthelp\django-scaffold.ghc 79 | goto end 80 | ) 81 | 82 | if "%1" == "latex" ( 83 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% build/latex 84 | echo. 85 | echo.Build finished; the LaTeX files are in build/latex. 86 | goto end 87 | ) 88 | 89 | if "%1" == "changes" ( 90 | %SPHINXBUILD% -b changes %ALLSPHINXOPTS% build/changes 91 | echo. 92 | echo.The overview file is in build/changes. 93 | goto end 94 | ) 95 | 96 | if "%1" == "linkcheck" ( 97 | %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% build/linkcheck 98 | echo. 99 | echo.Link check complete; look for any errors in the above output ^ 100 | or in build/linkcheck/output.txt. 101 | goto end 102 | ) 103 | 104 | if "%1" == "doctest" ( 105 | %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% build/doctest 106 | echo. 107 | echo.Testing of doctests in the sources finished, look at the ^ 108 | results in build/doctest/output.txt. 109 | goto end 110 | ) 111 | 112 | :end 113 | -------------------------------------------------------------------------------- /docs/settings.py: -------------------------------------------------------------------------------- 1 | # A very basic settings file that allows Sphinx to build 2 | # the docs (this is becuase autodoc is used). 3 | import os 4 | import sys 5 | sys.path.insert(0, os.getcwd()) 6 | sys.path.insert(0, os.path.join(os.getcwd(), os.pardir)) 7 | 8 | SITE_ID = 303 9 | DEBUG = True 10 | TEMPLATE_DEBUG = DEBUG 11 | 12 | DATABASES = {"default": { 13 | "NAME": ":memory:", 14 | "ENGINE": "django.db.backends.sqlite3", 15 | "USER": '', 16 | "PASSWORD": '', 17 | "PORT": '', 18 | }} 19 | 20 | INSTALLED_APPS = ( 21 | 'django.contrib.auth', 22 | 'django.contrib.contenttypes', 23 | 'django.contrib.sessions', 24 | 'django.contrib.sites', 25 | 'scaffold', 26 | ) 27 | 28 | SECRET_KEY = "NULL" 29 | 30 | SCAFFOLD_EXTENDING_APP_NAME = "scaffold" 31 | SCAFFOLD_EXTENDING_MODEL_PATH = "scaffold.models.BaseSection" 32 | -------------------------------------------------------------------------------- /docs/settings.rst: -------------------------------------------------------------------------------- 1 | =========================================== 2 | Available settings 3 | =========================================== 4 | 5 | Here's a full list of all available settings for the django-scaffold application, in alphabetical order, and their 6 | default values. 7 | 8 | SCAFFOLD_ALLOW_ASSOCIATED_ORDERING 9 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10 | 11 | Default: ``True`` 12 | 13 | One of scaffold's features is that you can order multiple types of content that is attached to a scaffold item. For example, lets say you extend ``scaffold.models.BaseSection`` with a model called Section. By it's very nature, one section can be the child of another. However, you might also create a model called ``Article`` which has a Foreign-key relationship with a section, and thus is it's child too. In fact you might even establish a generic foreign key relationship between a model and your ``Section`` model. When this property is set to True, you can order all items relative to each other via the admin interface. 14 | 15 | Note that for this to work, all models must share a common field were the order, relative to each other, can be stored as an integer. By default, models that inherit from ``scaffold.models.BaseSection`` assume this field is called 'order'. 16 | 17 | If you don't want this ordering option to be available in the admin interface for associated content, set this to False. 18 | 19 | SCAFFOLD_EXTENDING_APP_NAME 20 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 21 | 22 | Default: Not defined 23 | 24 | The name of the concrete application which is extending scaffold. Note that this setting is required: scaffold will not work without it. 25 | 26 | SCAFFOLD_EXTENDING_MODEL_PATH 27 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 28 | 29 | Default: ``'{SCAFFOLD_EXTENDING_APP_NAME}.models.Section'`` 30 | 31 | The location of the model which extends ``scaffold.models.BaseSection``. By default, it assumes this model is called ``Section``, thus if you create an app named "pages", scaffold will try to import ``pages.models.Section`` unless this setting is provided. 32 | 33 | SCAFFOLD_LINK_HTML 34 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 35 | 36 | Default:: 37 | 38 | ( 39 | ('edit_link', ( 40 | "" 41 | "edit" 42 | ),), 43 | ('add_link', ( 44 | "" 45 | "add child" 46 | ),), 47 | ('del_link', ( 48 | "" 49 | "delete" 50 | ),), 51 | ('list_link', ( 52 | "" 53 | "list content" 54 | ),) 55 | ) 56 | 57 | These are the four links which are added to every item in the tree in the scaffold admin view. You can override this tuple of tuples with your own links, or reorder this one. 58 | 59 | SCAFFOLD_PATH_CACHE_KEY 60 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 61 | 62 | Default: ``'scaffold-path-map'`` 63 | 64 | The key name under which scaffold stores it's path cache values. This should only be changed to avoid key collisions in the cache 65 | 66 | SCAFFOLD_PATH_CACHE_TTL 67 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 68 | 69 | Default: ``43200`` (that's equal to 12 hours) 70 | 71 | The length of time (in seconds) an item persists in the path cache. The path cache is a way of very quickly (and without a DB call) looking up scaffold items from a url. Note that that adding, editing the slug of, or removing a scaffold item automatically refreshes the cache. 72 | 73 | SCAFFOLD_VALIDATE_GLOBALLY_UNIQUE_SLUGS 74 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 75 | 76 | Default: ``False`` 77 | 78 | If set to ``True`` this setting will require all slugs to be globally unique. Otherwise, slugs can be reused **except** among objects with a common parent (in other words, an object cannot have two children with the same slug). 79 | 80 | SCAFFOLD_TREEBEARD_NODE_TYPE 81 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 82 | 83 | Default: ``'treebeard.mp_tree.MP_Node'`` 84 | 85 | Allows the user to specify the tree model implementation to use. Allowed values are: 86 | 87 | * ``'treebeard.mp_tree.MP_Node'`` 88 | * ``'treebeard.al_tree.AL_Node'`` 89 | * ``'treebeard.ns_tree.NS_Node'`` 90 | 91 | Depending on the read/write profile of your site, some node types will be more efficient then others. Refer to the `treebeard docs `_ for an explanation 92 | of each type. -------------------------------------------------------------------------------- /docs/source/_static/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/docs/source/_static/menu.png -------------------------------------------------------------------------------- /docs/source/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # django-scaffold documentation build configuration file, created by 4 | # sphinx-quickstart on Wed Jun 9 08:49:17 2010. 5 | # 6 | # This file is execfile()d with the current directory set to its containing dir. 7 | # 8 | # Note that not all possible configuration values are present in this 9 | # autogenerated file. 10 | # 11 | # All configuration values have a default; values that are commented out 12 | # serve to show the default. 13 | 14 | import sys, os 15 | 16 | # If extensions (or modules to document with autodoc) are in another directory, 17 | # add these directories to sys.path here. If the directory is relative to the 18 | # documentation root, use os.path.abspath to make it absolute, like shown here. 19 | #sys.path.append(os.path.abspath('.')) 20 | 21 | code_path = os.path.abspath(os.path.join(os.path.abspath('.'), '../../../../bin/activate_this.py')) 22 | if not os.path.exists(code_path): 23 | print "WARNING: Autodoc is busted." 24 | execfile(code_path, dict(__file__=code_path)) 25 | from django.core.management import setup_environ 26 | 27 | 28 | code_path = os.path.abspath(os.path.join(os.path.abspath('.'), '../../../../')) 29 | sys.path.append(code_path) 30 | code_path = os.path.abspath(os.path.join(os.path.abspath('.'), '../../../../sectest')) 31 | sys.path.append(code_path) 32 | 33 | from sectest import settings 34 | setup_environ(settings) 35 | 36 | # -- General configuration ----------------------------------------------------- 37 | 38 | # Add any Sphinx extension module names here, as strings. They can be extensions 39 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. 40 | extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo', 'sphinx.ext.coverage'] 41 | 42 | # Add any paths that contain templates here, relative to this directory. 43 | templates_path = ['_templates'] 44 | 45 | # The suffix of source filenames. 46 | source_suffix = '.rst' 47 | 48 | # The encoding of source files. 49 | #source_encoding = 'utf-8' 50 | 51 | # The master toctree document. 52 | master_doc = 'index' 53 | 54 | # General information about the project. 55 | project = u'django-scaffold' 56 | copyright = u'2010, James Stevenson' 57 | 58 | # The version info for the project you're documenting, acts as replacement for 59 | # |version| and |release|, also used in various other places throughout the 60 | # built documents. 61 | # 62 | # The short X.Y version. 63 | version = '0.1b' 64 | # The full version, including alpha/beta/rc tags. 65 | release = '0.1b' 66 | 67 | # The language for content autogenerated by Sphinx. Refer to documentation 68 | # for a list of supported languages. 69 | #language = None 70 | 71 | # There are two options for replacing |today|: either, you set today to some 72 | # non-false value, then it is used: 73 | #today = '' 74 | # Else, today_fmt is used as the format for a strftime call. 75 | #today_fmt = '%B %d, %Y' 76 | 77 | # List of documents that shouldn't be included in the build. 78 | #unused_docs = [] 79 | 80 | # List of directories, relative to source directory, that shouldn't be searched 81 | # for source files. 82 | exclude_trees = [] 83 | 84 | # The reST default role (used for this markup: `text`) to use for all documents. 85 | #default_role = None 86 | 87 | # If true, '()' will be appended to :func: etc. cross-reference text. 88 | #add_function_parentheses = True 89 | 90 | # If true, the current module name will be prepended to all description 91 | # unit titles (such as .. function::). 92 | #add_module_names = True 93 | 94 | # If true, sectionauthor and moduleauthor directives will be shown in the 95 | # output. They are ignored by default. 96 | #show_authors = False 97 | 98 | # The name of the Pygments (syntax highlighting) style to use. 99 | pygments_style = 'sphinx' 100 | 101 | # A list of ignored prefixes for module index sorting. 102 | #modindex_common_prefix = [] 103 | 104 | 105 | # -- Options for HTML output --------------------------------------------------- 106 | 107 | # The theme to use for HTML and HTML Help pages. Major themes that come with 108 | # Sphinx are currently 'default' and 'sphinxdoc'. 109 | html_theme = 'default' 110 | 111 | # Theme options are theme-specific and customize the look and feel of a theme 112 | # further. For a list of options available for each theme, see the 113 | # documentation. 114 | #html_theme_options = {} 115 | 116 | # Add any paths that contain custom themes here, relative to this directory. 117 | #html_theme_path = [] 118 | 119 | # The name for this set of Sphinx documents. If None, it defaults to 120 | # " v documentation". 121 | #html_title = None 122 | 123 | # A shorter title for the navigation bar. Default is the same as html_title. 124 | #html_short_title = None 125 | 126 | # The name of an image file (relative to this directory) to place at the top 127 | # of the sidebar. 128 | #html_logo = None 129 | 130 | # The name of an image file (within the static path) to use as favicon of the 131 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 132 | # pixels large. 133 | #html_favicon = None 134 | 135 | # Add any paths that contain custom static files (such as style sheets) here, 136 | # relative to this directory. They are copied after the builtin static files, 137 | # so a file named "default.css" will overwrite the builtin "default.css". 138 | html_static_path = ['_static'] 139 | 140 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, 141 | # using the given strftime format. 142 | #html_last_updated_fmt = '%b %d, %Y' 143 | 144 | # If true, SmartyPants will be used to convert quotes and dashes to 145 | # typographically correct entities. 146 | #html_use_smartypants = True 147 | 148 | # Custom sidebar templates, maps document names to template names. 149 | #html_sidebars = {} 150 | 151 | # Additional templates that should be rendered to pages, maps page names to 152 | # template names. 153 | #html_additional_pages = {} 154 | 155 | # If false, no module index is generated. 156 | #html_use_modindex = True 157 | 158 | # If false, no index is generated. 159 | #html_use_index = True 160 | 161 | # If true, the index is split into individual pages for each letter. 162 | #html_split_index = False 163 | 164 | # If true, links to the reST sources are added to the pages. 165 | #html_show_sourcelink = True 166 | 167 | # If true, an OpenSearch description file will be output, and all pages will 168 | # contain a tag referring to it. The value of this option must be the 169 | # base URL from which the finished HTML is served. 170 | #html_use_opensearch = '' 171 | 172 | # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). 173 | #html_file_suffix = '' 174 | 175 | # Output file base name for HTML help builder. 176 | htmlhelp_basename = 'django-scaffolddoc' 177 | 178 | 179 | # -- Options for LaTeX output -------------------------------------------------- 180 | 181 | # The paper size ('letter' or 'a4'). 182 | #latex_paper_size = 'letter' 183 | 184 | # The font size ('10pt', '11pt' or '12pt'). 185 | #latex_font_size = '10pt' 186 | 187 | # Grouping the document tree into LaTeX files. List of tuples 188 | # (source start file, target name, title, author, documentclass [howto/manual]). 189 | latex_documents = [ 190 | ('index', 'django-scaffold.tex', u'django-scaffold Documentation', 191 | u'James Stevenson', 'manual'), 192 | ] 193 | 194 | # The name of an image file (relative to this directory) to place at the top of 195 | # the title page. 196 | #latex_logo = None 197 | 198 | # For "manual" documents, if this is true, then toplevel headings are parts, 199 | # not chapters. 200 | #latex_use_parts = False 201 | 202 | # Additional stuff for the LaTeX preamble. 203 | #latex_preamble = '' 204 | 205 | # Documents to append as an appendix to all manuals. 206 | #latex_appendices = [] 207 | 208 | # If false, no module index is generated. 209 | #latex_use_modindex = True 210 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Django>=1.4 2 | django-treebeard==1.61 3 | -------------------------------------------------------------------------------- /scaffold/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/__init__.py -------------------------------------------------------------------------------- /scaffold/app_settings.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | from django.conf import settings 4 | from django.core.exceptions import ImproperlyConfigured 5 | from django.utils.importlib import import_module 6 | 7 | _project_settings_registry = [] 8 | 9 | def _get_setting(project_setting_name, default=None, required=False): 10 | project_setting_name = "SCAFFOLD_%s" % project_setting_name 11 | _project_settings_registry.insert(0, project_setting_name) 12 | if required and not default: 13 | assert hasattr(settings, project_setting_name), ( 14 | "The following setting is required to use the scaffold " 15 | "application in your project: %s" 16 | ) % project_setting_name 17 | return getattr(settings, project_setting_name, default) 18 | 19 | EXTENDING_APP_NAME = _get_setting('EXTENDING_APP_NAME', 20 | required=True 21 | ) 22 | 23 | EXTENDING_MODEL_PATH = _get_setting('EXTENDING_MODEL_PATH', 24 | default = "%s.models.Section" % EXTENDING_APP_NAME 25 | ) 26 | 27 | LINK_HTML = _get_setting('LINK_HTML', default=( 28 | ('edit_link', ( 29 | "" 30 | "edit" 31 | ),), 32 | ('add_link', ( 33 | "" 34 | "add child" 35 | ),), 36 | ('del_link', ( 37 | "" 38 | "delete" 39 | ),), 40 | ('list_link', ( 41 | "" 42 | "list content" 43 | ),) 44 | )) 45 | 46 | PATH_CACHE_TTL = _get_setting('PATH_CACHE_TTL', 47 | default = (60 * 60 * 12) 48 | ) 49 | PATH_CACHE_KEY = _get_setting('PATH_CACHE_KEY', 50 | default="scaffold-path-map" 51 | ) 52 | 53 | ALLOW_ASSOCIATED_ORDERING = _get_setting('ALLOW_ASSOCIATED_ORDERING', 54 | default=True 55 | ) 56 | 57 | VALIDATE_GLOBALLY_UNIQUE_SLUGS = _get_setting('VALIDATE_GLOBALLY_UNIQUE_SLUGS', 58 | default=False 59 | ) 60 | 61 | TREEBEARD_NODE_TYPE = _get_setting('TREEBEARD_NODE_TYPE', 62 | default="treebeard.mp_tree.MP_Node" 63 | ) 64 | 65 | def get_extending_model(): 66 | """ 67 | This function returns the model that subclasses BaseSection. 68 | Since it's that real, non-abstract model we usually want to 69 | deal with, this function will be used extensively in views and 70 | middlewares. 71 | """ 72 | model_path = EXTENDING_MODEL_PATH.split(".") 73 | model_name = model_path.pop() 74 | submodule = model_path[-1] 75 | import_path = ".".join(model_path) 76 | models = __import__(import_path, fromlist=[submodule]) 77 | return getattr(models, model_name) 78 | 79 | def get_treebeard_node_class(): 80 | """ 81 | This function returns the Treebeard node type specified in the 82 | ``TREEBEARD_NODE_TYPE`` value in this module or in the 83 | ``SCAFFOLD_TREEBEARD_NODE_TYPE`` value in the main project settings 84 | file. Allowed values are: 85 | 86 | 'treebeard.mp_tree.MP_Node' 87 | 'treebeard.al_tree.AL_Node' 88 | 'treebeard.ns_tree.NS_Node' 89 | 90 | Refer to the treebeard docs for an explanation of each type. 91 | 92 | """ 93 | allowed_node_types = ( 94 | 'treebeard.mp_tree.MP_Node', 95 | 'treebeard.al_tree.AL_Node', 96 | 'treebeard.ns_tree.NS_Node', 97 | ) 98 | if TREEBEARD_NODE_TYPE not in allowed_node_types: 99 | raise ImproperlyConfigured, ( 100 | "The SCAFFOLD_TREEBEARD_NODE_TYPE setting must be one of the " 101 | "following: %s." 102 | ) % ", ".join(allowed_node_types) 103 | try: 104 | klass_name = re.search('\.(\w*)$', TREEBEARD_NODE_TYPE).groups()[0] 105 | except AttributeError: 106 | raise ImproperlyConfigured, ( 107 | "The SCAFFOLD_TREEBEARD_NODE_TYPE setting could not be parsed" 108 | ) 109 | module_name = TREEBEARD_NODE_TYPE.replace("." + klass_name, '') 110 | try: 111 | module = import_module(module_name) 112 | except ImportError: 113 | raise ImproperlyConfigured, ( 114 | "The module %s could not be imported. Please check your " 115 | "SCAFFOLD_TREEBEARD_NODE_TYPE setting." 116 | ) % module_name 117 | if not hasattr(module, klass_name): 118 | raise ImproperlyConfigured, ( 119 | "The class %s could not be found in the module %s. Please check " 120 | "your SCAFFOLD_TREEBEARD_NODE_TYPE setting." 121 | ) % (klass_name, module_name) 122 | return getattr(module, klass_name) 123 | -------------------------------------------------------------------------------- /scaffold/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | 3 | import app_settings 4 | 5 | class SectionForm(forms.ModelForm): 6 | """ 7 | Form for working with ``BaseSection``-inheriting models. 8 | Saving new items is disabled. 9 | """ 10 | 11 | class Meta: 12 | model = app_settings.get_extending_model() 13 | exclude = ('path', 'depth', 'numchild', 'order') 14 | 15 | def save(self, *args, **kwargs): 16 | """ 17 | We're overriding this because we don't want to use Django's ORM to 18 | create new nodes. Django-treebeard has it's own node creation methods 19 | which should be used instead. To make sure no one actually uses this 20 | ``ModelForm`` to do that, calling it's save method will raise a 21 | ``NotImplemented`` exception, **unless an instance has been supplied**. 22 | In that case, we're just updating an existing node, so using the ORM to 23 | save is fine. 24 | """ 25 | if hasattr(self, 'instance') and self.instance: 26 | return super(SectionForm, self).save(*args, **kwargs) 27 | raise NotImplementedError, ( 28 | "Use django-treebeard's native methods to create new nodes." 29 | ) -------------------------------------------------------------------------------- /scaffold/locale/es/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/locale/es/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /scaffold/locale/es/LC_MESSAGES/django.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: PACKAGE VERSION\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2012-12-28 16:13-0600\n" 12 | "PO-Revision-Date: 2012-12-28 16:13\n" 13 | "Last-Translator: \n" 14 | "Language-Team: LANGUAGE \n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Language: \n" 19 | "Plural-Forms: nplurals=2; plural=(n != 1)\n" 20 | "X-Translated-Using: django-rosetta 0.6.8\n" 21 | 22 | #: admin.py:380 23 | #, python-format 24 | msgid "Add %s" 25 | msgstr "Agregar %s" 26 | 27 | #: admin.py:445 admin.py:607 28 | #, python-format 29 | msgid "%(name)s object with primary key %(key)r does not exist." 30 | msgstr "%(name)s objeto con llave primeria %(key)r no existe." 31 | 32 | #: models.py:18 templates/scaffold/admin/change_form.html:51 33 | msgid "Title" 34 | msgstr "Título" 35 | 36 | #: models.py:19 37 | msgid "Slug" 38 | msgstr "Slug" 39 | 40 | #: models.py:20 41 | msgid "Used to construct URL" 42 | msgstr "Usado para construir la URL" 43 | 44 | #: models.py:23 45 | msgid "Order of section" 46 | msgstr "Orden de sección" 47 | 48 | #: templates/scaffold/admin/add.html:10 49 | #: templates/scaffold/admin/change_form.html:5 50 | #: templates/scaffold/admin/delete.html:15 51 | #: templates/scaffold/admin/index.html:16 52 | #: templates/scaffold/admin/move.html:13 53 | #: templates/scaffold/admin/order_all_content.html:13 54 | #: templates/scaffold/admin/related_content.html:13 55 | msgid "Home" 56 | msgstr "Inicio" 57 | 58 | #: templates/scaffold/admin/add.html:13 59 | msgid "Add" 60 | msgstr "Agregar" 61 | 62 | #: templates/scaffold/admin/add.html:19 63 | msgid "Belonging to the" 64 | msgstr "Perteneciente a" 65 | 66 | #: templates/scaffold/admin/add.html:26 67 | #: templates/scaffold/admin/change_form.html:19 68 | msgid "Please correct the error below." 69 | msgid_plural "Please correct the errors below." 70 | msgstr[0] "Por favor corrija los siguientes errores." 71 | msgstr[1] "Por favor corrija el siguiente error." 72 | 73 | #: templates/scaffold/admin/change_form.html:47 74 | msgid "Items Belonging to this" 75 | msgstr "Items Pertenecientes a" 76 | 77 | #: templates/scaffold/admin/change_form.html:52 78 | msgid "Date" 79 | msgstr "Fecha" 80 | 81 | #: templates/scaffold/admin/change_form.html:53 82 | msgid "Content Type" 83 | msgstr "Tipo de contenido" 84 | 85 | #: templates/scaffold/admin/change_form.html:67 86 | msgid "No objects assigned to the" 87 | msgstr "No hay objetos asignados a este(a)" 88 | 89 | #: templates/scaffold/admin/delete.html:19 90 | #: templates/scaffold/admin/submit_line.html:3 91 | msgid "Delete" 92 | msgstr "Eliminar" 93 | 94 | #: templates/scaffold/admin/index.html:25 95 | msgid "Add a top-level" 96 | msgstr "Agregar de primer nivel" 97 | 98 | #: templates/scaffold/admin/move.html:17 99 | msgid "Move" 100 | msgstr "Mover" 101 | 102 | #: templates/scaffold/admin/order_all_content.html:17 103 | msgid "Order content" 104 | msgstr "Ordenar contenido" 105 | 106 | #: templates/scaffold/admin/related_content.html:17 107 | msgid "Related content" 108 | msgstr "Contenido relacionado" 109 | 110 | #: templates/scaffold/admin/submit_line.html:4 111 | msgid "Move this" 112 | msgstr "Mover este" 113 | 114 | #: templates/scaffold/admin/submit_line.html:5 115 | msgid "Order content of" 116 | msgstr "Ordenar contenido de" 117 | 118 | #: templates/scaffold/admin/submit_line.html:6 119 | msgid "Save" 120 | msgstr "Guardar" 121 | 122 | #: templates/scaffold/admin/submit_line.html:7 123 | msgid "Save as new" 124 | msgstr "Guardar como nuevo" 125 | 126 | #: templates/scaffold/admin/submit_line.html:8 127 | msgid "Save and add another" 128 | msgstr "Guardar y agregar otro" 129 | 130 | #: templates/scaffold/admin/submit_line.html:9 131 | msgid "Save and continue editing" 132 | msgstr "Guardar y continuar editando" 133 | -------------------------------------------------------------------------------- /scaffold/middleware.py: -------------------------------------------------------------------------------- 1 | from django.core.cache import cache 2 | from django.core.exceptions import MiddlewareNotUsed 3 | from django.db.models.signals import post_save, post_delete 4 | 5 | import app_settings 6 | 7 | 8 | # Import and work-around for python < 2.4 9 | try: 10 | from threading import local 11 | except ImportError: 12 | from django.utils._threading_local import local 13 | _thread_locals = local() 14 | 15 | def _build_section_path_map(): 16 | """ 17 | Simple wrapper around Django's low level cache; stores and populates 18 | a list of all section urls using the low-level caching framework. 19 | """ 20 | paths = {} 21 | Section = app_settings.get_extending_model() 22 | for section in Section.objects.all(): 23 | paths[section.full_path] = section.slug 24 | cache.set(app_settings.PATH_CACHE_KEY, paths, app_settings.PATH_CACHE_TTL) 25 | return paths 26 | 27 | def _get_section_path_map(): 28 | """ 29 | Simple wrapper around Django's low level cache; retrieves (and, if 30 | necessary, first populates) a list of all section urls using. 31 | """ 32 | paths = cache.get(app_settings.PATH_CACHE_KEY) 33 | if not paths: 34 | paths = _build_section_path_map() 35 | cache.set( 36 | app_settings.PATH_CACHE_KEY, 37 | paths, app_settings.PATH_CACHE_TTL 38 | ) 39 | return paths 40 | 41 | def get_current_section(): 42 | """ 43 | Convenience function to get the current section from the thread of the 44 | currently executing request, assuming there is one. If not, returns None. 45 | NB: Make sure that the SectionsMiddleware is enabled before calling this 46 | function. If it is not enabled, this function will raise a 47 | MiddlewareNotUsed exception. 48 | 49 | """ 50 | if not getattr(_thread_locals, 'scaffold_middleware_enabled', None): 51 | raise MiddlewareNotUsed, ( 52 | 'SectionsMiddleware is not used in this server configuration. ' 53 | 'Please enable the SectionsMiddleware.' 54 | ) 55 | return getattr(_thread_locals, 'section', None) 56 | 57 | def lookup_section(lookup_from): 58 | """ 59 | NB: `lookup_from` may either be an HTTP request, or a string representing an 60 | integer. 61 | """ 62 | Section = app_settings.get_extending_model() 63 | if lookup_from.__class__.__name__ == "WSGIRequest": 64 | path_map = _get_section_path_map() 65 | section_paths = path_map.keys() 66 | # Sort by shortest path to longest. 67 | section_paths.sort(lambda x, y: len(x) <= len(y) and 1 or -1) 68 | # Strips leading and trailing slashes 69 | path = lookup_from.path.strip("/") 70 | path_matches = [p for p in section_paths if path.startswith(p)] 71 | if len(path_matches) >= 1 and path_map.has_key(path): 72 | if app_settings.VALIDATE_GLOBALLY_UNIQUE_SLUGS: 73 | # If slugs have to be globally unique, we can shortcut to a 74 | # more efficient query. 75 | return Section.objects.get(slug=path_map[path]) 76 | else: 77 | # If slugs are not unique, then we need to search through all 78 | # matches for the slug that actually matches our path. 79 | sections = Section.objects.filter(slug=path_map[path]) 80 | if len(sections) == 1: 81 | return sections[0] 82 | else: 83 | for section in sections: 84 | if section.full_path == path: 85 | return section 86 | return None 87 | else: 88 | try: 89 | return Section.objects.get(pk=int(lookup_from)) 90 | except Section.DoesNotExist: 91 | return None 92 | 93 | class SectionsMiddleware(object): 94 | """ 95 | Middleware that stores the current section (if any) in the thread of the 96 | currently executing request 97 | """ 98 | 99 | def process_request(self, request): 100 | """ 101 | Determine the section from the request and store it in the currently 102 | executing thread where anyone can grab it (remember, in Django, 103 | there's one request per thread).""" 104 | section = lookup_section(request) 105 | _thread_locals.scaffold_middleware_enabled = True 106 | _thread_locals.section = section 107 | 108 | def reset_section_path_map(sender, **kwargs): 109 | _build_section_path_map() 110 | 111 | # Rebuild path map when a section is saved or removed. 112 | # See http://code.djangoproject.com/wiki/[...] 113 | # Signals#Helppost_saveseemstobeemittedtwiceforeachsave 114 | # for an explanation of why dispatch_uid is needed. 115 | post_save.connect(reset_section_path_map, 116 | sender=app_settings.get_extending_model(), 117 | dispatch_uid="paths-reset" 118 | ) 119 | post_delete.connect(reset_section_path_map, 120 | sender=app_settings.get_extending_model(), 121 | dispatch_uid="paths-reset" 122 | ) 123 | -------------------------------------------------------------------------------- /scaffold/models.py: -------------------------------------------------------------------------------- 1 | from django.contrib.contenttypes.models import ContentType 2 | from django.contrib.contenttypes import generic 3 | from django.db import models 4 | from django.utils.translation import ugettext_lazy as _ 5 | 6 | from treebeard.mp_tree import MP_Node 7 | 8 | import app_settings 9 | 10 | Treebeard_Base_Class = app_settings.get_treebeard_node_class() 11 | 12 | class BaseSection(Treebeard_Base_Class): 13 | """ 14 | An abstract model of a section or subsection. This class provides a base 15 | level of functionality that should serve as scaffold for a custom section 16 | object. 17 | """ 18 | title = models.CharField(_("Title"), max_length=255) 19 | slug = models.SlugField(_("Slug"), 20 | help_text=_("Used to construct URL"), 21 | unique = app_settings.VALIDATE_GLOBALLY_UNIQUE_SLUGS 22 | ) 23 | order = models.IntegerField(_("Order of section"), blank=True, default=0) 24 | 25 | class Meta: 26 | abstract = True 27 | permissions = ( 28 | ('can_view_associated_content', 'Can view associated content',), 29 | ) 30 | ordering = ['path'] 31 | 32 | def __unicode__(self): 33 | indent_string = "-" * (self.get_depth() - 1) 34 | return indent_string + self.title 35 | 36 | @property 37 | def full_path(self): 38 | section_path = [node.slug for node in self.get_ancestors()] 39 | section_path.append(self.slug) 40 | return "/".join(section_path) 41 | 42 | @models.permalink 43 | def get_absolute_url(self): 44 | return ("section", (), {'section_path': self.full_path}) 45 | 46 | @property 47 | def type(self): 48 | """ 49 | A property that returns the string 'section' if the section is at the 50 | root of the tree, 'subsection' otherwise. 51 | """ 52 | return self.is_root and 'section' or 'subsection' 53 | 54 | def get_first_populated_field(self, field_name): 55 | """ 56 | Returns the first non-empty instance of the given field in the 57 | sections tree. Will crawl from leaf to root, returning `None` if no 58 | non-empty field is encountered. 59 | """ 60 | assert hasattr(self, field_name), "Field name does not exist." 61 | node = self 62 | if getattr(node, field_name, None): 63 | return getattr(node, field_name) 64 | while not node.is_root(): 65 | node = node.get_parent() 66 | if getattr(node, field_name, None): 67 | return getattr(node, field_name) 68 | return None 69 | 70 | def get_related_content(self, sort_fields=[], infer_sort=False): 71 | """ 72 | A method to access content associated with a section via a foreign-key 73 | relationship of any type. This includes content that's attached via a 74 | simple foreign key relationship, and content that's attached via a 75 | generic foreign key (for example, through a subclass of the 76 | SectionItem model). 77 | 78 | This method returns a list of tuples:: 79 | 80 | (object, app name, model name, relationship_type) 81 | 82 | To sort associated content, pass a list of sort fields in via the 83 | sort_fields argument. For example, let's say we have two types of 84 | content we know could be attached to a section: articles and profiles 85 | Articles should be sorted by their 'headline' field, while profiles 86 | should be sorted by their 'title' field. We would call our method 87 | thusly:: 88 | 89 | section = Section.objects.all()[0] 90 | section.get_related_content(sort_fields=['title', 'headline']) 91 | 92 | This will create a common sort key on all assciated objects based on 93 | the first of these fields that are present on the object, then sort 94 | the entire set based on that sort key. (NB: This key is temporary and 95 | is removed from the items before they are returned.) 96 | 97 | If 'infer_sort' is True, this will override the sort_fields options 98 | and select each content type's sort field based on the first item in 99 | the 'ordering' property of it's Meta class. Obviously, infer_sort will 100 | only work if the types of fields that are being compared are the same. 101 | 102 | """ 103 | associated_content = [] 104 | object_ids = [] 105 | if infer_sort: 106 | sort_fields = set() 107 | for rel in self._meta.get_all_related_objects(): 108 | try: 109 | fk_items = getattr(self, rel.get_accessor_name()) 110 | except self.DoesNotExist: 111 | continue 112 | else: 113 | for fk_item in fk_items.all(): 114 | # If this is a generic relation, fetch content object. 115 | if hasattr(fk_item, 'content_object'): 116 | fk_item = fk_item.content_object 117 | relationship_type = 'generic-foreign-key' 118 | else: 119 | relationship_type = 'foreign-key' 120 | # In the weird edge-case where an item is related to a 121 | # section in more than one way, we only want the item to 122 | # appear in this list once. Therefore, we ID items by app, 123 | # model and pk and verify we haven't already seen that ID 124 | # before adding the item to our list. 125 | object_id = "%s/%s/%s" % ( 126 | fk_item._meta.app_label, 127 | fk_item._meta.object_name, 128 | str(fk_item.pk) 129 | ) 130 | if object_id not in object_ids: 131 | object_ids.insert(0, object_id) 132 | associated_content.insert(0,( 133 | fk_item, 134 | fk_item._meta.app_label, 135 | fk_item._meta.object_name, 136 | relationship_type 137 | )) 138 | if infer_sort and len(fk_item._meta.ordering) > 0: 139 | sort_fields.add(fk_item._meta.ordering[0]) 140 | if not len(sort_fields) == 0: 141 | for item, app, model, rel in associated_content: 142 | for sort_field in sort_fields: 143 | if hasattr(item, sort_field): 144 | key = getattr(item, sort_field) 145 | setattr(item, '_associated_content_tmp_sort_key', key) 146 | break 147 | 148 | def sort_content(x, y): 149 | return cmp( 150 | getattr(x[0], '_associated_content_tmp_sort_key', None), 151 | getattr(y[0], '_associated_content_tmp_sort_key', None) 152 | ) 153 | 154 | associated_content.sort(sort_content) 155 | for item in associated_content: 156 | if hasattr(item, '_associated_content_tmp_sort_key'): 157 | delattr(item, '_associated_content_tmp_sort_key') 158 | return associated_content 159 | 160 | def get_subsections(self): 161 | """ 162 | This method return all subsections of the current section. 163 | """ 164 | return self.get_children().select_related() 165 | 166 | def get_associated_content(self, only=[], sort_key=None): 167 | """ 168 | This method returns an aggregation of all content that's associated 169 | with a section, including subsections, and other objects related via 170 | any type of foreign key. To restrict the types of objetcs that are 171 | returned from foreign-key relationships, the only argument takes a 172 | list of items with the signature:: 173 | 174 | {app name}.{model name} 175 | 176 | For example, if you wanted to retrieve a list of all subsections and 177 | associated articles only, you could do the following:: 178 | 179 | section = Section.objects.all()[0] 180 | section.get_associated_content(only=['articles.article']) 181 | 182 | Furthermore, if all objects have a commone sort key, you can specify 183 | that with the sort_key parameter. So, since sections have an 'order' 184 | field, if articles had that field as well, you could do the following:: 185 | 186 | section = Section.objects.all()[0] 187 | section.get_associated_content( 188 | only=['articles.article'], 189 | sort_key='order' 190 | ) 191 | 192 | ...and the list returned would be sorted by the 'order' field. 193 | """ 194 | 195 | related_content = self.get_related_content() 196 | associated_content = [] 197 | if len(only) != 0: 198 | for obj, app, model, rel in related_content: 199 | if "%s.%s" % (app, model) in only: 200 | setattr(obj, 'content_type', "%s.%s" % (app, model)) 201 | associated_content.insert(0, ( 202 | obj, 203 | app, 204 | model, 205 | rel 206 | )) 207 | else: 208 | for obj, app, model, rel in related_content: 209 | setattr(obj, 'content_type', "%s.%s" % (app, model)) 210 | associated_content.insert(0, ( 211 | obj, 212 | app, 213 | model, 214 | rel 215 | )) 216 | for subsection in self.get_subsections(): 217 | app = subsection._meta.app_label 218 | model = subsection._meta.object_name 219 | if len(only) == 0 or app + "." + model in only: 220 | associated_content.insert(0, ( 221 | subsection, 222 | app, 223 | model, 224 | 'subsection' 225 | )) 226 | 227 | def sort_list(x, y): 228 | if not hasattr(x[0], sort_key): 229 | if not hasattr(y[0], sort_key): 230 | return x 231 | else: 232 | return y 233 | return cmp(getattr(x[0],sort_key),getattr(y[0],sort_key)) 234 | 235 | if sort_key: 236 | associated_content.sort(cmp=sort_list) 237 | return associated_content 238 | 239 | class SectionItem(models.Model): 240 | """A model of a generic relation between any item and a section""" 241 | section = models.ForeignKey('Section') 242 | content_type = models.ForeignKey(ContentType) 243 | object_id = models.PositiveIntegerField() 244 | content_object = generic.GenericForeignKey() 245 | 246 | class Meta: 247 | abstract = True 248 | 249 | def __unicode__(self): 250 | fk_app = self.content_object._meta.app_label 251 | fk_model = self.content_object.__class__.__name__ 252 | fk_str = self.content_object.__unicode__() 253 | return u"%s.%s: %s" % (fk_app, fk_model, fk_str) -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/bold.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/bold.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/changelist-filter-button-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/changelist-filter-button-bg.jpg -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/close.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/close.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/cms_toolbar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/cms_toolbar.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/cms_toolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/cms_toolbar.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/copy.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/copy.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/cut.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/cut.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/file_icons/flv.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/file_icons/flv.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/file_icons/gif.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/file_icons/gif.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/file_icons/html.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/file_icons/html.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/file_icons/java.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/file_icons/java.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/file_icons/jpg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/file_icons/jpg.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/file_icons/mp3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/file_icons/mp3.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/file_icons/ods.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/file_icons/ods.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/file_icons/odt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/file_icons/odt.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/file_icons/pdf.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/file_icons/pdf.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/file_icons/php.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/file_icons/php.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/file_icons/png.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/file_icons/png.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/file_icons/swf.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/file_icons/swf.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/file_icons/tgz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/file_icons/tgz.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/file_icons/ttf.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/file_icons/ttf.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/file_icons/txt.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/file_icons/txt.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/file_icons/txt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/file_icons/txt.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/file_icons/wav.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/file_icons/wav.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/file_icons/zip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/file_icons/zip.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/icon_extension.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/icon_extension.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/image.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/indicator.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/indicator.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/italic.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/italic.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/accordion-left-act.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/accordion-left-act.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/accordion-left-over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/accordion-left-over.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/accordion-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/accordion-left.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/accordion-middle-act.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/accordion-middle-act.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/accordion-middle-over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/accordion-middle-over.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/accordion-middle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/accordion-middle.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/accordion-right-act.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/accordion-right-act.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/accordion-right-over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/accordion-right-over.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/accordion-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/accordion-right.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/default-bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/default-bg.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/dialog-e.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/dialog-e.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/dialog-n.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/dialog-n.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/dialog-ne.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/dialog-ne.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/dialog-nw.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/dialog-nw.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/dialog-s.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/dialog-s.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/dialog-se.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/dialog-se.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/dialog-sw.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/dialog-sw.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/dialog-title.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/dialog-title.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/dialog-titlebar-close-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/dialog-titlebar-close-hover.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/dialog-titlebar-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/dialog-titlebar-close.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/dialog-w.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/dialog-w.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/nav-bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/nav-bg.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/resizable-e.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/resizable-e.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/resizable-n.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/resizable-n.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/resizable-ne.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/resizable-ne.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/resizable-nw.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/resizable-nw.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/resizable-s.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/resizable-s.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/resizable-se.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/resizable-se.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/resizable-sw.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/resizable-sw.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/resizable-w.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/resizable-w.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/slider-bg-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/slider-bg-1.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/slider-bg-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/slider-bg-2.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/slider-handle.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/slider-handle.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/jquery/tabs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/jquery/tabs.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/link.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/logo.jpg -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/page_find.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/page_find.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/pluginlist-delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/pluginlist-delete.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/pluginlist-holder-bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/pluginlist-holder-bg.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/plugins/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/plugins/file.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/plugins/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/plugins/image.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/plugins/link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/plugins/link.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/plugins/snippet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/plugins/snippet.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/sitemap-exim.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/sitemap-exim.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/sitemap-exlm.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/sitemap-exlm.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/sitemap-extm.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/sitemap-extm.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/sitemap-li-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/sitemap-li-bg.jpg -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/sitemap-li-drag.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/sitemap-li-drag.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/images/jstree/unordered.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/images/jstree/unordered.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/scripts/jstree/_lib/jquery.cookie.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Cookie plugin 3 | * 4 | * Copyright (c) 2006 Klaus Hartl (stilbuero.de) 5 | * Dual licensed under the MIT and GPL licenses: 6 | * http://www.opensource.org/licenses/mit-license.php 7 | * http://www.gnu.org/licenses/gpl.html 8 | * 9 | */ 10 | 11 | /** 12 | * Create a cookie with the given name and value and other optional parameters. 13 | * 14 | * @example $.cookie('the_cookie', 'the_value'); 15 | * @desc Set the value of a cookie. 16 | * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true }); 17 | * @desc Create a cookie with all available options. 18 | * @example $.cookie('the_cookie', 'the_value'); 19 | * @desc Create a session cookie. 20 | * @example $.cookie('the_cookie', null); 21 | * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain 22 | * used when the cookie was set. 23 | * 24 | * @param String name The name of the cookie. 25 | * @param String value The value of the cookie. 26 | * @param Object options An object literal containing key/value pairs to provide optional cookie attributes. 27 | * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. 28 | * If a negative value is specified (e.g. a date in the past), the cookie will be deleted. 29 | * If set to null or omitted, the cookie will be a session cookie and will not be retained 30 | * when the the browser exits. 31 | * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie). 32 | * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie). 33 | * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will 34 | * require a secure protocol (like HTTPS). 35 | * @type undefined 36 | * 37 | * @name $.cookie 38 | * @cat Plugins/Cookie 39 | * @author Klaus Hartl/klaus.hartl@stilbuero.de 40 | */ 41 | 42 | /** 43 | * Get the value of a cookie with the given name. 44 | * 45 | * @example $.cookie('the_cookie'); 46 | * @desc Get the value of a cookie. 47 | * 48 | * @param String name The name of the cookie. 49 | * @return The value of the cookie. 50 | * @type String 51 | * 52 | * @name $.cookie 53 | * @cat Plugins/Cookie 54 | * @author Klaus Hartl/klaus.hartl@stilbuero.de 55 | */ 56 | jQuery.cookie = function(name, value, options) { 57 | if (typeof value != 'undefined') { // name and value given, set cookie 58 | options = options || {}; 59 | if (value === null) { 60 | value = ''; 61 | options.expires = -1; 62 | } 63 | var expires = ''; 64 | if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { 65 | var date; 66 | if (typeof options.expires == 'number') { 67 | date = new Date(); 68 | date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); 69 | } else { 70 | date = options.expires; 71 | } 72 | expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE 73 | } 74 | // CAUTION: Needed to parenthesize options.path and options.domain 75 | // in the following expressions, otherwise they evaluate to undefined 76 | // in the packed version for some reason... 77 | var path = options.path ? '; path=' + (options.path) : ''; 78 | var domain = options.domain ? '; domain=' + (options.domain) : ''; 79 | var secure = options.secure ? '; secure' : ''; 80 | document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); 81 | } else { // only name given, get cookie 82 | var cookieValue = null; 83 | if (document.cookie && document.cookie != '') { 84 | var cookies = document.cookie.split(';'); 85 | for (var i = 0; i < cookies.length; i++) { 86 | var cookie = jQuery.trim(cookies[i]); 87 | // Does this cookie string begin with the name we want? 88 | if (cookie.substring(0, name.length + 1) == (name + '=')) { 89 | cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); 90 | break; 91 | } 92 | } 93 | } 94 | return cookieValue; 95 | } 96 | }; -------------------------------------------------------------------------------- /scaffold/static/scaffold/scripts/jstree/themes/django/bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/scripts/jstree/themes/django/bg.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/scripts/jstree/themes/django/bg_hover.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/scripts/jstree/themes/django/bg_hover.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/scripts/jstree/themes/django/d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/scripts/jstree/themes/django/d.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/scripts/jstree/themes/django/dot_for_ie.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/scripts/jstree/themes/django/dot_for_ie.gif -------------------------------------------------------------------------------- /scaffold/static/scaffold/scripts/jstree/themes/django/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/scripts/jstree/themes/django/icons.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/scripts/jstree/themes/django/style.css: -------------------------------------------------------------------------------- 1 | .jstree-django{ 2 | padding: 0 !important; 3 | } 4 | .jstree-django li{ 5 | background-image:url("d.png"); 6 | background-repeat:no-repeat; 7 | background-color:transparent; 8 | position: relative; 9 | margin-left: 0; 10 | } 11 | .jstree-django li li{ 12 | margin-left: 36px; 13 | } 14 | .jstree-django li > ins{ 15 | position: absolute; 16 | top: 0px; 17 | left: 0; 18 | } 19 | .jstree-django li > span{ 20 | display: block; 21 | background: #FFF url("bg_hover.gif") repeat-x bottom; 22 | margin: -1px 0 -1px 24px; 23 | padding: 7px 12px 0; 24 | height: 24px; 25 | font-size: 12px !important; 26 | border: 1px solid #D0D0D0; 27 | } 28 | .jstree-django li > span.hover{ 29 | background-image: url(bg.gif); 30 | color: #222; 31 | } 32 | .jstree-django li > span.hover small{ 33 | font-weight: normal; 34 | color: #444; 35 | } 36 | .jstree-django li > span ins{ 37 | display: none; 38 | } 39 | .jstree-django li > span a{ 40 | color: #555; 41 | } 42 | .jstree-django li > span a small{ 43 | color: #777; 44 | } 45 | .jstree-django li > span a:hover{ 46 | text-decoration: underline; 47 | } 48 | .jstree-django li > span .jstree-search{ 49 | font-weight: bold; 50 | color: #000; 51 | } 52 | .jstree-django li > span .jstree-search small{ 53 | font-weight: normal; 54 | } 55 | .jstree-django li > .links{ 56 | position: absolute; 57 | top: 1px; 58 | right: 0; 59 | height: 23px; 60 | padding: 8px 12px 0; 61 | border-left: 1px solid #E0E0E0; 62 | background: rgba(238, 238, 238, 0.33); 63 | } 64 | .jstree-django li > .links ins{ 65 | display: none; 66 | } 67 | .jstree-django li > .links a{ 68 | float: left; 69 | display: block; 70 | padding-left: 20px; 71 | height: 16px; 72 | padding-right: 10px; 73 | margin-right: 10px; 74 | border-right: 1px solid #CCC; 75 | background-image: url(icons.png); 76 | background-repeat: no-repeat; 77 | color: #444; 78 | } 79 | .jstree-django li > .links a.deletelink{ 80 | background-position: 0 -60px; 81 | } 82 | .jstree-django li > .links a.addlink{ 83 | background-position: 0 -30px; 84 | } 85 | .jstree-django li > .links a.listlink{ 86 | background-position: 0 -90px; 87 | } 88 | 89 | .jstree-django li > .links a:hover{ 90 | text-decoration: underline; 91 | } 92 | .jstree-django li > .links a:last-child{ 93 | margin-right: 0; 94 | padding-right: 0; 95 | border-right: none; 96 | } 97 | .jstree-django ins { 98 | background-image:url("d.png"); 99 | background-repeat:no-repeat; 100 | background-color:transparent; 101 | height: 22px; 102 | width: 22px; 103 | display: block; 104 | } 105 | 106 | 107 | .jstree-django li { 108 | background-position: -109px 0; 109 | background-repeat:repeat-y; 110 | } 111 | .jstree-django li.jstree-last{ 112 | background:transparent; 113 | } 114 | .jstree-django .jstree-open > ins { background-position: -88px 0; } 115 | .jstree-django .jstree-closed > ins { background-position: -67px 0; } 116 | .jstree-django .jstree-leaf > ins { background-position: -46px 0; } -------------------------------------------------------------------------------- /scaffold/static/scaffold/scripts/scaffold-listview.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | 3 | // Show toolbar (only relevant with JS on) 4 | $('#toolbar').show(); 5 | 6 | // Create tree 7 | $("#node-list").jstree({ 8 | 'core': {}, 9 | 'plugins': ['themes', 'html_data', 'search', 'cookies'], 10 | 'themes': { 11 | 'theme': 'django', 12 | 'icons': false 13 | }, 14 | 'search': { 15 | 'case_insensitive': true 16 | } 17 | }) 18 | 19 | // Annotate search results 20 | .bind("search.jstree", function (e, data) { 21 | $('#changelist-search p').remove(); 22 | var l = data.rslt.nodes.length; 23 | $('

', { 24 | 'id': 'search-result', 25 | 'html': l + ' page' + ((l==1) ? '' : 's') + ' matching “' + data.args[0] + '” [x]' 26 | }).appendTo('#changelist-search') 27 | }); 28 | 29 | // Do the search thing 30 | $("#changelist-search").bind('submit', function(evt){ 31 | evt.preventDefault(); 32 | $("#node-list").jstree('search', $(this).find('input[type="text"]').val()); 33 | }); 34 | 35 | // Clearing the search 36 | $('#changelist-search p abbr').live('click', function(){ 37 | $("#node-list").jstree('clear_search'); 38 | $("#changelist-search") 39 | .find('input[type="text"]') 40 | .val('') 41 | .focus() 42 | .end() 43 | .find('p') 44 | .remove(); 45 | }); 46 | 47 | // Highlight row on hover (and on link list hover) 48 | $('.jstree li > span').mouseover(function(){ 49 | $(this).addClass('hover'); 50 | }).mouseout(function(){ 51 | $(this).removeClass('hover'); 52 | }); 53 | $('.jstree li > .links').mouseover(function(){ 54 | $(this).siblings('span').addClass('hover'); 55 | }).mouseout(function(){ 56 | $(this).siblings('span').removeClass('hover'); 57 | }); 58 | 59 | }); -------------------------------------------------------------------------------- /scaffold/static/scaffold/styles/jquery.ui.start/images/ui-bg_flat_55_999999_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/styles/jquery.ui.start/images/ui-bg_flat_55_999999_40x100.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/styles/jquery.ui.start/images/ui-bg_flat_75_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/styles/jquery.ui.start/images/ui-bg_flat_75_aaaaaa_40x100.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/styles/jquery.ui.start/images/ui-bg_glass_45_0078ae_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/styles/jquery.ui.start/images/ui-bg_glass_45_0078ae_1x400.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/styles/jquery.ui.start/images/ui-bg_glass_55_f8da4e_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/styles/jquery.ui.start/images/ui-bg_glass_55_f8da4e_1x400.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/styles/jquery.ui.start/images/ui-bg_glass_75_79c9ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/styles/jquery.ui.start/images/ui-bg_glass_75_79c9ec_1x400.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/styles/jquery.ui.start/images/ui-bg_gloss-wave_45_e14f1c_500x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/styles/jquery.ui.start/images/ui-bg_gloss-wave_45_e14f1c_500x100.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/styles/jquery.ui.start/images/ui-bg_gloss-wave_50_6eac2c_500x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/styles/jquery.ui.start/images/ui-bg_gloss-wave_50_6eac2c_500x100.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/styles/jquery.ui.start/images/ui-bg_gloss-wave_75_2191c0_500x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/styles/jquery.ui.start/images/ui-bg_gloss-wave_75_2191c0_500x100.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/styles/jquery.ui.start/images/ui-bg_inset-hard_100_fcfdfd_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/styles/jquery.ui.start/images/ui-bg_inset-hard_100_fcfdfd_1x100.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/styles/jquery.ui.start/images/ui-icons_0078ae_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/styles/jquery.ui.start/images/ui-icons_0078ae_256x240.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/styles/jquery.ui.start/images/ui-icons_056b93_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/styles/jquery.ui.start/images/ui-icons_056b93_256x240.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/styles/jquery.ui.start/images/ui-icons_d8e7f3_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/styles/jquery.ui.start/images/ui-icons_d8e7f3_256x240.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/styles/jquery.ui.start/images/ui-icons_e0fdff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/styles/jquery.ui.start/images/ui-icons_e0fdff_256x240.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/styles/jquery.ui.start/images/ui-icons_f5e175_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/styles/jquery.ui.start/images/ui-icons_f5e175_256x240.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/styles/jquery.ui.start/images/ui-icons_f7a50d_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/styles/jquery.ui.start/images/ui-icons_f7a50d_256x240.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/styles/jquery.ui.start/images/ui-icons_fcd113_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mazelife/django-scaffold/0a2fd2514be3b9bad6c6038b2e4ded6afc3bdff2/scaffold/static/scaffold/styles/jquery.ui.start/images/ui-icons_fcd113_256x240.png -------------------------------------------------------------------------------- /scaffold/static/scaffold/styles/jquery.ui.start/jquery.ui.css: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery UI CSS Framework 3 | * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) 4 | * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. 5 | */ 6 | 7 | /* Layout helpers 8 | ----------------------------------*/ 9 | .ui-helper-hidden { display: none; } 10 | .ui-helper-hidden-accessible { position: absolute; left: -99999999px; } 11 | .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } 12 | .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } 13 | .ui-helper-clearfix { display: inline-block; } 14 | /* required comment for clearfix to work in Opera \*/ 15 | * html .ui-helper-clearfix { height:1%; } 16 | .ui-helper-clearfix { display:block; } 17 | /* end clearfix */ 18 | .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } 19 | 20 | 21 | /* Interaction Cues 22 | ----------------------------------*/ 23 | .ui-state-disabled { cursor: default !important; } 24 | 25 | 26 | /* Icons 27 | ----------------------------------*/ 28 | 29 | /* states and images */ 30 | .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } 31 | 32 | 33 | /* Misc visuals 34 | ----------------------------------*/ 35 | 36 | /* Overlays */ 37 | .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } 38 | 39 | 40 | 41 | /* 42 | * jQuery UI CSS Framework 43 | * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) 44 | * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. 45 | * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=5px&bgColorHeader=2191c0&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=75&borderColorHeader=4297d7&fcHeader=eaf5f7&iconColorHeader=d8e7f3&bgColorContent=fcfdfd&bgTextureContent=06_inset_hard.png&bgImgOpacityContent=100&borderColorContent=a6c9e2&fcContent=222222&iconColorContent=0078ae&bgColorDefault=0078ae&bgTextureDefault=02_glass.png&bgImgOpacityDefault=45&borderColorDefault=77d5f7&fcDefault=ffffff&iconColorDefault=e0fdff&bgColorHover=79c9ec&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=448dae&fcHover=026890&iconColorHover=056b93&bgColorActive=6eac2c&bgTextureActive=12_gloss_wave.png&bgImgOpacityActive=50&borderColorActive=acdd4a&fcActive=ffffff&iconColorActive=f5e175&bgColorHighlight=f8da4e&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcd113&fcHighlight=915608&iconColorHighlight=f7a50d&bgColorError=e14f1c&bgTextureError=12_gloss_wave.png&bgImgOpacityError=45&borderColorError=cd0a0a&fcError=ffffff&iconColorError=fcd113&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=75&opacityOverlay=30&bgColorShadow=999999&bgTextureShadow=01_flat.png&bgImgOpacityShadow=55&opacityShadow=45&thicknessShadow=0px&offsetTopShadow=5px&offsetLeftShadow=5px&cornerRadiusShadow=5px 46 | */ 47 | 48 | 49 | /* Component containers 50 | ----------------------------------*/ 51 | .ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } 52 | .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } 53 | .ui-widget-content { border: 1px solid #a6c9e2; background: #fcfdfd url(images/ui-bg_inset-hard_100_fcfdfd_1x100.png) 50% bottom repeat-x; color: #222222; } 54 | .ui-widget-content a { color: #222222; } 55 | .ui-widget-header { border: 1px solid #4297d7; background: #2191c0 url(images/ui-bg_gloss-wave_75_2191c0_500x100.png) 50% 50% repeat-x; color: #eaf5f7; font-weight: bold; } 56 | .ui-widget-header a { color: #eaf5f7; } 57 | 58 | /* Interaction states 59 | ----------------------------------*/ 60 | .ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #77d5f7; background: #0078ae url(images/ui-bg_glass_45_0078ae_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; outline: none; } 61 | .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #ffffff; text-decoration: none; outline: none; } 62 | .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #448dae; background: #79c9ec url(images/ui-bg_glass_75_79c9ec_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #026890; outline: none; } 63 | .ui-state-hover a, .ui-state-hover a:hover { color: #026890; text-decoration: none; outline: none; } 64 | .ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #acdd4a; background: #6eac2c url(images/ui-bg_gloss-wave_50_6eac2c_500x100.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; outline: none; } 65 | .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #ffffff; outline: none; text-decoration: none; } 66 | 67 | /* Interaction Cues 68 | ----------------------------------*/ 69 | .ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fcd113; background: #f8da4e url(images/ui-bg_glass_55_f8da4e_1x400.png) 50% 50% repeat-x; color: #915608; } 70 | .ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #915608; } 71 | .ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a; background: #e14f1c url(images/ui-bg_gloss-wave_45_e14f1c_500x100.png) 50% top repeat-x; color: #ffffff; } 72 | .ui-state-error a, .ui-widget-content .ui-state-error a { color: #ffffff; } 73 | .ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #ffffff; } 74 | .ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } 75 | .ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; } 76 | .ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } 77 | 78 | /* Icons 79 | ----------------------------------*/ 80 | 81 | /* states and images */ 82 | .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_0078ae_256x240.png); } 83 | .ui-widget-content .ui-icon {background-image: url(images/ui-icons_0078ae_256x240.png); } 84 | .ui-widget-header .ui-icon {background-image: url(images/ui-icons_d8e7f3_256x240.png); } 85 | .ui-state-default .ui-icon { background-image: url(images/ui-icons_e0fdff_256x240.png); } 86 | .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_056b93_256x240.png); } 87 | .ui-state-active .ui-icon {background-image: url(images/ui-icons_f5e175_256x240.png); } 88 | .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_f7a50d_256x240.png); } 89 | .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_fcd113_256x240.png); } 90 | 91 | /* positioning */ 92 | .ui-icon-carat-1-n { background-position: 0 0; } 93 | .ui-icon-carat-1-ne { background-position: -16px 0; } 94 | .ui-icon-carat-1-e { background-position: -32px 0; } 95 | .ui-icon-carat-1-se { background-position: -48px 0; } 96 | .ui-icon-carat-1-s { background-position: -64px 0; } 97 | .ui-icon-carat-1-sw { background-position: -80px 0; } 98 | .ui-icon-carat-1-w { background-position: -96px 0; } 99 | .ui-icon-carat-1-nw { background-position: -112px 0; } 100 | .ui-icon-carat-2-n-s { background-position: -128px 0; } 101 | .ui-icon-carat-2-e-w { background-position: -144px 0; } 102 | .ui-icon-triangle-1-n { background-position: 0 -16px; } 103 | .ui-icon-triangle-1-ne { background-position: -16px -16px; } 104 | .ui-icon-triangle-1-e { background-position: -32px -16px; } 105 | .ui-icon-triangle-1-se { background-position: -48px -16px; } 106 | .ui-icon-triangle-1-s { background-position: -64px -16px; } 107 | .ui-icon-triangle-1-sw { background-position: -80px -16px; } 108 | .ui-icon-triangle-1-w { background-position: -96px -16px; } 109 | .ui-icon-triangle-1-nw { background-position: -112px -16px; } 110 | .ui-icon-triangle-2-n-s { background-position: -128px -16px; } 111 | .ui-icon-triangle-2-e-w { background-position: -144px -16px; } 112 | .ui-icon-arrow-1-n { background-position: 0 -32px; } 113 | .ui-icon-arrow-1-ne { background-position: -16px -32px; } 114 | .ui-icon-arrow-1-e { background-position: -32px -32px; } 115 | .ui-icon-arrow-1-se { background-position: -48px -32px; } 116 | .ui-icon-arrow-1-s { background-position: -64px -32px; } 117 | .ui-icon-arrow-1-sw { background-position: -80px -32px; } 118 | .ui-icon-arrow-1-w { background-position: -96px -32px; } 119 | .ui-icon-arrow-1-nw { background-position: -112px -32px; } 120 | .ui-icon-arrow-2-n-s { background-position: -128px -32px; } 121 | .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } 122 | .ui-icon-arrow-2-e-w { background-position: -160px -32px; } 123 | .ui-icon-arrow-2-se-nw { background-position: -176px -32px; } 124 | .ui-icon-arrowstop-1-n { background-position: -192px -32px; } 125 | .ui-icon-arrowstop-1-e { background-position: -208px -32px; } 126 | .ui-icon-arrowstop-1-s { background-position: -224px -32px; } 127 | .ui-icon-arrowstop-1-w { background-position: -240px -32px; } 128 | .ui-icon-arrowthick-1-n { background-position: 0 -48px; } 129 | .ui-icon-arrowthick-1-ne { background-position: -16px -48px; } 130 | .ui-icon-arrowthick-1-e { background-position: -32px -48px; } 131 | .ui-icon-arrowthick-1-se { background-position: -48px -48px; } 132 | .ui-icon-arrowthick-1-s { background-position: -64px -48px; } 133 | .ui-icon-arrowthick-1-sw { background-position: -80px -48px; } 134 | .ui-icon-arrowthick-1-w { background-position: -96px -48px; } 135 | .ui-icon-arrowthick-1-nw { background-position: -112px -48px; } 136 | .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } 137 | .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } 138 | .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } 139 | .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } 140 | .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } 141 | .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } 142 | .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } 143 | .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } 144 | .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } 145 | .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } 146 | .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } 147 | .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } 148 | .ui-icon-arrowreturn-1-w { background-position: -64px -64px; } 149 | .ui-icon-arrowreturn-1-n { background-position: -80px -64px; } 150 | .ui-icon-arrowreturn-1-e { background-position: -96px -64px; } 151 | .ui-icon-arrowreturn-1-s { background-position: -112px -64px; } 152 | .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } 153 | .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } 154 | .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } 155 | .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } 156 | .ui-icon-arrow-4 { background-position: 0 -80px; } 157 | .ui-icon-arrow-4-diag { background-position: -16px -80px; } 158 | .ui-icon-extlink { background-position: -32px -80px; } 159 | .ui-icon-newwin { background-position: -48px -80px; } 160 | .ui-icon-refresh { background-position: -64px -80px; } 161 | .ui-icon-shuffle { background-position: -80px -80px; } 162 | .ui-icon-transfer-e-w { background-position: -96px -80px; } 163 | .ui-icon-transferthick-e-w { background-position: -112px -80px; } 164 | .ui-icon-folder-collapsed { background-position: 0 -96px; } 165 | .ui-icon-folder-open { background-position: -16px -96px; } 166 | .ui-icon-document { background-position: -32px -96px; } 167 | .ui-icon-document-b { background-position: -48px -96px; } 168 | .ui-icon-note { background-position: -64px -96px; } 169 | .ui-icon-mail-closed { background-position: -80px -96px; } 170 | .ui-icon-mail-open { background-position: -96px -96px; } 171 | .ui-icon-suitcase { background-position: -112px -96px; } 172 | .ui-icon-comment { background-position: -128px -96px; } 173 | .ui-icon-person { background-position: -144px -96px; } 174 | .ui-icon-print { background-position: -160px -96px; } 175 | .ui-icon-trash { background-position: -176px -96px; } 176 | .ui-icon-locked { background-position: -192px -96px; } 177 | .ui-icon-unlocked { background-position: -208px -96px; } 178 | .ui-icon-bookmark { background-position: -224px -96px; } 179 | .ui-icon-tag { background-position: -240px -96px; } 180 | .ui-icon-home { background-position: 0 -112px; } 181 | .ui-icon-flag { background-position: -16px -112px; } 182 | .ui-icon-calendar { background-position: -32px -112px; } 183 | .ui-icon-cart { background-position: -48px -112px; } 184 | .ui-icon-pencil { background-position: -64px -112px; } 185 | .ui-icon-clock { background-position: -80px -112px; } 186 | .ui-icon-disk { background-position: -96px -112px; } 187 | .ui-icon-calculator { background-position: -112px -112px; } 188 | .ui-icon-zoomin { background-position: -128px -112px; } 189 | .ui-icon-zoomout { background-position: -144px -112px; } 190 | .ui-icon-search { background-position: -160px -112px; } 191 | .ui-icon-wrench { background-position: -176px -112px; } 192 | .ui-icon-gear { background-position: -192px -112px; } 193 | .ui-icon-heart { background-position: -208px -112px; } 194 | .ui-icon-star { background-position: -224px -112px; } 195 | .ui-icon-link { background-position: -240px -112px; } 196 | .ui-icon-cancel { background-position: 0 -128px; } 197 | .ui-icon-plus { background-position: -16px -128px; } 198 | .ui-icon-plusthick { background-position: -32px -128px; } 199 | .ui-icon-minus { background-position: -48px -128px; } 200 | .ui-icon-minusthick { background-position: -64px -128px; } 201 | .ui-icon-close { background-position: -80px -128px; } 202 | .ui-icon-closethick { background-position: -96px -128px; } 203 | .ui-icon-key { background-position: -112px -128px; } 204 | .ui-icon-lightbulb { background-position: -128px -128px; } 205 | .ui-icon-scissors { background-position: -144px -128px; } 206 | .ui-icon-clipboard { background-position: -160px -128px; } 207 | .ui-icon-copy { background-position: -176px -128px; } 208 | .ui-icon-contact { background-position: -192px -128px; } 209 | .ui-icon-image { background-position: -208px -128px; } 210 | .ui-icon-video { background-position: -224px -128px; } 211 | .ui-icon-script { background-position: -240px -128px; } 212 | .ui-icon-alert { background-position: 0 -144px; } 213 | .ui-icon-info { background-position: -16px -144px; } 214 | .ui-icon-notice { background-position: -32px -144px; } 215 | .ui-icon-help { background-position: -48px -144px; } 216 | .ui-icon-check { background-position: -64px -144px; } 217 | .ui-icon-bullet { background-position: -80px -144px; } 218 | .ui-icon-radio-off { background-position: -96px -144px; } 219 | .ui-icon-radio-on { background-position: -112px -144px; } 220 | .ui-icon-pin-w { background-position: -128px -144px; } 221 | .ui-icon-pin-s { background-position: -144px -144px; } 222 | .ui-icon-play { background-position: 0 -160px; } 223 | .ui-icon-pause { background-position: -16px -160px; } 224 | .ui-icon-seek-next { background-position: -32px -160px; } 225 | .ui-icon-seek-prev { background-position: -48px -160px; } 226 | .ui-icon-seek-end { background-position: -64px -160px; } 227 | .ui-icon-seek-first { background-position: -80px -160px; } 228 | .ui-icon-stop { background-position: -96px -160px; } 229 | .ui-icon-eject { background-position: -112px -160px; } 230 | .ui-icon-volume-off { background-position: -128px -160px; } 231 | .ui-icon-volume-on { background-position: -144px -160px; } 232 | .ui-icon-power { background-position: 0 -176px; } 233 | .ui-icon-signal-diag { background-position: -16px -176px; } 234 | .ui-icon-signal { background-position: -32px -176px; } 235 | .ui-icon-battery-0 { background-position: -48px -176px; } 236 | .ui-icon-battery-1 { background-position: -64px -176px; } 237 | .ui-icon-battery-2 { background-position: -80px -176px; } 238 | .ui-icon-battery-3 { background-position: -96px -176px; } 239 | .ui-icon-circle-plus { background-position: 0 -192px; } 240 | .ui-icon-circle-minus { background-position: -16px -192px; } 241 | .ui-icon-circle-close { background-position: -32px -192px; } 242 | .ui-icon-circle-triangle-e { background-position: -48px -192px; } 243 | .ui-icon-circle-triangle-s { background-position: -64px -192px; } 244 | .ui-icon-circle-triangle-w { background-position: -80px -192px; } 245 | .ui-icon-circle-triangle-n { background-position: -96px -192px; } 246 | .ui-icon-circle-arrow-e { background-position: -112px -192px; } 247 | .ui-icon-circle-arrow-s { background-position: -128px -192px; } 248 | .ui-icon-circle-arrow-w { background-position: -144px -192px; } 249 | .ui-icon-circle-arrow-n { background-position: -160px -192px; } 250 | .ui-icon-circle-zoomin { background-position: -176px -192px; } 251 | .ui-icon-circle-zoomout { background-position: -192px -192px; } 252 | .ui-icon-circle-check { background-position: -208px -192px; } 253 | .ui-icon-circlesmall-plus { background-position: 0 -208px; } 254 | .ui-icon-circlesmall-minus { background-position: -16px -208px; } 255 | .ui-icon-circlesmall-close { background-position: -32px -208px; } 256 | .ui-icon-squaresmall-plus { background-position: -48px -208px; } 257 | .ui-icon-squaresmall-minus { background-position: -64px -208px; } 258 | .ui-icon-squaresmall-close { background-position: -80px -208px; } 259 | .ui-icon-grip-dotted-vertical { background-position: 0 -224px; } 260 | .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } 261 | .ui-icon-grip-solid-vertical { background-position: -32px -224px; } 262 | .ui-icon-grip-solid-horizontal { background-position: -48px -224px; } 263 | .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } 264 | .ui-icon-grip-diagonal-se { background-position: -80px -224px; } 265 | 266 | 267 | /* Misc visuals 268 | ----------------------------------*/ 269 | 270 | /* Corner radius */ 271 | .ui-corner-tl { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; } 272 | .ui-corner-tr { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; } 273 | .ui-corner-bl { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; } 274 | .ui-corner-br { -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; } 275 | .ui-corner-top { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; } 276 | .ui-corner-bottom { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; } 277 | .ui-corner-right { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; } 278 | .ui-corner-left { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; } 279 | .ui-corner-all { -moz-border-radius: 5px; -webkit-border-radius: 5px; } 280 | 281 | /* Overlays */ 282 | .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_75_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } 283 | .ui-widget-shadow { margin: 5px 0 0 5px; padding: 0px; background: #999999 url(images/ui-bg_flat_55_999999_40x100.png) 50% 50% repeat-x; opacity: .45;filter:Alpha(Opacity=45); -moz-border-radius: 5px; -webkit-border-radius: 5px; } -------------------------------------------------------------------------------- /scaffold/static/scaffold/styles/scaffold-admin.css: -------------------------------------------------------------------------------- 1 | label { 2 | display: block; 3 | float: left; 4 | width: 89px; 5 | } 6 | 7 | fieldset.position-node { 8 | margin: 10px 0 20px 0; 9 | padding: 10px; 10 | width: 400px; 11 | } 12 | 13 | fieldset.position-node .notice { margin-top: 0;} 14 | 15 | fieldset.position-node * { 16 | width: auto; 17 | position: inline; 18 | } 19 | 20 | .button.left { 21 | display:block; 22 | float:left; 23 | padding:3px; 24 | margin-right: 10px; 25 | } 26 | 27 | .button.left.move { 28 | margin-left: 10px; 29 | } 30 | .form-row.last { border-bottom: 0px;} 31 | 32 | #image-preview { 33 | margin-left: 600px; 34 | margin-top: -30px; 35 | width: 200px; 36 | padding: 25px; 37 | border: 1px solid silver; 38 | } 39 | 40 | .notice { 41 | padding: 10px; 42 | margin: 10px 0; 43 | } 44 | 45 | #id_slug { width: 300px;} 46 | #id_title { width: 500px; } 47 | 48 | .item-order {margin: 20px;} 49 | 50 | /* Index Page */ 51 | #node-list li { 52 | font-size: 10px; 53 | list-style-type: none; 54 | } 55 | #node-list li span { font-size: 16px;} 56 | 57 | /* Sorting Page */ 58 | 59 | #sortable { 60 | padding: 0px; 61 | width: 650px; 62 | } 63 | #sortable li { padding: 5px;} 64 | #sortable li div { 65 | background: #fff; 66 | padding: 6px 20px; 67 | opacity: .7; 68 | -moz-opacity: .5; 69 | filter: alpha(opacity=50); 70 | } 71 | #sortable li h4, 72 | #sortable li h5 { padding: 2px; margin: 0px;} 73 | #sortable li h4, 74 | #sortable li h4 a { color: #666666; } 75 | #sortable li h4 { font-size: 1.3em;} 76 | #sortable .ui-state-highlight { height: 52px; } 77 | #sortable label { float: right; width: auto; margin-top: -30px;} 78 | 79 | /* Related Content Page */ 80 | 81 | .related-content th, 82 | .related-content td { font-size: 1.2em; padding: 8px; } 83 | 84 | /* Move Section Page */ 85 | 86 | .move-section label { width: auto;} 87 | 88 | .sections-preview { 89 | float: right; 90 | margin: -20px 10px 0 0; 91 | border: 1px dashed silver; 92 | padding: 10px; 93 | } 94 | .sections-preview .active { font-weight: bold; color: #a50300;} -------------------------------------------------------------------------------- /scaffold/static/scaffold/styles/scaffold-listview.css: -------------------------------------------------------------------------------- 1 | #toolbar{ 2 | display: none; 3 | border: 1px solid #CCC; 4 | border-width: 0 1px; 5 | } 6 | #changelist{ 7 | border-width: 1px 0 0; 8 | } 9 | #changelist #toolbar{ 10 | margin-bottom: -3px; 11 | border-bottom: 1px solid #CCC; 12 | } 13 | #changelist #node-list{ 14 | margin-bottom: 0; 15 | margin-left: 5px; 16 | } 17 | #changelist-search{} 18 | #changelist-search label{ 19 | width: auto; 20 | margin-right: 5px; 21 | position: relative; 22 | top: 4px; 23 | left: 2px; 24 | } 25 | #changelist-search p{ 26 | font-size: 11px; 27 | margin: 0; 28 | padding: 4px 0 3px 23px; 29 | color: #222; 30 | } 31 | #changelist-search p abbr{ 32 | font-weight: bold; 33 | border: none; 34 | margin: 0 2px; 35 | font-size: 115%; 36 | cursor: pointer; 37 | } 38 | #changelist-search p abbr:hover{ 39 | text-decoration: underline; 40 | } 41 | -------------------------------------------------------------------------------- /scaffold/templates/scaffold/admin/add.html: -------------------------------------------------------------------------------- 1 | {%extends "admin/change_form.html"%} 2 | {%load i18n admin_modify static %} 3 | {% load url from future %} 4 | {%block extrastyle%} 5 | {{ block.super }} 6 | 7 | 8 | {%endblock%} 9 | {%block breadcrumbs%}{%if not is_popup%} 10 |

16 | {%endif%}{%endblock%} 17 | {%block content%} 18 |
19 | {%if parent%} 20 |

{%trans "Belonging to the"%} {{model_label}} {{parent.title}}

21 | {%endif%} 22 |
23 | {% if is_popup %}{% endif %} 24 | {% csrf_token %} 25 | {% if errors %} 26 |

27 | {% blocktrans count errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} 28 |

29 | {{ adminform.form.non_field_errors }} 30 | {% endif %} 31 | {% for fieldset in adminform %} 32 | {% include "admin/includes/fieldset.html" %} 33 | {% endfor %} 34 | 35 | {% block after_field_sets %}{% endblock %} 36 | 37 | {% for inline_admin_formset in inline_admin_formsets %} 38 | {% include inline_admin_formset.opts.template %} 39 | {% endfor %} 40 | 41 | {% block after_related_objects %}{% endblock %} 42 | {%if parent.has_children%} 43 | {%with parent.get_children as children%} 44 |
45 | Position New {{model_label|capfirst}} 46 |

The {{model_label}} that you're adding this new {{model_label}} to already has 47 | {{children|pluralize:"a,some"}} sub-{{model_label}}{{children|pluralize}} 48 | ({%for child in children%}{{child.title}}{%if not forloop.last%}, {%endif%}{%endfor%} ). 49 | How do you want to position this new section in relation to {{children|pluralize:"it,them"}}?

50 | 62 |
63 | {%endwith%} 64 | {%endif%} 65 |
66 | 67 | 68 |
69 | 70 | {% if adminform and add %} 71 | 72 | {% endif %} 73 |
74 |
75 | {# JavaScript for prepopulated fields #} 76 | {% prepopulated_fields_js %} 77 | {%endblock%} 78 | -------------------------------------------------------------------------------- /scaffold/templates/scaffold/admin/change_form.html: -------------------------------------------------------------------------------- 1 | {% extends "admin/change_form.html" %} 2 | {% load i18n admin_modify sections %} 3 | {% load url from future %} 4 | {% block breadcrumbs %}{% if not is_popup %} 5 | 11 | {% endif %}{% endblock %} 12 | {% block content %}
13 | {% block object-tools %}{{block.super}}{% endblock %} 14 |
{% csrf_token %}{% block form_top %}{% endblock %} 15 |
16 | {% if is_popup %}{% endif %} 17 | {% if save_on_top %}{% submit_row %}{% endif %} 18 | {% if errors %} 19 |

20 | {% blocktrans count errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} 21 |

22 | {{ adminform.form.non_field_errors }} 23 | {% endif %} 24 | 25 | {% for fieldset in adminform %} 26 | {% include "admin/includes/fieldset.html" %} 27 | {% endfor %} 28 | 29 | {% block after_field_sets %}{% endblock %} 30 | 31 | {% for inline_admin_formset in inline_admin_formsets %} 32 | {% include inline_admin_formset.opts.template %} 33 | {% endfor %} 34 | 35 | {% block after_related_objects %}{% endblock %} 36 | 37 | {% submit_row %} 38 | 39 | {% if adminform and add %} 40 | 41 | {% endif %} 42 | 43 | {# JavaScript for prepopulated fields #} 44 | {% prepopulated_fields_js %} 45 |
46 |
47 | {%block related_content%} 48 |

{% trans "Items Belonging to this" %} {{model_label}}:

49 | 50 | 51 | 52 | {% trans "Title" %} 53 | {% trans "Date" %} 54 | {% trans "Content Type" %} 55 | 56 | 57 | 58 | {%for item, date, app, model, relationship_type, edit_url in related_content%} 59 | 60 | 63 | 64 | 65 | 66 | 67 | {%empty%} 68 | 69 | {%endfor%} 70 | 71 | 72 | 73 | 74 | {%endblock%} 75 | 76 | {% endblock %} 77 | 78 | -------------------------------------------------------------------------------- /scaffold/templates/scaffold/admin/delete.html: -------------------------------------------------------------------------------- 1 | {% extends "admin/delete_confirmation.html" %} 2 | {% load i18n static %} 3 | {% load url from future %} 4 | {% block extrastyle %} 5 | {{ block.super }} 6 | 7 | 13 | {%endblock%} 14 | {% block breadcrumbs %} 15 | 22 | {% endblock %} 23 | {% block content %} 24 |

Are you sure?

25 |

Are you sure you want to delete the {{model_label}} {{obj.title}} permanently?

26 | {%if not obj.is_leaf%} 27 | {%with obj.get_descendants as descendants%} 28 |
29 |

30 | Warning! This {{model_label}} contains {{descendants|length}} other 31 | sub-{%ifequal descendants|length 1%}{{model_label}}{%else%}{{model_label_plural}}{%endifequal%}: 32 |

33 |
    34 | {%for subobj in descendants%} 35 |
  • {{subobj.title}}
  • 36 | {%endfor%} 37 |
38 |

39 | If you delete the {{model_label}} "{{obj.title}}", {{descendants|length|pluralize:"this,these"}} 40 | {%ifequal descendants|length 1%}{{model_label}}{%else%}{{model_label_plural}}{%endifequal%} will be 41 | deleted as well! 42 |

43 |
44 | {%endwith%} 45 | {%endif%} 46 |
47 | {% csrf_token %} 48 | 49 |
50 | {% endblock %} -------------------------------------------------------------------------------- /scaffold/templates/scaffold/admin/includes/fieldset.html: -------------------------------------------------------------------------------- 1 |
2 | {% if fieldset.name %}

{{ fieldset.name }}

{% endif %} 3 | {% if fieldset.description %}
{{ fieldset.description|safe }}
{% endif %} 4 | {% for line in fieldset %} 5 |
6 | {{ line.errors }} 7 | {% for field in line %} 8 | 9 | {% if field.is_checkbox %} 10 | {{ field.field }}{{ field.label_tag }} 11 | {% else %} 12 | {{ field.label_tag }}{{ field.field }} 13 | {% endif %} 14 | {% if field.field.field.help_text %}

{{ field.field.field.help_text|safe }}

{% endif %} 15 |
16 | {% endfor %} 17 | 18 | {% endfor %} 19 |
-------------------------------------------------------------------------------- /scaffold/templates/scaffold/admin/index.html: -------------------------------------------------------------------------------- 1 | {% extends "admin/change_list.html" %} 2 | {% load i18n static %} 3 | {% load url from future %} 4 | 5 | {% block extrastyle %} 6 | {{ block.super }} 7 | 8 | 9 | 10 | 11 | 12 | 13 | {%endblock%} 14 | 15 | {% block breadcrumbs %} 16 | 21 | {% endblock %} 22 | 23 | {% block content %} 24 | {% block object-tools %} 25 | 28 | {%endblock%} 29 |
30 |
31 | 38 |
39 | {{node_list|safe}} 40 |
41 | {% endblock %} 42 | 43 | -------------------------------------------------------------------------------- /scaffold/templates/scaffold/admin/move.html: -------------------------------------------------------------------------------- 1 | {% extends "admin/change_form.html" %} 2 | {% load i18n static %} 3 | {% load url from future %} 4 | {% block extrastyle %} 5 | {{ block.super }} 6 | 7 | 11 | {%endblock%} 12 | {% block breadcrumbs %} 13 | 20 | {% endblock %} 21 | {% block content %} 22 |
23 |

Current {{model_label|capfirst}} Structure:

24 | {{preview|safe}} 25 |
26 |
27 | {% csrf_token %} 28 |