~justin-fathomdb/nova/justinsb-openstack-api-volumes

« back to all changes in this revision

Viewing changes to vendor/tornado/demos/appengine/templates/compose.html

  • Committer: Jesse Andrews
  • Date: 2010-05-28 06:05:26 UTC
  • Revision ID: git-v1:bf6e6e718cdc7488e2da87b21e258ccc065fe499
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{% extends "base.html" %}
 
2
 
 
3
{% block body %}
 
4
  <form action="{{ request.path }}" method="post" class="compose">
 
5
    <div style="margin-bottom:5px"><input name="title" type="text" class="title" value="{{ escape(entry.title) if entry else "" }}"/></div>
 
6
    <div style="margin-bottom:5px"><textarea name="markdown" rows="30" cols="40" class="markdown">{{ escape(entry.markdown) if entry else "" }}</textarea></div>
 
7
    <div>
 
8
      <div style="float:right"><a href="http://daringfireball.net/projects/markdown/syntax">{{ _("Syntax documentation") }}</a></div>
 
9
      <input type="submit" value="{{ _("Save changes") if entry else _("Publish post") }}" class="submit"/>
 
10
      &nbsp;<a href="{{ "/entry/" + entry.slug if entry else "/" }}">{{ _("Cancel") }}</a>
 
11
    </div>
 
12
    {% if entry %}
 
13
      <input type="hidden" name="key" value="{{ str(entry.key()) }}"/>
 
14
    {% end %}
 
15
    {{ xsrf_form_html() }}
 
16
  </form>
 
17
{% end %}
 
18
 
 
19
{% block bottom %}
 
20
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
 
21
  <script type="text/javascript">
 
22
  //<![CDATA[
 
23
 
 
24
    $(function() {
 
25
      $("input[name=title]").select();
 
26
      $("form.compose").submit(function() {
 
27
          var required = ["title", "markdown"];
 
28
          var form = $(this).get(0);
 
29
          for (var i = 0; i < required.length; i++) {
 
30
              if (!form[required[i]].value) {
 
31
                  $(form[required[i]]).select();
 
32
                  return false;
 
33
              }
 
34
          }
 
35
          return true;
 
36
      });
 
37
    });
 
38
 
 
39
  //]]>
 
40
  </script>
 
41
{% end %}
 
42