Skip to content
This repository has been archived by the owner on Dec 25, 2019. It is now read-only.

Commit

Permalink
Add parsley. Form is still not working yet
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwizard committed Oct 31, 2013
1 parent 55e60e4 commit 79054a6
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 45 deletions.
7 changes: 7 additions & 0 deletions licenses/Parsley-license.txt
@@ -0,0 +1,7 @@
Copyright 2013 Guillaume Potier and contributors http://github.com/guillaumepotier/Parsley.js

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 changes: 22 additions & 0 deletions licenses/WTForms-ParsleyJS-license.txt
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2013, Johannes Gehrs

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

2 changes: 1 addition & 1 deletion src/app.yaml
@@ -1,4 +1,4 @@
application: flaskdemo
application: flaskgithub
version: 1
runtime: python27
api_version: 1
Expand Down
18 changes: 11 additions & 7 deletions src/application/templates/base.html
@@ -1,28 +1,32 @@
<!DOCTYPE html>
<html lang="en" class="no-js">
{% set bootstrap_version = '3.0.1' %}
{% set bootstrap_version = '3.0.0' %}
{% set modernizer_version = '2.6.2' %}
{% set jquery_version = '1.9.1' %}
{% set parsley_version = '1.1.16' %}
{% set awesome_version = '4.0.1' %}
{% set bootswatch_version = '3.0.0' %}
{% set bootswatch_theme = 'cyborg' %}

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
<title>{% block title%}Flask on App Engine{% endblock %}</title>
<link href="//netdna.bootstrapcdn.com/bootstrap/{{ bootstrap_version }}/css/bootstrap.min.css" rel="stylesheet" />
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/{{ awesome_version }}/css/font-awesome.min.css">
<style> body { padding-top: 90px; } </style> <!-- Bootstrap -->
<link href="//netdna.bootstrapcdn.com/font-awesome/{{ awesome_version }}/css/font-awesome.min.css" rel="stylesheet" >
<link href="//netdna.bootstrapcdn.com/bootswatch/{{ bootswatch_version }}/{{ bootswatch_theme }}/bootstrap.min.css" rel="stylesheet" >
<style> </style> <!-- Bootstrap -->
<link href="/static/css/main.css" rel="stylesheet" />
<link rel="shortcut icon" href="/static/img/favicon.ico" />
{% block style_block %}{# page-specific CSS #}{% endblock %}
<script src="//cdnjs.cloudflare.com/ajax/libs/modernizr/-{{ modernizer_version }}/modernizr.min.js"></script>{# Modernizr must be here, above body tag. #}
<script src="//cdnjs.cloudflare.com/ajax/libs/modernizr/{{ modernizer_version }}/modernizr.min.js"></script>{# Modernizr must be here, above body tag. #}
{% block head_script %}{# defer-incapable JS block #}{% endblock %}
</head>
<body>
<div id="header">

{% include 'includes/nav.html' %} {# pull in navbar #}
</div>

<div class="container" id="maincontent">
{% include 'includes/flash_message.html' %} {# page-level feedback notices #}
<div id="body_content">
Expand All @@ -36,7 +40,7 @@
</footer>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/{{ jquery_version }}/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/{{ bootstrap_version }}/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/parsley.js/{{ parsley_version }}parsley-standalone.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/parsley.js/{{ parsley_version }}/parsley-standalone.min.js"></script>
<script src="/static/js/main.js"></script>
{% block tail_script %}{# defer-capable JS block #}{% endblock %}
{{ profiler_includes|safe }}
Expand Down
83 changes: 48 additions & 35 deletions src/application/templates/includes/nav.html
@@ -1,35 +1,48 @@
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="/">Flask on App Engine</a>
<div class="nav-collapse">
<ul class="nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Dropdown Menu
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><a href="#">Item One</a></li>
<li><a href="#">Item Two</a></li>
</ul>
</li>
<li>
<a href="https://developers.google.com/appengine/docs/python/python27/using27">App Engine docs</a>
</li>
<li>
<a href="http://flask.pocoo.org/">Flask docs</a>
</li>
<li>
<a href="http://twitter.github.com/bootstrap">Bootstrap docs</a>
</li>
</ul>
</div><!--/.nav-collapse -->
</div><!-- /.navbar .container -->
</div><!-- /.navbar-inner -->
</div><!-- /navbar -->
<nav class="navbar navbar-default" role="navigation">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Flask on App Engine</a>
</div>

<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Link</a></li>
<li><a href="https://developers.google.com/appengine/docs/python/python27/using27">App Engine docs</a></li>
<li><a href="http://flask.pocoo.org/">Flask docs</a></li>
<li><a href="http://twitter.github.com/bootstrap">Bootstrap docs</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li><a href="#">Separated link</a></li>
<li class="divider"></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
</ul>

<ul class="nav navbar-nav navbar-right">
<li><a href="#">Link</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li><a href="#">Separated link</a></li>
</ul>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</nav>
6 changes: 5 additions & 1 deletion src/application/templates/list_examples.html
Expand Up @@ -52,10 +52,14 @@ <h1 id="">All Examples</h1>
</a>
</p>

{% include 'new_example.html' %} {# pull in new_example form (modal dialog) #}


{% endblock content %}

{% block footer %}
{% include 'new_example.html' %} {# pull in new_example form (modal dialog) #}
{% endblock footer %}

{% block tail_script %}
<script>
var FormHelpers = {
Expand Down
6 changes: 5 additions & 1 deletion src/application/templates/new_example.html
@@ -1,4 +1,6 @@
<div class="modal hide fade" id="new-example-modal">
<div class="modal fade" id="new-example-modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button class="close" data-dismiss="modal">&times;</button>
<h3>Add a New Example</h3>
Expand Down Expand Up @@ -43,5 +45,7 @@ <h3>Add a New Example</h3>
</fieldset>
</form>
</div>
</div>
</div>
</div>

0 comments on commit 79054a6

Please sign in to comment.