Rafał Pitoń 11 лет назад
Родитель
Сommit
675926d5bc

+ 2 - 2
docs/developers/forms.rst

@@ -71,7 +71,7 @@ Misago defines custom templates extension named ``misago_forms``. This extension
 form_row
 --------
 
-This tag accepts form field as its first argument, and rends field complete with label, help and errors. Accept two extra arguments: label class and field class, allowing you to control size of horizontal forms::
+This tag takes form field as its first argument and renders field complete with label, help and errors. Accept two extra arguments: label class and field class, allowing you to control size of horizontal forms::
 
 
     {% load misago_forms %}
@@ -83,4 +83,4 @@ This tag accepts form field as its first argument, and rends field complete with
 form_input
 ----------
 
-This tag accepts form field as its only argument, and rends it's input.
+This tag takes form field as its only argument and renders it's input.

+ 1 - 1
docs/developers/index.rst

@@ -44,8 +44,8 @@ Following references cover everything you want to know about writing your own ap
    markup
    settings
    shortcuts
+   template_tags
    thread_store
    user_sites
-   writing_templates
    validators
    views_errors

+ 71 - 0
docs/developers/template_tags.rst

@@ -0,0 +1,71 @@
+=======================
+Template Tags Reference
+=======================
+
+Misago defines plenty of custom tags and filters for use by template authors.
+
+
+misago_avatars
+=============
+
+``avatar`` filter
+-----------------
+
+Accepts user model instance or integer representing user's PK, returns link to avatar server that can be used as ``src`` attribute value for ``img``.
+
+Takes one optional argument, image size.
+
+
+``blankavatar`` tag
+-------------------
+
+Returns link to avatar blank avatar that can be used as ``src`` attribute value for ``img``. Should be used when no user pk is avaialable to render avatar, eg. displaying items belonging to deleted users.
+
+Takes one optional argument, image size.
+
+
+misago_capture
+==============
+
+``capture as`` tag
+------------------
+
+Captures part of template to variable that may then be displayed many more times.
+
+There is also trimmed flavour ``capture trimmed as`` that trims captured template part before assinging it to variable.
+
+
+misago_editor
+=============
+
+``editor_body`` tag
+-------------------
+
+Renders Misago Markup editor body in template. Requires one argument: variable containing editor instance.
+
+
+``editor_js`` tag
+-----------------
+
+Renders Misago Markup editor's javascript in template. Requires one argument: variable containing editor instance.
+
+
+misago_forms
+============
+
+``form_row`` tag
+----------------
+
+Takes form field as its first argument and renders field complete with label, help and errors. Accept two extra arguments: label class and field class, allowing you to control size of horizontal forms::
+
+
+    {% load misago_forms %}
+
+    {% form_row form.somefield %}
+    {% form_row form.otherfield 'col-md-3' 'col-md-9' %}
+
+
+``form_input`` tag
+------------------
+
+Takes form field as its only argument and renders it's input.

+ 0 - 28
docs/developers/writing_templates.rst

@@ -1,28 +0,0 @@
-=================
-Writing Templates
-=================
-
-Misago defines plenty of custom tags and filters for use by template authors.
-
-
-misago_avatars
-=============
-
-``avatar`` filter
------------------
-
-
-``blankavatar`` tag
--------------------
-
-
-misago_capture
-==============
-
-
-misago_editor
-=============
-
-
-misago_forms
-============

+ 1 - 1
docs/index.rst

@@ -33,8 +33,8 @@ Table of Contents
    developers/markup
    developers/settings
    developers/shortcuts
+   developers/template_tags
    developers/thread_store
    developers/user_sites
-   developers/writing_templates
    developers/validators
    developers/views_errors