Skip to content

Commit

Permalink
Documentation. Using sphinx features to highlight what's important.
Browse files Browse the repository at this point in the history
  • Loading branch information
nagisa committed Dec 31, 2011
1 parent 2d66c2c commit bc6c27f
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 42 deletions.
6 changes: 4 additions & 2 deletions docs/index.rst
Expand Up @@ -25,8 +25,10 @@ Core Features
- Directory browsing,
- Admin applet (You can make Uploader appear in any admin page).

Core features requires no optional dependencies, however
:ref:`core_dependencies` are required.
.. note::

Core features requires no optional dependencies, however
:ref:`core_dependencies` are required.

Next steps
----------
Expand Down
8 changes: 1 addition & 7 deletions docs/user/additionalfeats.rst
Expand Up @@ -13,10 +13,4 @@ which helps you to thumbnailize your uploaded images.

Dialog box supports aspect ratio locking, selecting resizing mode (like ``bicubic``).

Dependency: ``PIL``

Installation:

::

$ pip install pil
Dependency: ``PIL``
28 changes: 17 additions & 11 deletions docs/user/adminapplet.rst
Expand Up @@ -3,23 +3,34 @@
Admin Applet
============

Making admin applet to work requires more work because application specific files should be edited.
.. warning::

BFM javascript file downloads all files it requires including newest version of
jQuery, so all ``$`` and ``jQuery`` variables defined before will be rewritten.
``django.jQuery`` variable won't change.

Firstly open your application, in which you want applet to appear, ``admin.py`` file.
Making admin applet to work requires more work because application specific files should be edited.

Add these just after imports
Firstly, open your application, in which you want applet to appear, ``admin.py``
file and these lines just after imports

::

from django.core.urlresolvers import reverse
from django.utils.functional import lazy
reverse_lazy = lazy(reverse, str)

.. note::

If you are using Django 1.4, you can just import it:
``from django.core.urlresolvers import reverse_lazy``.


Then in your ``SomethingAdmin`` class add another `class named Media <https://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-media-definitions>`_, if it doesn't exist yet.

After that add ``reverse_lazy('bfm_opt')`` into ``js`` tuple.
Finally, add ``reverse_lazy('bfm_opt')`` into ``js`` tuple of ``Media`` class.

In the end Media class should look something like this:
In the end ``Media`` class should look something like this:

::

Expand All @@ -31,9 +42,4 @@ In the end Media class should look something like this:

That's all. You're ready to see your applet in http://example.com/admin/application/model.

You may want to change some options, that changes behavior of Admin applet. You can see them in :ref:`uploader-settings`.

Notes
-----

BFM javascript file downloads all files it requires including newest version of jQuery, so all ``$`` and ``jQuery`` variables defined before will be rewritten. ``django.jQuery`` variable will be left in it's place.
You may want to change some options, that changes behavior of Admin applet. You can see them in :ref:`uploader-settings`.
15 changes: 14 additions & 1 deletion docs/user/install.rst
Expand Up @@ -18,7 +18,9 @@ And second to easiest is with ``easy_install``:

$ easy_install django_bfm

However using easy_install is discouraged. Why? `Read here <http://www.pip-installer.org/en/latest/other-tools.html#pip-compared-to-easy-install>`_.
.. note::

Using easy_install is discouraged. Why? `Read here <http://www.pip-installer.org/en/latest/other-tools.html#pip-compared-to-easy-install>`_.

GIT repository
--------------
Expand All @@ -31,6 +33,12 @@ Alternatively, you can clone and install from Github repository, where project i
$ cd django-bfm
$ python2 setup.py install

or with pip:

::

pip install -e git+git@github.com:simukis/django-bfm.git#egg=Package

.. _configure:

Configuration
Expand All @@ -47,6 +55,11 @@ to work with it.
#. Make sure you have `staticfiles enabled <https://docs.djangoproject.com/en/dev/howto/static-files/#basic-usage>`_ (`with context processor <https://docs.djangoproject.com/en/dev/howto/static-files/#with-a-context-processor>`_) and run `python manage.py collectstatic`,
#. Make sure, that static files are served correctly by your production server.

.. note::

You don't need to run collectstatic if you are working in develovepment
server. It serves files automatically.

Next steps
----------

Expand Down
32 changes: 16 additions & 16 deletions docs/user/intro.rst
Expand Up @@ -15,7 +15,7 @@ want, so I made my own filebrowser.
Why use BFM?
------------

#. You hate Flash, love HTML5, JavaScript and have modern browser.
#. You hate Flash, love HTML5, CSS3, JavaScript and have modern browser.
#. You want simple and fast interface for managing your files online.
#. You couldn't even make another two work. BFM is simple to setup.

Expand All @@ -32,22 +32,22 @@ Support tables, dependencies
Browser
-------

**Basic features** covers basic actions like file browsing, directory browsing.
Version, required to have full functionality of BFM. BFM itelf will still work
with older browser, but some things, like file uploading won't work.

**Advanced features** covers uploading, because that part uses most of modern features.
========================== ==========================
Browser Version
========================== ==========================
Chrome/Chromium 7 +
Firefox 5 +
Opera Not supported \*
IE 10 + \*
Safari 5.0 +
========================== ==========================

========================== ========================== ==========================
Browser Basic features (ver.) Advanced features (ver.)
========================== ========================== ==========================
Chrome/Chromium 1 7 +
Firefox ? 5 +
Opera ? Not supported \*
IE ? 10 + \*
Safari ? 5.0 +
========================== ========================== ==========================

\* Opera and IE 9 and below doesn't support `XHR2 <http://www.w3.org/TR/XMLHttpRequest2/>`_,
which is used to report upload status.
**\*** Opera and IE 9 and below doesn't support `XHR2 <http://www.w3.org/TR/XMLHttpRequest2/>`_,
which is used to upload files and report upload status.

.. _core_dependencies:

Expand All @@ -56,5 +56,5 @@ Core dependencies

BFM was only tested on Python 2.6 and Python 2.7, so it is safe to assume, that dependencies are as follows:

- Python 2.6 or 2.7
- Django 1.3
- Python: 2.6 or 2.7
- Django: 1.3 or 1.4
17 changes: 12 additions & 5 deletions docs/user/settingsvars.rst
Expand Up @@ -51,22 +51,24 @@ Default: ``20``
To make sure, that only authorized users fiddle with, BFM requires user to be logged in.
If user is not logged in, it will be redirected to login.

Please note, that this variable is same as Django `LOGIN_URL <https://docs.djangoproject.com/en/dev/ref/settings/#login-url>`_.
.. note::

This setting variable is same as Django
`LOGIN_URL <https://docs.djangoproject.com/en/dev/ref/settings/#login-url>`_.

.. _uploader-settings:

Uploader behaviour
------------------

You can control several aspects of uploader like files uploaded at once too.
You can control several aspects of uploader like files uploaded at once.

**BFM_ADMIN_UPLOAD_DIR**

Directory path relative to ``BFM_MEDIA_DIRECTORY``.

Tells BFM where to save files uploaded with :ref:`admin-applet`.

Example: ``admin_files/`` and files will be uploaded to ``/home/example.com/media/uploads/admin_files/``.
Example: ``admin_files/`` and files will be uploaded to ``{{BFM_MEDIA_DIRECTORY}}/admin_files/``.

Default: empty string.

Expand All @@ -77,4 +79,9 @@ Requires integer value.

Example: ``3``

Default: ``2``
Default: ``2``

.. note::

If you experiencing issues like dropped connections with uploader then set
this option to ``1``.

0 comments on commit bc6c27f

Please sign in to comment.