From 44b3fd793b68ac8b97b766547f44d87345f5c8af Mon Sep 17 00:00:00 2001 From: Katie Barr Date: Wed, 25 Feb 2015 10:03:45 +0000 Subject: [PATCH 01/15] first pass at front end for add contacts form --- planner/static/add_contact.js | 66 ++++++++++++++++++++++++ planner/static/jquery.dform-1.1.0.min.js | 2 + planner/static/main.css | 6 +++ planner/templates/add-contact.html | 6 ++- planner/templates/base.html | 10 +++- planner/templates/index.html | 0 planner/templates/macros.html | 4 ++ 7 files changed, 90 insertions(+), 4 deletions(-) create mode 100644 planner/static/add_contact.js create mode 100644 planner/static/jquery.dform-1.1.0.min.js mode change 100644 => 100755 planner/templates/add-contact.html mode change 100644 => 100755 planner/templates/base.html mode change 100644 => 100755 planner/templates/index.html mode change 100644 => 100755 planner/templates/macros.html diff --git a/planner/static/add_contact.js b/planner/static/add_contact.js new file mode 100644 index 0000000..1a82056 --- /dev/null +++ b/planner/static/add_contact.js @@ -0,0 +1,66 @@ +$(document).ready(function() {$("#add_contact").dform({ + "action" : "clients.html",// probably want to go back to specific client eventually + "method" : "post", + "html" : + [ + {"type": "hidden", + "value" : $(this).attr('client_id') + }, + { + "type" : "text", + "name" : "Forename", + "caption" : "Forename" + }, + + { + "type" : "text", + "name" : "Surname", + "caption" : "Surname" + }, + { + "type" : "text", + "name" : "Role", + "caption" : "Role" + }, + { + "type" : "text", + "name" : "email", + "placeholder" : "E.g. user@example.com", + "caption" : "Email" + }, + { + "type" : "text", + "name" : "Landline number", + "caption" : "Landline number" + }, + { + "type" : "text", + "name" : "Mobile number", + "caption" : "Mobile number" + }, + { + "type" : "p", + "html" : "Address information" + }, + { + "type" : "text", + "name" : "Street number", + "caption" : "Street number" + }, + { + "type" : "text", + "name" : "Street name", + "caption" : "Street name" + }, + { + "type" : "text", + "name" : "Post code", + "caption" : "Post code" + }, + { + "type" : "submit", + "value" : "Add contact" + } + ] +}); + }); diff --git a/planner/static/jquery.dform-1.1.0.min.js b/planner/static/jquery.dform-1.1.0.min.js new file mode 100644 index 0000000..4bc8330 --- /dev/null +++ b/planner/static/jquery.dform-1.1.0.min.js @@ -0,0 +1,2 @@ +/*! jquery.dform 2013-06-04 */ +!function(a){var b={},c={},d=a.each,e=function(b){var c=function(d,e,f){"object"==typeof d?a.each(d,function(a,b){c(a,b,f)}):(void 0===f||f===!0)&&(b[d]||(b[d]=[]),b[d].push(e))};return c},f=a.isArray,g=function(b){return a.map(b,function(a,b){return b})},h=function(a,b){var c={};return d(b,function(b,d){a[d]&&(c[d]=a[d])}),c},i=function(b,c){var e={};return d(b,function(b,d){~a.inArray(b,c)||(e[b]=d)}),e},j=function(c,e,f){return a.dform.hasSubscription(c)&&this.each(function(){var g=a(this);d(b[c],function(a,b){b.call(g,e,f)})}),this},k=function(a){var b=a.type,c=this;return this.dform("run","[pre]",a,b),d(a,function(a,d){c.dform("run",a,d,b)}),this.dform("run","[post]",a,b),this};a.extend(a,{keyset:g,withKeys:h,withoutKeys:i,dform:{options:{prefix:"ui-dform-"},defaultType:function(b){return a("<"+b.type+">").dform("attr",b)},types:function(a){return a?c[a]:c},addType:e(c),subscribers:function(a){return a?b[a]:b},subscribe:e(b),hasSubscription:function(a){return b[a]?!0:!1},createElement:function(b){if(!b.type)throw"No element type given! Must always exist.";var e=b.type,f=null,g=a.withoutKeys(b,["type"]);return c[e]?d(c[e],function(a,b){f=b.call(f,g)}):f=a.dform.defaultType(b),a(f)},methods:{run:function(a,b,c){return"string"!=typeof a?k.call(this,a):j.call(this,a,b,c)},append:function(b,c){c&&a.dform.converters&&a.isFunction(a.dform.converters[c])&&(b=a.dform.converters[c](b));var d=a.dform.createElement(b);this.append(d),d.dform("run",b)},attr:function(c,d){var e=a.keyset(b);f(d)&&a.merge(e,d),this.attr(a.withoutKeys(c,e))},ajax:function(b,c,d){var e={error:d,url:b},f=this;"string"!=typeof b&&a.extend(e,b),e.success=function(a){var d=c||b.success;f.dform(a),d&&d.call(f,a)},a.ajax(e)},init:function(b,c){var d=b.type?b:a.extend({type:"form"},b);c&&a.dform.converters&&a.isFunction(a.dform.converters[c])&&(d=a.dform.converters[c](d)),this.is(d.type)?(this.dform("attr",d),this.dform("run",d)):this.dform("append",d)}}}}),a.fn.dform=function(b,c,d){var e=a(this);return a.dform.methods[b]?a.dform.methods[b].apply(e,Array.prototype.slice.call(arguments,1)):"string"==typeof b?a.dform.methods.ajax.call(e,{url:b,dataType:"json"},c,d):a.dform.methods.init.apply(e,arguments),this}}(jQuery),function(a){var b=a.each,c=function(b,c){return function(d){return a(b).dform("attr",d,c)}},d=function(c){var d=this;a.isPlainObject(c)?d.dform("append",c):a.isArray(c)?b(c,function(a,b){d.dform("append",b)}):d.html(c)};a.dform.addType({container:c("
"),text:c(''),password:c(''),submit:c(''),reset:c(''),hidden:c(''),radio:c(''),checkbox:c(''),file:c(''),number:c(''),url:c(''),tel:c(''),email:c(''),checkboxes:c("
",["name"]),radiobuttons:c("
",["name"])}),a.dform.subscribe({"class":function(a){this.addClass(a)},html:d,elements:d,value:function(a){this.val(a)},css:function(a){this.css(a)},options:function(c,d){var e=this;"select"!==d&&"optgroup"!==d||"string"==typeof c?("checkboxes"===d||"radiobuttons"===d)&&b(c,function(b,c){var f="radiobuttons"===d?{type:"radio"}:{type:"checkbox"};"string"==typeof c?f.caption=c:a.extend(f,c),f.value=b,e.dform("append",f)}):b(c,function(b,c){var d={type:"option",value:b};"string"==typeof c&&(d.html=c),"object"==typeof c&&(d=a.extend(d,c)),e.dform("append",d)})},caption:function(b,c){var d={};if("string"==typeof b?d.html=b:a.extend(d,b),"fieldset"==c)d.type="legend",this.dform("append",d);else{d.type="label",this.attr("id")&&(d["for"]=this.attr("id"));var e=a(a.dform.createElement(d));"checkbox"===c||"radio"===c?this.parent().append(a(e)):e.insertBefore(this),e.dform("run",d)}},type:function(b,c){a.dform.options.prefix&&this.addClass(a.dform.options.prefix+c)},url:function(a){this.dform("ajax",a)},"[post]":function(b,c){if("checkboxes"===c||"radiobuttons"===c){var d="checkboxes"===c?"checkbox":"radio";this.children("[type="+d+"]").each(function(){a(this).attr("name",b.name)})}}})}(jQuery),function(a){var b=function(b,c){return a.withKeys(c,a.keyset(a.ui[b].prototype.options))},c=function(a,b){for(var c=b,d=0;d").dform("attr",c).progressbar(b("progressbar",c))},a.isFunction(a.fn.progressbar)),a.dform.addType("slider",function(c){return a("
").dform("attr",c).slider(b("slider",c))},a.isFunction(a.fn.slider)),a.dform.addType("accordion",function(b){return a("
").dform("attr",b)},a.isFunction(a.fn.accordion)),a.dform.addType("tabs",function(b){return a("
").dform("attr",b)},a.isFunction(a.fn.tabs)),a.dform.subscribe("entries",function(b,c){if("accordion"==c){var d=this;a.each(b,function(b,c){var e=a.extend({type:"div"},c);if(a(d).dform("append",e),c.caption){var f=a(d).children("div:last").prev();f.replaceWith('

'+f.html()+"

")}})}},a.isFunction(a.fn.accordion)),a.dform.subscribe("entries",function(b,c){if("tabs"==c){var d=this;this.append("
{% endblock %} diff --git a/planner/templates/add-iteration.html b/planner/templates/add-iteration.html new file mode 100644 index 0000000..cf43882 --- /dev/null +++ b/planner/templates/add-iteration.html @@ -0,0 +1,7 @@ +{% extends "base.html" %} +{% block content %} +
+

Add Iteration

+
+
+{% endblock %} diff --git a/planner/templates/base.html b/planner/templates/base.html index b40c87b..c2996f8 100755 --- a/planner/templates/base.html +++ b/planner/templates/base.html @@ -15,6 +15,7 @@ + Planner From 12e88556a1970920eb496abae01f8ef820a4d710 Mon Sep 17 00:00:00 2001 From: Katie Barr Date: Mon, 2 Mar 2015 16:16:56 +0000 Subject: [PATCH 05/15] fixed some flake 8 violations --- planner/__init__.py | 24 +++++++------------ planner/add_contact.py | 47 +++++++++++++++++-------------------- planner/add_iteration.py | 25 ++++++++------------ planner/model/engagement.py | 1 - planner/model/team.py | 2 +- 5 files changed, 40 insertions(+), 59 deletions(-) diff --git a/planner/__init__.py b/planner/__init__.py index 5491e77..bebe1d0 100644 --- a/planner/__init__.py +++ b/planner/__init__.py @@ -1,4 +1,5 @@ -from flask import Flask, abort, current_app, render_template, Blueprint, request +from flask import (Flask, abort, current_app, render_template, + Blueprint, request) import planner from planner.model.connect import TransactionFactory @@ -7,7 +8,7 @@ from planner.model.translate import to_dict, to_model from planner.flags import Flag from planner.config import HeadConfig -from planner.add_contact import convert_client_dict_form_json # need to discuss file structure with james +from planner.add_contact import convert_client_dict_form_json from planner.add_iteration import convert_iteration_dict_form_json import json @@ -56,23 +57,24 @@ def clients(): def client(client_id): return render_template("client.html") + @ui.route('/add-client') @feature def add_client(): return render_template("add-client.html") + @ui.route('/add-iteration') @feature def add_iteration(): - iteration = to_dict(Iteration(id=1))# looked from code like ids are autogenerated, but apparently not + iteration = to_dict(Iteration(id=1)) form_data = convert_iteration_dict_form_json(Iteration(id=1).id) with open("planner/static/add_iteration_form.json", 'w') as f: json.dump(form_data, f) return render_template("add-iteration.html") - -#@ui.route('/clients/{{client_id}}/new') - will have to wire in client id later, need client page +#@ui.route('/clients/{{client_id}}/new') @ui.route('/clients/1/new') @feature def add_contact(client_id=1): @@ -87,21 +89,11 @@ def add_contact(client_id=1): @api.route('/clients/1/add', methods=["POST"]) def save_new_contact(): form_data = request.form - #json_data = json.dumps(form_data) - # HORRIBLE!!!! - #data_dict = json.loads(json_data) - #data_dict["entity"] = "Contact" - # will need to transform data here i imagine contact = to_model(form_data, planner.model.client) return render_template("clients.html") + @api.route('/api/schedule/iteration-for-engagement') @feature def schedule_iteration_for_engagement(self): pass - - -#@api.route('/api/add-contact', methods=['POST']) -#def create_json_with_client_id(): -# client_id = request.data -# return None diff --git a/planner/add_contact.py b/planner/add_contact.py index 7893c87..91562c6 100644 --- a/planner/add_contact.py +++ b/planner/add_contact.py @@ -1,32 +1,24 @@ -import json - -#@api.route('/api/add-contact', methods=['POST']) -#def update_json_with_client_id(): -# client_id = request.data -# print client_id -# with open("/static/add_contact_form.json", 'r') as f: -# form_data = json.load(f) -# form_data['html'][0]['value'] = client_id -# assert form_data['html'][0]['type'] == 'hidden' -# with open("/static/add_contact_form.json", 'w') as f: -# json.dump(form_data, f) - - - -# TODO: THESE COME OUT IN A FUNNY ORDER def convert_client_dict_form_json(client_dict): contact_keys = client_dict.keys() - form_data = {"action":"/clients/1/add", "method":"post", "html":[]} + form_data = {"action": "/clients/1/add", + "method": "post", "html": []} keys_to_exclude = ["clientid", "entity", "id"] for key in contact_keys: if key not in keys_to_exclude: key_formatted = format_key_for_form_caption(key) key_upper_case = key_formatted.title() - form_data["html"].append({"type":"text", "caption": key_upper_case, "name": key}) + form_data["html"].append({"type": "text", + "caption": key_upper_case, + "name": key}) form_data["html"] = order_html_elements(form_data["html"]) - form_data["html"].append({"type":"submit", "value":"Add Contact"}) - form_data["html"].append({"type":"hidden", "value": "Contact", "name": "entity"}) - form_data["html"].append({"type":"hidden", "value": client_dict["clientid"], "name": "clientid"}) + form_data["html"].append({"type": "submit", + "value": "Add Contact"}) + form_data["html"].append({"type": "hidden", + "value": "Contact", + "name": "entity"}) + form_data["html"].append({"type": "hidden", + "value": client_dict["clientid"], + "name": "clientid"}) return form_data @@ -44,24 +36,27 @@ def format_key_for_form_caption(key): # this is basically hard coding, so very fragile def order_html_elements(list_of_form_fields): - # desired order: First name, last name, role; Telephone numbers Mobile number, landline; Address info Street number, street name, post code ordered_list = [] - names = [entry for entry in list_of_form_fields if "name" in entry["name"] and "street" not in entry["name"]] + names = [entry for entry in list_of_form_fields + if "name" in entry["name"] + and "street" not in entry["name"]] ordered_list.extend(names) role = get_specific_entry(list_of_form_fields, "role") ordered_list.extend(role) email = get_specific_entry(list_of_form_fields, "email") email[0]["placeholder"] = "name@example.com" ordered_list.extend(email) - ordered_list.append({ "type" : "p", "html" : "Telephone information"}) + ordered_list.append({"type": "p", "html": "Telephone information"}) numbers = get_specific_entry(list_of_form_fields, "no") ordered_list.extend(numbers) - ordered_list.append({ "type" : "p", "html" : "Address information"}) + ordered_list.append({"type": "p", "html": "Address information"}) street_info = get_specific_entry(list_of_form_fields, "street") ordered_list.extend(street_info) post_code = get_specific_entry(list_of_form_fields, "code") ordered_list.extend(post_code) return ordered_list + def get_specific_entry(list_of_form_fields, keyword): - return [entry for entry in list_of_form_fields if keyword in entry["name"]] + return [entry for entry in list_of_form_fields + if keyword in entry["name"]] diff --git a/planner/add_iteration.py b/planner/add_iteration.py index 5d69f4d..9874bca 100644 --- a/planner/add_iteration.py +++ b/planner/add_iteration.py @@ -1,17 +1,12 @@ def convert_iteration_dict_form_json(iteration_id): - form_data = {"action":"/iterations/1/add", - "method":"get", - "html":[{ - "type":"hidden", - "value": iteration_id, - "name":"id" - }, - { - "type":"text", - "caption":"Start Date", - "name": "startdate" - }, - { "type": "submit", - "value": "Add Iteration"} - ]} + form_data = {"action": "/iterations/1/add", + "method": "get", + "html": [{"type": "hidden", + "value": iteration_id, + "name": "id"}, + {"type": "text", + "caption": "Start Date", + "name": "startdate"}, + {"type": "submit", + "value": "Add Iteration"}]} return form_data diff --git a/planner/model/engagement.py b/planner/model/engagement.py index fd00770..9e2e69b 100644 --- a/planner/model/engagement.py +++ b/planner/model/engagement.py @@ -128,7 +128,6 @@ def validate_value(self, key, address): return address - class EngagementIteration(Base): __tablename__ = 'EngagementIteration' engagementid = Column(Integer, ForeignKey('Engagement.id'), diff --git a/planner/model/team.py b/planner/model/team.py index 9c71c65..80c916c 100644 --- a/planner/model/team.py +++ b/planner/model/team.py @@ -35,7 +35,7 @@ class TeamMember(Base): def validate_title(self, key, address): if address not in ['Mr', 'Miss', 'Dr', 'Mrs']: raise ValidationError( - str(address) + " is not an appropriate title") + str(address) + " is not an appropriate title") return address @validates('gmail') From be565b472782743098887bae40f4c34185a2afd3 Mon Sep 17 00:00:00 2001 From: Katie Barr Date: Mon, 2 Mar 2015 17:27:16 +0000 Subject: [PATCH 06/15] save contact to database --- planner/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/planner/__init__.py b/planner/__init__.py index bebe1d0..57009d1 100644 --- a/planner/__init__.py +++ b/planner/__init__.py @@ -90,6 +90,8 @@ def add_contact(client_id=1): def save_new_contact(): form_data = request.form contact = to_model(form_data, planner.model.client) + with current_app.transaction() as transaction: + transaction.add(contact) return render_template("clients.html") From 6cd0e6ef04974971f491975d1203096c66917327 Mon Sep 17 00:00:00 2001 From: Katie Barr Date: Tue, 3 Mar 2015 15:26:51 +0000 Subject: [PATCH 07/15] save new contact to database and render templates --- planner/__init__.py | 47 ++++++++++++++++++++-------- planner/add_contact.py | 2 +- planner/add_iteration.py | 7 +++-- planner/templates/add-contact.html | 2 +- planner/templates/add-iteration.html | 2 +- planner/templates/clients.html | 2 +- planner/templates/contacts.html | 18 +++++------ 7 files changed, 52 insertions(+), 28 deletions(-) diff --git a/planner/__init__.py b/planner/__init__.py index 57009d1..153ff5b 100644 --- a/planner/__init__.py +++ b/planner/__init__.py @@ -1,9 +1,10 @@ from flask import (Flask, abort, current_app, render_template, Blueprint, request) +import datetime import planner from planner.model.connect import TransactionFactory -from planner.model.client import Contact +from planner.model.client import Client, Contact from planner.model.iteration import Iteration from planner.model.translate import to_dict, to_model from planner.flags import Flag @@ -49,13 +50,18 @@ def add_engagement(): @ui.route('/clients') @feature def clients(): - return render_template("clients.html") + with current_app.transaction() as transaction: + clients = transaction.query(Client).all() + client_dicts = [to_dict(client) for client in clients] + return render_template("clients.html", clients=clients) -@ui.route('/clients/{{client.id}}') +@ui.route('/clients/', methods=["GET"]) @feature def client(client_id): - return render_template("client.html") + with current_app.transaction() as transaction: + client = transaction.query(Client).get(client_id) + return render_template("contacts.html", client=client) @ui.route('/add-client') @@ -64,35 +70,50 @@ def add_client(): return render_template("add-client.html") +# eventually need the add_iteration.py script to check next id, +# save that as hidden element and pass in @ui.route('/add-iteration') @feature def add_iteration(): - iteration = to_dict(Iteration(id=1)) - form_data = convert_iteration_dict_form_json(Iteration(id=1).id) + iteration_model = Iteration(id=1) + iteration = to_dict(iteration_model) + form_data = convert_iteration_dict_form_json(iteration_model.id) with open("planner/static/add_iteration_form.json", 'w') as f: json.dump(form_data, f) return render_template("add-iteration.html") +@api.route('/iteration/new', methods=["POST"]) +def save_new_iteration(): + form_data = request.form + iteration = to_model(form_data, planner.model.iteration) + date_string = "".join(iteration.startdate.split("/")) + iteration.startdate = datetime.datetime.strptime(date_string, + "%d%m%Y") + with current_app.transaction() as transaction: + transaction.add(iteration) + return render_template("add-iteration.html") + + -#@ui.route('/clients/{{client_id}}/new') -@ui.route('/clients/1/new') +@ui.route('/clients//new') @feature -def add_contact(client_id=1): +def add_contact(client_id): contact = to_dict(Contact(clientid=client_id)) form_data = convert_client_dict_form_json(contact) with open("planner/static/add_contact_form.json", 'w') as f: json.dump(form_data, f) - return render_template('add-contact.html') + return render_template('add-contact.html', clientid=client_id) # just get data posted first, save to db later -@api.route('/clients/1/add', methods=["POST"]) -def save_new_contact(): +@api.route('/clients//add', methods=["POST"]) +def save_new_contact(client_id): form_data = request.form contact = to_model(form_data, planner.model.client) with current_app.transaction() as transaction: transaction.add(contact) - return render_template("clients.html") + client = transaction.query(Client).get(client_id) + return render_template("contacts.html", client=client) @api.route('/api/schedule/iteration-for-engagement') diff --git a/planner/add_contact.py b/planner/add_contact.py index 91562c6..7d89a5c 100644 --- a/planner/add_contact.py +++ b/planner/add_contact.py @@ -1,6 +1,6 @@ def convert_client_dict_form_json(client_dict): contact_keys = client_dict.keys() - form_data = {"action": "/clients/1/add", + form_data = {"action": "/clients/%d/add" % (client_dict["clientid"]), "method": "post", "html": []} keys_to_exclude = ["clientid", "entity", "id"] for key in contact_keys: diff --git a/planner/add_iteration.py b/planner/add_iteration.py index 9874bca..353cfee 100644 --- a/planner/add_iteration.py +++ b/planner/add_iteration.py @@ -1,6 +1,6 @@ def convert_iteration_dict_form_json(iteration_id): - form_data = {"action": "/iterations/1/add", - "method": "get", + form_data = {"action": "/iteration/new", + "method": "post", "html": [{"type": "hidden", "value": iteration_id, "name": "id"}, @@ -9,4 +9,7 @@ def convert_iteration_dict_form_json(iteration_id): "name": "startdate"}, {"type": "submit", "value": "Add Iteration"}]} + form_data["html"].append({"type": "hidden", + "value": "Iteration", + "name": "entity"}) return form_data diff --git a/planner/templates/add-contact.html b/planner/templates/add-contact.html index 82491c5..2c2c647 100755 --- a/planner/templates/add-contact.html +++ b/planner/templates/add-contact.html @@ -5,6 +5,6 @@

Add Contact

{# removed action url as specified in javascript #} {# {{ render_form("add_contact", client_id=client_id) }}#} -
+
{% endblock %} diff --git a/planner/templates/add-iteration.html b/planner/templates/add-iteration.html index cf43882..c4d8e19 100644 --- a/planner/templates/add-iteration.html +++ b/planner/templates/add-iteration.html @@ -2,6 +2,6 @@ {% block content %}

Add Iteration

-
+
{% endblock %} diff --git a/planner/templates/clients.html b/planner/templates/clients.html index 6bd8962..a144513 100644 --- a/planner/templates/clients.html +++ b/planner/templates/clients.html @@ -11,7 +11,7 @@ {% for client in clients %} - {{ client.client }} + {{ client.name }}
Contact List diff --git a/planner/templates/contacts.html b/planner/templates/contacts.html index 971b05b..b9d0c2f 100644 --- a/planner/templates/contacts.html +++ b/planner/templates/contacts.html @@ -6,20 +6,20 @@

{{client.name}} Contacts

{% endfor %}

- {% for client in clients %} + {% for contact in client.contacts %}
-

Forename: {{client.forename}}

-

Surname: {{client.surname}}

-

Role: {{client.role}}

-

Email: {{client.email}}

-

Mobile: {{client.mobilenumber}}

-

Landline: {{client.landlinenumber}}

-

Address: {{client.address|replace("\n", "
")|safe}}

+

Forename: {{contact.forename}}

+

Surname: {{contact.surname}}

+

Role: {{contact.role}}

+

Email: {{contact.email}}

+

Mobile: {{contact.mobilenumber}}

+

Landline: {{contact.landlinenumber}}

+

Address: {{contact.address|replace("\n", "
")|safe}}

{% endfor %}
From 8a7d5ac335b15855b83f67484cd205ed9cbb9a11 Mon Sep 17 00:00:00 2001 From: Katie Barr Date: Wed, 4 Mar 2015 13:56:12 +0000 Subject: [PATCH 08/15] wired more pages together --- planner/__init__.py | 23 +++++++++++++------ planner/add_iteration.py | 13 +++++++---- planner/model/engagement.py | 7 +++--- .../add_iteration_validation_error.html | 8 +++++++ planner/templates/contacts.html | 4 +--- 5 files changed, 37 insertions(+), 18 deletions(-) create mode 100644 planner/templates/add_iteration_validation_error.html diff --git a/planner/__init__.py b/planner/__init__.py index 153ff5b..faa0368 100644 --- a/planner/__init__.py +++ b/planner/__init__.py @@ -3,9 +3,11 @@ import datetime import planner +from planner.model import Base from planner.model.connect import TransactionFactory from planner.model.client import Client, Contact from planner.model.iteration import Iteration +from planner.model.engagement import Engagement from planner.model.translate import to_dict, to_model from planner.flags import Flag from planner.config import HeadConfig @@ -38,7 +40,10 @@ def index(): @ui.route('/schedule') @feature def schedule(): - return render_template('schedule.html') + with current_app.transaction() as transaction: + iterations = transaction.query(Iteration).all() + #engagements = transaction.query(Engagement).all() + return render_template('schedule.html', iterations=iterations)#, engagements=engagements) @ui.route('/add-engagement') @@ -75,23 +80,27 @@ def add_client(): @ui.route('/add-iteration') @feature def add_iteration(): - iteration_model = Iteration(id=1) + iteration_model = Iteration() iteration = to_dict(iteration_model) - form_data = convert_iteration_dict_form_json(iteration_model.id) + form_data = convert_iteration_dict_form_json() with open("planner/static/add_iteration_form.json", 'w') as f: json.dump(form_data, f) return render_template("add-iteration.html") + @api.route('/iteration/new', methods=["POST"]) def save_new_iteration(): form_data = request.form iteration = to_model(form_data, planner.model.iteration) date_string = "".join(iteration.startdate.split("/")) - iteration.startdate = datetime.datetime.strptime(date_string, - "%d%m%Y") + try: + iteration.startdate = datetime.datetime.strptime(date_string, + "%d%m%Y") + except ValueError: + return render_template("add_iteration_validation_error.html") with current_app.transaction() as transaction: transaction.add(iteration) - return render_template("add-iteration.html") + return schedule() @@ -102,10 +111,10 @@ def add_contact(client_id): form_data = convert_client_dict_form_json(contact) with open("planner/static/add_contact_form.json", 'w') as f: json.dump(form_data, f) + print client_id return render_template('add-contact.html', clientid=client_id) -# just get data posted first, save to db later @api.route('/clients//add', methods=["POST"]) def save_new_contact(client_id): form_data = request.form diff --git a/planner/add_iteration.py b/planner/add_iteration.py index 353cfee..4de8d94 100644 --- a/planner/add_iteration.py +++ b/planner/add_iteration.py @@ -1,10 +1,7 @@ -def convert_iteration_dict_form_json(iteration_id): +def convert_iteration_dict_form_json(): form_data = {"action": "/iteration/new", "method": "post", - "html": [{"type": "hidden", - "value": iteration_id, - "name": "id"}, - {"type": "text", + "html": [{"type": "text", "caption": "Start Date", "name": "startdate"}, {"type": "submit", @@ -13,3 +10,9 @@ def convert_iteration_dict_form_json(iteration_id): "value": "Iteration", "name": "entity"}) return form_data + + + +#{"type": "hidden", +# "value": iteration_id, +# "name": "id"}, diff --git a/planner/model/engagement.py b/planner/model/engagement.py index 9e2e69b..e8dddbd 100644 --- a/planner/model/engagement.py +++ b/planner/model/engagement.py @@ -2,7 +2,8 @@ from sqlalchemy.orm import relationship, validates from planner.model import Base, ValidationError - +from planner.model.team import Team +from planner.model.client import Client class Engagement(Base): __tablename__ = 'Engagement' @@ -37,8 +38,8 @@ class Engagement(Base): expenses = relationship("Expense") - #actualiterations = relationship("EngagementIteration") - #estimatediterations = relationship("EstimatedEngagementIteration") + actualiterations = relationship("EngagementIteration") + estimatediterations = relationship("EstimatedEngagementIteration") class Expense(Base): diff --git a/planner/templates/add_iteration_validation_error.html b/planner/templates/add_iteration_validation_error.html new file mode 100644 index 0000000..bbb6559 --- /dev/null +++ b/planner/templates/add_iteration_validation_error.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} +{% block content %} +
+

Add Iteration

+

Please give start date in format "dd/mm/yyyy" e.g. 01/01/2016

+
+
+{% endblock %} diff --git a/planner/templates/contacts.html b/planner/templates/contacts.html index b9d0c2f..2d0c970 100644 --- a/planner/templates/contacts.html +++ b/planner/templates/contacts.html @@ -1,12 +1,10 @@ {% extends "base.html" %} {% block content %} - {% for client in clients|slice(1)%}

{{client.name}} Contacts

- {% endfor %}

From 6be37b3a49717d87c3440a1e91feaa9ee51dc379 Mon Sep 17 00:00:00 2001 From: Katie Barr Date: Wed, 4 Mar 2015 16:06:42 +0000 Subject: [PATCH 09/15] form action url now correct, but contacts no longer rendering --- planner/__init__.py | 16 ++++++++++------ planner/form_data/__init__.py | 3 +++ planner/{ => form_data}/add_contact.py | 4 +--- planner/form_data/add_contact_form_1.json | 1 + planner/form_data/add_contact_form_7.json | 1 + planner/form_data/add_contact_form_9.json | 1 + planner/{ => form_data}/add_iteration.py | 0 planner/static/add_contact.js | 2 +- planner/templates/add-contact.html | 5 ++++- planner/templates/base.html | 1 - 10 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 planner/form_data/__init__.py rename planner/{ => form_data}/add_contact.py (93%) create mode 100644 planner/form_data/add_contact_form_1.json create mode 100644 planner/form_data/add_contact_form_7.json create mode 100644 planner/form_data/add_contact_form_9.json rename planner/{ => form_data}/add_iteration.py (100%) diff --git a/planner/__init__.py b/planner/__init__.py index faa0368..d70d578 100644 --- a/planner/__init__.py +++ b/planner/__init__.py @@ -2,6 +2,7 @@ Blueprint, request) import datetime +import time import planner from planner.model import Base from planner.model.connect import TransactionFactory @@ -11,8 +12,8 @@ from planner.model.translate import to_dict, to_model from planner.flags import Flag from planner.config import HeadConfig -from planner.add_contact import convert_client_dict_form_json -from planner.add_iteration import convert_iteration_dict_form_json +from planner.form_data.add_contact import convert_client_dict_form_json +from planner.form_data.add_iteration import convert_iteration_dict_form_json import json ui = Blueprint('views', __name__, template_folder='templates') @@ -57,7 +58,6 @@ def add_engagement(): def clients(): with current_app.transaction() as transaction: clients = transaction.query(Client).all() - client_dicts = [to_dict(client) for client in clients] return render_template("clients.html", clients=clients) @@ -80,8 +80,8 @@ def add_client(): @ui.route('/add-iteration') @feature def add_iteration(): - iteration_model = Iteration() - iteration = to_dict(iteration_model) + # currently no point doing like this + # but as we add things to iterations, may be more useful form_data = convert_iteration_dict_form_json() with open("planner/static/add_iteration_form.json", 'w') as f: json.dump(form_data, f) @@ -107,11 +107,15 @@ def save_new_iteration(): @ui.route('/clients//new') @feature def add_contact(client_id): + print client_id contact = to_dict(Contact(clientid=client_id)) form_data = convert_client_dict_form_json(contact) - with open("planner/static/add_contact_form.json", 'w') as f: + filename = "planner/static/add_contact_form_%d.json" % (client_id) + print filename + with open(filename, 'w') as f: json.dump(form_data, f) print client_id + time.sleep(1) return render_template('add-contact.html', clientid=client_id) diff --git a/planner/form_data/__init__.py b/planner/form_data/__init__.py new file mode 100644 index 0000000..7f2764f --- /dev/null +++ b/planner/form_data/__init__.py @@ -0,0 +1,3 @@ + +# + diff --git a/planner/add_contact.py b/planner/form_data/add_contact.py similarity index 93% rename from planner/add_contact.py rename to planner/form_data/add_contact.py index 7d89a5c..f2cc8fc 100644 --- a/planner/add_contact.py +++ b/planner/form_data/add_contact.py @@ -1,4 +1,5 @@ def convert_client_dict_form_json(client_dict): + print 'function_called with id %s' % (client_dict["clientid"]) contact_keys = client_dict.keys() form_data = {"action": "/clients/%d/add" % (client_dict["clientid"]), "method": "post", "html": []} @@ -16,9 +17,6 @@ def convert_client_dict_form_json(client_dict): form_data["html"].append({"type": "hidden", "value": "Contact", "name": "entity"}) - form_data["html"].append({"type": "hidden", - "value": client_dict["clientid"], - "name": "clientid"}) return form_data diff --git a/planner/form_data/add_contact_form_1.json b/planner/form_data/add_contact_form_1.json new file mode 100644 index 0000000..ad03900 --- /dev/null +++ b/planner/form_data/add_contact_form_1.json @@ -0,0 +1 @@ +{"action": "/clients/1/add", "html": [{"caption": "Surname", "type": "text", "name": "surname"}, {"caption": "Forename", "type": "text", "name": "forename"}, {"caption": "Role", "type": "text", "name": "role"}, {"caption": "Email", "type": "text", "name": "email", "placeholder": "name@example.com"}, {"html": "Telephone information", "type": "p"}, {"caption": "Mobile No", "type": "text", "name": "mobileno"}, {"caption": "Landline No", "type": "text", "name": "landlineno"}, {"html": "Address information", "type": "p"}, {"caption": "Street Number", "type": "text", "name": "streetnumber"}, {"caption": "Street Name", "type": "text", "name": "streetname"}, {"caption": "Post Code", "type": "text", "name": "postcode"}, {"type": "submit", "value": "Add Contact"}, {"type": "hidden", "name": "entity", "value": "Contact"}], "method": "post"} \ No newline at end of file diff --git a/planner/form_data/add_contact_form_7.json b/planner/form_data/add_contact_form_7.json new file mode 100644 index 0000000..b77ae73 --- /dev/null +++ b/planner/form_data/add_contact_form_7.json @@ -0,0 +1 @@ +{"action": "/clients/7/add", "html": [{"caption": "Surname", "type": "text", "name": "surname"}, {"caption": "Forename", "type": "text", "name": "forename"}, {"caption": "Role", "type": "text", "name": "role"}, {"caption": "Email", "type": "text", "name": "email", "placeholder": "name@example.com"}, {"html": "Telephone information", "type": "p"}, {"caption": "Mobile No", "type": "text", "name": "mobileno"}, {"caption": "Landline No", "type": "text", "name": "landlineno"}, {"html": "Address information", "type": "p"}, {"caption": "Street Number", "type": "text", "name": "streetnumber"}, {"caption": "Street Name", "type": "text", "name": "streetname"}, {"caption": "Post Code", "type": "text", "name": "postcode"}, {"type": "submit", "value": "Add Contact"}, {"type": "hidden", "name": "entity", "value": "Contact"}], "method": "post"} \ No newline at end of file diff --git a/planner/form_data/add_contact_form_9.json b/planner/form_data/add_contact_form_9.json new file mode 100644 index 0000000..691a76d --- /dev/null +++ b/planner/form_data/add_contact_form_9.json @@ -0,0 +1 @@ +{"action": "/clients/9/add", "html": [{"caption": "Surname", "type": "text", "name": "surname"}, {"caption": "Forename", "type": "text", "name": "forename"}, {"caption": "Role", "type": "text", "name": "role"}, {"caption": "Email", "type": "text", "name": "email", "placeholder": "name@example.com"}, {"html": "Telephone information", "type": "p"}, {"caption": "Mobile No", "type": "text", "name": "mobileno"}, {"caption": "Landline No", "type": "text", "name": "landlineno"}, {"html": "Address information", "type": "p"}, {"caption": "Street Number", "type": "text", "name": "streetnumber"}, {"caption": "Street Name", "type": "text", "name": "streetname"}, {"caption": "Post Code", "type": "text", "name": "postcode"}, {"type": "submit", "value": "Add Contact"}, {"type": "hidden", "name": "entity", "value": "Contact"}], "method": "post"} \ No newline at end of file diff --git a/planner/add_iteration.py b/planner/form_data/add_iteration.py similarity index 100% rename from planner/add_iteration.py rename to planner/form_data/add_iteration.py diff --git a/planner/static/add_contact.js b/planner/static/add_contact.js index bb002cc..6fbed85 100644 --- a/planner/static/add_contact.js +++ b/planner/static/add_contact.js @@ -1,3 +1,3 @@ $(document).ready(function() { - $("#add_contact").dform("/static/add_contact_form.json")// if successful, render form + $("#add_contact").dform("/static/add_contact_form_1.json")// if successful, render form }); diff --git a/planner/templates/add-contact.html b/planner/templates/add-contact.html index 2c2c647..9ff5151 100755 --- a/planner/templates/add-contact.html +++ b/planner/templates/add-contact.html @@ -4,7 +4,10 @@

Add Contact

{# removed action url as specified in javascript #} {# {{ render_form("add_contact", client_id=client_id) }}#} - +
{% endblock %} diff --git a/planner/templates/base.html b/planner/templates/base.html index c2996f8..d97cf96 100755 --- a/planner/templates/base.html +++ b/planner/templates/base.html @@ -14,7 +14,6 @@ src="//netdna.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"> - Planner From 88a0d37cd634ed98d3c8b0443c4f3132da7a18f5 Mon Sep 17 00:00:00 2001 From: Katie Barr Date: Wed, 4 Mar 2015 16:12:12 +0000 Subject: [PATCH 10/15] added form data file --- planner/form_data/add_contact.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/planner/form_data/add_contact.py b/planner/form_data/add_contact.py index f2cc8fc..0aff05c 100644 --- a/planner/form_data/add_contact.py +++ b/planner/form_data/add_contact.py @@ -17,6 +17,9 @@ def convert_client_dict_form_json(client_dict): form_data["html"].append({"type": "hidden", "value": "Contact", "name": "entity"}) + form_data["html"].append({"type": "hidden", + "value": client_dict["clientid"], + "name": "clientid"}) return form_data From 89582d86c570ea2c1b83c56989ece8ccf693b11c Mon Sep 17 00:00:00 2001 From: Katie Barr Date: Wed, 4 Mar 2015 16:15:43 +0000 Subject: [PATCH 11/15] minor fix --- planner/__init__.py | 12 +++--------- planner/form_data/add_contact.py | 1 - planner/templates/contacts.html | 4 ++-- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/planner/__init__.py b/planner/__init__.py index d70d578..465d1d5 100644 --- a/planner/__init__.py +++ b/planner/__init__.py @@ -2,13 +2,12 @@ Blueprint, request) import datetime -import time + import planner from planner.model import Base from planner.model.connect import TransactionFactory from planner.model.client import Client, Contact from planner.model.iteration import Iteration -from planner.model.engagement import Engagement from planner.model.translate import to_dict, to_model from planner.flags import Flag from planner.config import HeadConfig @@ -43,8 +42,8 @@ def index(): def schedule(): with current_app.transaction() as transaction: iterations = transaction.query(Iteration).all() - #engagements = transaction.query(Engagement).all() - return render_template('schedule.html', iterations=iterations)#, engagements=engagements) + # engagements = transaction.query(Engagement).all() + return render_template('schedule.html', iterations=iterations) @ui.route('/add-engagement') @@ -103,19 +102,14 @@ def save_new_iteration(): return schedule() - @ui.route('/clients//new') @feature def add_contact(client_id): - print client_id contact = to_dict(Contact(clientid=client_id)) form_data = convert_client_dict_form_json(contact) filename = "planner/static/add_contact_form_%d.json" % (client_id) - print filename with open(filename, 'w') as f: json.dump(form_data, f) - print client_id - time.sleep(1) return render_template('add-contact.html', clientid=client_id) diff --git a/planner/form_data/add_contact.py b/planner/form_data/add_contact.py index 0aff05c..e8c35ee 100644 --- a/planner/form_data/add_contact.py +++ b/planner/form_data/add_contact.py @@ -27,7 +27,6 @@ def format_key_for_form_caption(key): splits = ["no", "number", "code"] if any(string in key for string in splits): split_on = [string for string in splits if string in key][0] - print split_on print key.split(split_on) key = " ".join(key.split(split_on)) + split_on if key == "streetname": diff --git a/planner/templates/contacts.html b/planner/templates/contacts.html index 2d0c970..e75677b 100644 --- a/planner/templates/contacts.html +++ b/planner/templates/contacts.html @@ -15,8 +15,8 @@

{{client.name}} Contacts

Surname: {{contact.surname}}

Role: {{contact.role}}

Email: {{contact.email}}

-

Mobile: {{contact.mobilenumber}}

-

Landline: {{contact.landlinenumber}}

+

Mobile: {{contact.mobileno}}

+

Landline: {{contact.landlineno}}

Address: {{contact.address|replace("\n", "
")|safe}}

{% endfor %} From d4603796befe7021822100365d313cbdfe96febc Mon Sep 17 00:00:00 2001 From: Katie Barr Date: Thu, 5 Mar 2015 14:03:51 +0000 Subject: [PATCH 12/15] about to make some changes which might break things... --- planner/__init__.py | 7 +------ planner/form_data/__init__.py | 2 -- planner/templates/contacts.html | 1 + 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/planner/__init__.py b/planner/__init__.py index 465d1d5..918935e 100644 --- a/planner/__init__.py +++ b/planner/__init__.py @@ -74,13 +74,9 @@ def add_client(): return render_template("add-client.html") -# eventually need the add_iteration.py script to check next id, -# save that as hidden element and pass in @ui.route('/add-iteration') @feature def add_iteration(): - # currently no point doing like this - # but as we add things to iterations, may be more useful form_data = convert_iteration_dict_form_json() with open("planner/static/add_iteration_form.json", 'w') as f: json.dump(form_data, f) @@ -119,8 +115,7 @@ def save_new_contact(client_id): contact = to_model(form_data, planner.model.client) with current_app.transaction() as transaction: transaction.add(contact) - client = transaction.query(Client).get(client_id) - return render_template("contacts.html", client=client) + return client(client_id) @api.route('/api/schedule/iteration-for-engagement') diff --git a/planner/form_data/__init__.py b/planner/form_data/__init__.py index 7f2764f..8b13789 100644 --- a/planner/form_data/__init__.py +++ b/planner/form_data/__init__.py @@ -1,3 +1 @@ -# - diff --git a/planner/templates/contacts.html b/planner/templates/contacts.html index e75677b..f1dcfcc 100644 --- a/planner/templates/contacts.html +++ b/planner/templates/contacts.html @@ -21,5 +21,6 @@

{{client.name}} Contacts

{% endfor %}
+ Back to client list
{% endblock %} From e8d115d65ee81f7104e2a417a11442b3f44dde8b Mon Sep 17 00:00:00 2001 From: Katie Barr Date: Thu, 5 Mar 2015 14:50:28 +0000 Subject: [PATCH 13/15] fixed linting errors --- pavement.py | 1 + planner/__init__.py | 1 - planner/form_data/__init__.py | 1 - planner/form_data/add_contact.py | 4 ++-- planner/form_data/add_iteration.py | 6 ------ planner/model/__init__.py | 2 -- planner/model/engagement.py | 3 +-- planner/static/add_contact.js | 3 --- planner/static/add_iteration.js | 10 +++++++--- 9 files changed, 11 insertions(+), 20 deletions(-) delete mode 100644 planner/static/add_contact.js diff --git a/pavement.py b/pavement.py index ac1213d..087ff97 100644 --- a/pavement.py +++ b/pavement.py @@ -126,6 +126,7 @@ def jslint(): """Run linting on javascript """ files = recursive_glob('*.js', 'scripts', 'planner/static', 'test') + files.remove('planner/static/jquery.dform-1.1.0.min.js') return sh('phantomjs scripts/jslintrunner.js ' + ' '.join(files)) diff --git a/planner/__init__.py b/planner/__init__.py index 918935e..2ab3dc3 100644 --- a/planner/__init__.py +++ b/planner/__init__.py @@ -4,7 +4,6 @@ import datetime import planner -from planner.model import Base from planner.model.connect import TransactionFactory from planner.model.client import Client, Contact from planner.model.iteration import Iteration diff --git a/planner/form_data/__init__.py b/planner/form_data/__init__.py index 8b13789..e69de29 100644 --- a/planner/form_data/__init__.py +++ b/planner/form_data/__init__.py @@ -1 +0,0 @@ - diff --git a/planner/form_data/add_contact.py b/planner/form_data/add_contact.py index e8c35ee..cc1e0fb 100644 --- a/planner/form_data/add_contact.py +++ b/planner/form_data/add_contact.py @@ -38,8 +38,8 @@ def format_key_for_form_caption(key): def order_html_elements(list_of_form_fields): ordered_list = [] names = [entry for entry in list_of_form_fields - if "name" in entry["name"] - and "street" not in entry["name"]] + if "name" in entry["name"] and + "street" not in entry["name"]] ordered_list.extend(names) role = get_specific_entry(list_of_form_fields, "role") ordered_list.extend(role) diff --git a/planner/form_data/add_iteration.py b/planner/form_data/add_iteration.py index 4de8d94..bed4243 100644 --- a/planner/form_data/add_iteration.py +++ b/planner/form_data/add_iteration.py @@ -10,9 +10,3 @@ def convert_iteration_dict_form_json(): "value": "Iteration", "name": "entity"}) return form_data - - - -#{"type": "hidden", -# "value": iteration_id, -# "name": "id"}, diff --git a/planner/model/__init__.py b/planner/model/__init__.py index 20bc530..70c276e 100644 --- a/planner/model/__init__.py +++ b/planner/model/__init__.py @@ -1,5 +1,3 @@ -from sqlalchemy import Column, Integer, ForeignKey -from sqlalchemy.orm import relationship from sqlalchemy.ext.declarative import declarative_base diff --git a/planner/model/engagement.py b/planner/model/engagement.py index e8dddbd..e974cde 100644 --- a/planner/model/engagement.py +++ b/planner/model/engagement.py @@ -2,8 +2,7 @@ from sqlalchemy.orm import relationship, validates from planner.model import Base, ValidationError -from planner.model.team import Team -from planner.model.client import Client + class Engagement(Base): __tablename__ = 'Engagement' diff --git a/planner/static/add_contact.js b/planner/static/add_contact.js deleted file mode 100644 index 6fbed85..0000000 --- a/planner/static/add_contact.js +++ /dev/null @@ -1,3 +0,0 @@ -$(document).ready(function() { - $("#add_contact").dform("/static/add_contact_form_1.json")// if successful, render form - }); diff --git a/planner/static/add_iteration.js b/planner/static/add_iteration.js index 692262d..dd597a3 100644 --- a/planner/static/add_iteration.js +++ b/planner/static/add_iteration.js @@ -1,3 +1,7 @@ -$(document).ready(function() { - $("#add_iteration").dform("/static/add_iteration_form.json")// if successful, render form - }); +/*global $, document + */ + +$(document).ready(function () { + "use strict"; + $("#add_iteration").dform("/static/add_iteration_form.json"); +}); From e77488530c710e79d1eabd088d04f488f3874437 Mon Sep 17 00:00:00 2001 From: Katie Barr Date: Thu, 5 Mar 2015 14:58:22 +0000 Subject: [PATCH 14/15] fixed import in acceptance model test --- test/_acceptance_model.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/_acceptance_model.py b/test/_acceptance_model.py index 312ccf6..3aa3bf8 100644 --- a/test/_acceptance_model.py +++ b/test/_acceptance_model.py @@ -1,11 +1,10 @@ import datetime from test import ModelTestCase -from planner.model import EngagementIteration, EstimatedEngagementIteration from planner.model.iteration import Iteration from planner.model.engagement import ( Engagement, Status, Complexity, Probability, Alignment, Sustainability, - Expense, ExpenseType + Expense, ExpenseType, EngagementIteration, EstimatedEngagementIteration ) from planner.model.team import Team, Cost, CostType, TeamMember from planner.model.client import Client, Contact From 1d230fe450b46e46ba23d3c3f50a2d01f1c088b3 Mon Sep 17 00:00:00 2001 From: Katie Barr Date: Thu, 5 Mar 2015 15:01:07 +0000 Subject: [PATCH 15/15] removed unecessary dfata files --- planner/form_data/add_contact_form_1.json | 1 - planner/form_data/add_contact_form_7.json | 1 - planner/form_data/add_contact_form_9.json | 1 - 3 files changed, 3 deletions(-) delete mode 100644 planner/form_data/add_contact_form_1.json delete mode 100644 planner/form_data/add_contact_form_7.json delete mode 100644 planner/form_data/add_contact_form_9.json diff --git a/planner/form_data/add_contact_form_1.json b/planner/form_data/add_contact_form_1.json deleted file mode 100644 index ad03900..0000000 --- a/planner/form_data/add_contact_form_1.json +++ /dev/null @@ -1 +0,0 @@ -{"action": "/clients/1/add", "html": [{"caption": "Surname", "type": "text", "name": "surname"}, {"caption": "Forename", "type": "text", "name": "forename"}, {"caption": "Role", "type": "text", "name": "role"}, {"caption": "Email", "type": "text", "name": "email", "placeholder": "name@example.com"}, {"html": "Telephone information", "type": "p"}, {"caption": "Mobile No", "type": "text", "name": "mobileno"}, {"caption": "Landline No", "type": "text", "name": "landlineno"}, {"html": "Address information", "type": "p"}, {"caption": "Street Number", "type": "text", "name": "streetnumber"}, {"caption": "Street Name", "type": "text", "name": "streetname"}, {"caption": "Post Code", "type": "text", "name": "postcode"}, {"type": "submit", "value": "Add Contact"}, {"type": "hidden", "name": "entity", "value": "Contact"}], "method": "post"} \ No newline at end of file diff --git a/planner/form_data/add_contact_form_7.json b/planner/form_data/add_contact_form_7.json deleted file mode 100644 index b77ae73..0000000 --- a/planner/form_data/add_contact_form_7.json +++ /dev/null @@ -1 +0,0 @@ -{"action": "/clients/7/add", "html": [{"caption": "Surname", "type": "text", "name": "surname"}, {"caption": "Forename", "type": "text", "name": "forename"}, {"caption": "Role", "type": "text", "name": "role"}, {"caption": "Email", "type": "text", "name": "email", "placeholder": "name@example.com"}, {"html": "Telephone information", "type": "p"}, {"caption": "Mobile No", "type": "text", "name": "mobileno"}, {"caption": "Landline No", "type": "text", "name": "landlineno"}, {"html": "Address information", "type": "p"}, {"caption": "Street Number", "type": "text", "name": "streetnumber"}, {"caption": "Street Name", "type": "text", "name": "streetname"}, {"caption": "Post Code", "type": "text", "name": "postcode"}, {"type": "submit", "value": "Add Contact"}, {"type": "hidden", "name": "entity", "value": "Contact"}], "method": "post"} \ No newline at end of file diff --git a/planner/form_data/add_contact_form_9.json b/planner/form_data/add_contact_form_9.json deleted file mode 100644 index 691a76d..0000000 --- a/planner/form_data/add_contact_form_9.json +++ /dev/null @@ -1 +0,0 @@ -{"action": "/clients/9/add", "html": [{"caption": "Surname", "type": "text", "name": "surname"}, {"caption": "Forename", "type": "text", "name": "forename"}, {"caption": "Role", "type": "text", "name": "role"}, {"caption": "Email", "type": "text", "name": "email", "placeholder": "name@example.com"}, {"html": "Telephone information", "type": "p"}, {"caption": "Mobile No", "type": "text", "name": "mobileno"}, {"caption": "Landline No", "type": "text", "name": "landlineno"}, {"html": "Address information", "type": "p"}, {"caption": "Street Number", "type": "text", "name": "streetnumber"}, {"caption": "Street Name", "type": "text", "name": "streetname"}, {"caption": "Post Code", "type": "text", "name": "postcode"}, {"type": "submit", "value": "Add Contact"}, {"type": "hidden", "name": "entity", "value": "Contact"}], "method": "post"} \ No newline at end of file