cmsplugin-googlesearch / examples / cms-2.0.2 / cmsplugin_googlesearch_example / templates / index.html

{% load cache cms_tags %}<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ lang }}" xml:lang="{{ lang }}" >
<head>
<title>{% page_attribute page_title %}</title>
<meta name="description" content="{% page_attribute meta_description %}"/>
<meta name="keywords" content="{% page_attribute meta_keywords %}"/>
<!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>-->
<script type="text/javascript" src="/media/cms/js/jquery.min.js"></script>
<style>
    .placeholder-editable {
        border:1px #bbb solid;
        background:#fff;
        min-height:1em;
        padding:5px;
        cursor:text;
        overflow:hidden;
        height:1%;
    }

    .placeholder-editable input {
        float:right;
        padding:4px 10px;
        margin-top:3px;
    }

    .placeholder-over, .edit {
        border:1px #999 solid;
        background:#5c705c;
        color:#fff;
        cursor: hand;
    }

    .edit {
        padding:5px;
    }

    body {
        font-family:sans-serif;
        font-size:75%;
        background:#b5b185;
        color:#333;
    }

    #main {
        width:600px;
        padding:20px;
        margin:0 auto;
        border:1px #999 solid;
        margin-bottom:40px;
        overflow:hidden;
        height:1%;
        background:#fffdca;
    }

    h1, h2 {
        border-bottom:1px #ddd solid;
        color:#a4b854;
    }

    a {
        color:#ff7959
    }

	ul.breadcrumb {
		clear:left;
		padding-bottom:30px;
		margin-left:-40px;
	}
	ul.breadcrumb li{
		float:left;
		margin-left:5px;
		list-style:none;
		}
	p.chooser a{
		text-decoration: none;
	}
	p.chooser a.current {
		text-decoration: underline;
	}
</style>
</head>
<body>

<div id="main">
<p style="float:right">
    {% if user.is_authenticated %}
        <a href="/admin/logout/">log out</a>
    {% else %}
        <a href="/admin/">log in</a>
    {% endif %}
</p>
<p class="chooser">
	See this page in: {% language_chooser %}
</p>
<h1>{% block title %}{% page_attribute title %}{% endblock %}</h1>

<h3>site: {{ site.name }}</h3>

<h2>Complete navigation</h2>

<ul>
	{% show_menu 0 100 100 100 %}
</ul>

<h2>Navigation with active tree</h2>
<ul>
	{% show_menu 0 100 0 100 %}
</ul>

<h2>Navigation with only 1 active extra level</h2>
<ul>
	{% show_menu 0 100 0 1 %}
</ul>

<h2>Level 0 navigation </h2>
<ul>
	{% show_menu 0 0 0 0 %}
</ul>

<h2>Level 1 navigation </h2>
<ul>
	{% show_menu 1 1 100 100 %}
</ul>

<h2>Level 1 navigation (only active tree)</h2>
<ul>
	{% show_menu 1 1 0 100 %}
</ul>

<h2>Level 0-1 navigation</h2>
<ul>
	{% show_menu 0 1 100 100 %}
</ul>

<h2>Display the sub menu (2 level deep) of the current page</h2>

<ul>
    {% show_sub_menu 1 %}
</ul>


<h2>Show the breadcrumb navigation of the current page</h2>
<ul class="breadcrumb">
{% page_attribute title %}
	{#% show_breadcrumb %#}
</ul>

<h2>Content</h2>
{% block content %}
    <div style="width:70%">
		<h3>title placeholder {% page_attribute title %}</h3>
		<div style="float:right;width:25%">
    		<h3>Right column placeholder</h3>
    		{% placeholder right-column %}
    	 </div>
        <div>
        	<h3>body placeholder</h3>
         	{% placeholder "body" %}
         </div>
    </div>
{% endblock %}

</div>

<script type="text/javascript">
    // quick and dirty edit in place example
    {% if has_change_permissions %}
        $('.placeholder').addClass('placeholder-editable');
    {% endif %}
    $('.placeholder-editable').mouseover(function() {
        $(this).addClass('placeholder-over');
    });
    $('.placeholder-editable').mouseout(function() {
        $(this).removeClass('placeholder-over');
    });
    $('.placeholder-editable').click(function() {
        var p = $(this);
        if(p.hasClass('edit')) {
            return false;
        }
        p.addClass('edit');
        var height = p.height()+20;
        var width = p.width()-10;
        p.html('<textarea style="width:'+width+'px;height:'+height+'px">'+ this.innerHTML +'</textarea><input type="submit" value="Save" />');
        $('input', p).click( function() {
            var content = $('textarea', p).val();
            $.post('/admin/cms/page/{{ current_page.id }}/modify-content/'+p.attr('id')+'/{{ lang }}/', {'content':content}, function(response) {
                if(response=="ok") {
                    p.html(content);
                    p.removeClass('edit');
                    p.removeClass('placeholder-over');
                } else {
                    alert("You need to authenticate to the admin to edit the content");
                }
            });
            return false;
        });
    });
</script>


</body>
</html>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.