Mercurial > agora-palash
view templates/snippet/snippet_new.djhtml @ 46:b7c1c22fdfe8
Format code for 80 columns, add some js to static/ dir
author | Jordi Gutiérrez Hermoso <jordigh@gmail.com> |
---|---|
date | Sat, 31 Jul 2010 19:17:11 -0500 |
parents | f697817182d1 |
children | d48e8676b18f |
line wrap: on
line source
{% extends "snippet/base.djhtml" %} {% load i18n %} {% block title %}{% trans "New snippet" %}{% endblock %} {% block headline %}<h1>{% trans "Paste a new snippet" %}</h1>{% endblock %} {% block content %} <h2>{% trans "New snippet" %}</h2> {% include "snippet/snippet_form.djhtml" %} {% endblock %} {% block sidebar %} <h2>{% trans "DPASTE_HOMEPAGE_TITLE" %}</h2> <p>{% trans "DPASTE_HOMEPAGE_DESCRIPTION" %}</p> {% endblock %} {% block script_footer %} <script src="/static/jquery.min.js"></script> <script type="text/javascript"> jQuery(document).ready(function(){ {% if request.session.userprefs.display_all_lexer %} $('#guess_lexer_btn').click(function(){ $.getJSON('{% url snippet_guess_lexer %}', {'codestring': $('#id_content').val()}, function(data){ if(data.lexer == "unknown"){ $('#guess_lexer_btn').css('color', 'red'); }else{ $('#id_lexer').val(data.lexer); $('#guess_lexer_btn').css('color', 'inherit'); } }); }); {% endif %} }); </script> {% endblock %}