Commits

Kenneth Love committed a20631f

moving to new creation/save views and templates. this is the string one

  • Participants
  • Parent commits 9012bb0

Comments (0)

Files changed (3)

         value=value
     )
 
+@app.route('/key/new/string', methods=['GET'])
+def new_string():
+    form = StringForm()
+    return render_template('new_string.html', form=form)
+
 @app.route('/key/delete/<key>', methods=['GET'])
 def delete(key):
     """ Delete key """

static/js/redbeard.js

             'id': 'key_controls'
         }),
         add_key = $('<a>').attr({
-            'href': '/new',
+            'href': '/key/new/string',
             'id': 'add_key',
             'title': 'add new key'
         }).text('add new key');

templates/new_string.html

+{% extends "layout.html" %}
+{% block leftblock %}
+<article>
+	<header>
+		<h1>Add New String</h1>
+	</header>
+	{% from "_partials.html" import render_field %}
+	<form action="/new" method="post" id="new_key_form">
+		{{ form.csrf }}
+		{{ render_field(form.key_name) }}
+		{{ render_field(form.key_value) }}
+		<input type="submit" value="Submit">
+	</form>
+
+</article>
+{% endblock %}