{% extends "admin/base_site.html" %}
{% load i18n %}
{% block bodyclass %}grp-doc{% endblock %}
{% block content-class %}{% endblock %}
{% block title %}Grappelli Documentation &raquo; Object-Tools{% endblock %}

{% block extrahead %}
	<script type="text/javascript" charset="utf-8">
        (function($) {
            $(document).ready(function() {
                $("#grp-content-container .grp-group").grp_collapsible_group();
                $("#grp-content-container .grp-collapse").grp_collapsible({
                    on_init: function(elem, options) {
                        // open collapse (and all collapse parents) in case of errors
                        if (elem.find("ul.errorlist").length > 0) {
                            elem.removeClass("grp-closed")
                                .addClass("grp-open");
                            elem.parents(".grp-collapse")
                                .removeClass("grp-closed")
                                .addClass("grp-open");
                        }
                    }
                });
            });
        })(grp.jQuery);
	</script>
{% endblock %}

{% block breadcrumbs %}
    <ul>
        <li><a href="../">Grappelli Documentation</a></li>
        <li>Object-Tools</li>
    </ul>
{% endblock %}

{% block content %}
    <h1>Object-Tools</h1>
    <div class="g-d-c">
    	<div class="grp-doc-description">
	    	<p>The object-tools carry certain actions which apply directly to an object.</p>
	    </div>
    	<section>
	    	<div class="g-d-24">
		        <div class="grp-doc-description">
		            <h1>Location</h1>
	            	<p>They appear on the right-hand side within the <span class="grp-doc-class">#grp-content-title</span> and are used with changelists and changeforms.</p>
		        </div>
		    </div>
	    	<div class="g-d-24">
	    		<div class="grp-doc-code-source">
	    			<p class="h1 grp-font-color-quiet">Title of your object</p>
	    			<ul class="grp-object-tools">
				        <li><a href="">Object-Tools</a></li>
			        </ul>
				</div>
		    </div>
	    	<div class="g-d-24">
	    		<div class="grp-doc-code"><pre><code>{% filter force_escape %}
<header id="grp-content-title">
    <h1>Title of your object</h1>
    {% templatetag openblock %} block object-tools {% templatetag closeblock %}{% templatetag openblock %} endblock {% templatetag closeblock %}
</header>
{% endfilter %}</code></pre></div>
	    	</div>
	    </section>
    	<section>
	    	<div class="g-d-24">
		        <div class="grp-doc-description">
		            <h1>Basics</h1>
		            <p>The object-tools are defined in a <a href="https://docs.djangoproject.com/en/dev/ref/templates/builtins/#std:templatetag-block" target="_blank" class="grp-external">block</a> <span class="grp-doc-django">{% templatetag openblock %} block object-tools {% templatetag closeblock %}</span>.</p>
		            <p>They are always written as a <span class="grp-doc-dom"><span>ul.grp-object-tools</span></span> carrying another block <span class="grp-doc-django">{% templatetag openblock %} block object-tools-items {% templatetag closeblock %}</span> which contains <span class="grp-doc-dom"><span>li</span></span> and <span class="grp-doc-dom"><span>a</span></span> elements representing the object-tools options.</p>
		        </div>
		    </div>
	    	<div class="g-d-24">
	    		<div class="grp-doc-code-source">
	    			<p class="h1 grp-font-color-quiet">Title of your object</p>
	    			<ul class="grp-object-tools">
				        <li><a href="">Object-Tools Item</a></li>
			            <li><a href="">Object-Tools Item</a></li>
				    </ul>
				</div>
		    </div>
	    	<div class="g-d-24">
	    		<div class="grp-doc-code"><pre><code>{% filter force_escape %}
{% templatetag openblock %} block object-tools {% templatetag closeblock %}
    <ul class="grp-object-tools">
        {% templatetag openblock %} block object-tools-items {% templatetag closeblock %}
            <li><a href="">Object-Tools Item</a></li>
            <li><a href="">Object-Tools Item</a></li>
        {% templatetag openblock %} endblock {% templatetag closeblock %}
    </ul>
{% templatetag openblock %} endblock {% templatetag closeblock %}
{% endfilter %}</code></pre></div>
	    	</div>
	    </section>
	    <section>
	    	<div class="g-d-24">
		        <div class="grp-doc-description">
		            <h1>Item Types</h1>
		            <p>There are different types of items which might be defined by the use of classes for the <span class="grp-doc-dom"><span>a</span></span> elements. The very basic item is not further specified – it comes as a plain link.</p>
		            <p>The item for adding something (usually used on changelists) gets the class <span class="grp-doc-class">.grp-add-link</span>.</p>
		            <p>The item for viewing something outside the admin (usually used on changeforms) may get the class <span class="grp-doc-class">.grp-viewsite-link</span> but stylewise it is recognized by its <span class="grp-doc-class">target="_blank"</span>. All links with such a target are handled as external links.</p>
		        </div>
		    </div>
	    	<div class="g-d-24">
	    		<div class="grp-doc-code-source">
	    			<p class="h1 grp-font-color-quiet">Title of your object</p>
	    			<ul class="grp-object-tools">
				        <li><a href="#">History</a></li>
			            <li><a href="#" class="grp-add-link">Add something</a></li>
			            <li><a href="#" class="grp-viewsite-link">View on site (class)</a></li>
			            <li><a href="#" target="_blank">View on site (target)</a></li>
				    </ul>
				</div>
		    </div>
	    	<div class="g-d-24">
	    		<div class="grp-doc-code"><pre><code>{% filter force_escape %}
{% templatetag openblock %} block object-tools {% templatetag closeblock %}
    <ul class="grp-object-tools">
        {% templatetag openblock %} block object-tools-items {% templatetag closeblock %}
            <li><a href="#">History</a></li>
            <li><a href="#" class="grp-add-link">Add something</a></li>
            <li><a href="#" class="grp-viewsite-link">View on site</a></li>
            <li><a href="#" target="_blank">View on site</a></li>
        {% templatetag openblock %} endblock {% templatetag closeblock %}
    </ul>
{% templatetag openblock %} endblock {% templatetag closeblock %}
{% endfilter %}</code></pre></div>
	    	</div>
	    </section>
	    <section>
	    	<div class="g-d-24">
		        <div class="grp-doc-description">
		            <h1>Item States</h1>
		            <p>By default the items visually appear in a reduced state. <br />Add <span class="grp-doc-class">.grp-state-focus</span> to elements you want to characterize as major ones.</p>
		        </div>
		    </div>
	    	<div class="g-d-24">
	    		<div class="grp-doc-code-source">
	    			<p class="h1 grp-font-color-quiet">Title of your object</p>
	    			<ul class="grp-object-tools">
				        <li><a href="#">Item</a></li>
			            <li><a href="#" class="grp-add-link grp-state-focus">Focused Item</a></li>
				    </ul>
				</div>
		    </div>
	    	<div class="g-d-24">
	    		<div class="grp-doc-code"><pre><code>{% filter force_escape %}
{% templatetag openblock %} block object-tools {% templatetag closeblock %}
    <ul class="grp-object-tools">
        {% templatetag openblock %} block object-tools-items {% templatetag closeblock %}
            <li><a href="#">Item</a></li>
            <li><a href="#" class="grp-add-link grp-state-focus">Focused Item</a></li>
        {% templatetag openblock %} endblock {% templatetag closeblock %}
    </ul>
{% templatetag openblock %} endblock {% templatetag closeblock %}
{% endfilter %}</code></pre></div>
	    	</div>
	    </section>
	</div>
{% endblock %}