Skip to content

Commit 241ee9b

Browse files
committed
titles and sql dump
1 parent 99cfd33 commit 241ee9b

File tree

8 files changed

+36
-121
lines changed

8 files changed

+36
-121
lines changed

forms.sql

+17-120
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
-- http://www.phpmyadmin.net
44
--
55
-- Host: localhost
6-
-- Generation Time: Apr 09, 2015 at 05:58 PM
6+
-- Generation Time: Apr 10, 2015 at 05:29 PM
77
-- Server version: 5.5.41-0ubuntu0.12.04.1-log
88
-- PHP Version: 5.3.10-1ubuntu3.17
99

@@ -31,39 +31,9 @@ CREATE TABLE IF NOT EXISTS `contacts` (
3131
`contact_name` varchar(100) NOT NULL,
3232
`contact_email` varchar(200) NOT NULL,
3333
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
34-
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
35-
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
36-
37-
--
38-
-- Dumping data for table `contacts`
39-
--
40-
41-
INSERT INTO `contacts` (`id`, `contact_name`, `contact_email`, `created_at`, `updated_at`) VALUES
42-
(1, 'Admins', '[email protected]', '0000-00-00 00:00:00', '2015-04-08 20:56:06'),
43-
(4, 'New contact', '[email protected]', '2015-04-09 10:27:59', '2015-04-09 10:27:59'),
44-
(5, 'New contact', '[email protected]', '2015-04-09 11:30:05', '2015-04-09 11:30:05'),
45-
(6, 'Webmaster', '[email protected]', '2015-04-09 12:05:15', '2015-04-09 12:05:27'),
46-
(7, 'Alfonso', '[email protected]', '2015-04-09 14:57:32', '2015-04-09 14:57:41'),
47-
(8, 'New contact', '[email protected]', '2015-04-09 16:45:31', '2015-04-09 16:45:31');
48-
49-
-- --------------------------------------------------------
50-
51-
--
52-
-- Table structure for table `contact_form`
53-
--
54-
55-
CREATE TABLE IF NOT EXISTS `contact_form` (
56-
`id` int(11) NOT NULL,
57-
`form_id` int(11) NOT NULL,
58-
`contact_id` int(11) NOT NULL
59-
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
60-
61-
--
62-
-- Dumping data for table `contact_form`
63-
--
64-
65-
INSERT INTO `contact_form` (`id`, `form_id`, `contact_id`) VALUES
66-
(7, 50, 7);
34+
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
35+
`form_id` int(11) NOT NULL
36+
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=latin1;
6737

6838
-- --------------------------------------------------------
6939

@@ -80,14 +50,7 @@ CREATE TABLE IF NOT EXISTS `fields` (
8050
`length` int(11) NOT NULL DEFAULT '100',
8151
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
8252
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
83-
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=latin1;
84-
85-
--
86-
-- Dumping data for table `fields`
87-
--
88-
89-
INSERT INTO `fields` (`id`, `field_name`, `form_id`, `type_id`, `placeholder`, `length`, `created_at`, `updated_at`) VALUES
90-
(31, 'Your name', 50, 1, 'Please give me your name', 150, '2015-04-09 13:05:17', '2015-04-09 14:57:58');
53+
) ENGINE=InnoDB AUTO_INCREMENT=49 DEFAULT CHARSET=latin1;
9154

9255
-- --------------------------------------------------------
9356

@@ -101,43 +64,7 @@ CREATE TABLE IF NOT EXISTS `forms` (
10164
`redirect` varchar(300) NOT NULL,
10265
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
10366
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP
104-
) ENGINE=InnoDB AUTO_INCREMENT=55 DEFAULT CHARSET=latin1;
105-
106-
--
107-
-- Dumping data for table `forms`
108-
--
109-
110-
INSERT INTO `forms` (`id`, `form_name`, `redirect`, `created_at`, `updated_at`) VALUES
111-
(50, 'My shiny form', 'http://localhost:9079', '2015-04-09 13:05:17', '2015-04-09 14:57:28');
112-
113-
-- --------------------------------------------------------
114-
115-
--
116-
-- Table structure for table `responses_50`
117-
--
118-
119-
CREATE TABLE IF NOT EXISTS `responses_50` (
120-
`id` int(11) NOT NULL,
121-
`field_31` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
122-
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
123-
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
124-
`form_id` int(11) NOT NULL
125-
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
126-
127-
--
128-
-- Dumping data for table `responses_50`
129-
--
130-
131-
INSERT INTO `responses_50` (`id`, `field_31`, `created_at`, `updated_at`, `form_id`) VALUES
132-
(5, 'My name is pepe', '2015-04-09 14:58:10', '2015-04-09 14:58:10', 50),
133-
(6, 'my name is joe', '2015-04-09 16:44:00', '2015-04-09 16:44:00', 50),
134-
(7, 'sasasa', '2015-04-09 17:23:33', '2015-04-09 17:23:33', 50),
135-
(8, 'sasasa', '2015-04-09 17:31:58', '2015-04-09 17:31:58', 50),
136-
(9, 'sasasa', '2015-04-09 17:32:12', '2015-04-09 17:32:12', 50),
137-
(10, 'pepe', '2015-04-09 17:52:19', '2015-04-09 17:52:19', 50),
138-
(11, 'pepe', '2015-04-09 17:52:49', '2015-04-09 17:52:49', 50),
139-
(12, 'pepe', '2015-04-09 17:53:08', '2015-04-09 17:53:08', 50),
140-
(13, 'pepe', '2015-04-09 17:53:33', '2015-04-09 17:53:33', 50);
67+
) ENGINE=InnoDB AUTO_INCREMENT=62 DEFAULT CHARSET=latin1;
14168

14269
-- --------------------------------------------------------
14370

@@ -149,7 +76,7 @@ CREATE TABLE IF NOT EXISTS `types` (
14976
`id` int(11) NOT NULL,
15077
`name` varchar(150) NOT NULL,
15178
`sql_format` varchar(300) NOT NULL
152-
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
79+
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
15380

15481
--
15582
-- Dumping data for table `types`
@@ -158,7 +85,8 @@ CREATE TABLE IF NOT EXISTS `types` (
15885
INSERT INTO `types` (`id`, `name`, `sql_format`) VALUES
15986
(1, 'text', 'varchar(**length**)'),
16087
(2, 'textarea', 'text'),
161-
(3, 'checkbox', 'tinyint(1)');
88+
(3, 'checkbox', 'tinyint(1)'),
89+
(4, 'email', 'varchar(250)');
16290

16391
-- --------------------------------------------------------
16492

@@ -187,15 +115,8 @@ INSERT INTO `users` (`id`, `username`, `password`) VALUES
187115
-- Indexes for table `contacts`
188116
--
189117
ALTER TABLE `contacts`
190-
ADD PRIMARY KEY (`id`);
191-
192-
--
193-
-- Indexes for table `contact_form`
194-
--
195-
ALTER TABLE `contact_form`
196118
ADD PRIMARY KEY (`id`),
197-
ADD KEY `form_id` (`form_id`),
198-
ADD KEY `contact_id` (`contact_id`);
119+
ADD KEY `form_id` (`form_id`);
199120

200121
--
201122
-- Indexes for table `fields`
@@ -212,13 +133,6 @@ ALTER TABLE `fields`
212133
ALTER TABLE `forms`
213134
ADD PRIMARY KEY (`id`);
214135

215-
--
216-
-- Indexes for table `responses_50`
217-
--
218-
ALTER TABLE `responses_50`
219-
ADD PRIMARY KEY (`id`),
220-
ADD KEY `form_id` (`form_id`);
221-
222136
--
223137
-- Indexes for table `types`
224138
--
@@ -239,32 +153,22 @@ ALTER TABLE `users`
239153
-- AUTO_INCREMENT for table `contacts`
240154
--
241155
ALTER TABLE `contacts`
242-
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=9;
243-
--
244-
-- AUTO_INCREMENT for table `contact_form`
245-
--
246-
ALTER TABLE `contact_form`
247-
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=9;
156+
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=18;
248157
--
249158
-- AUTO_INCREMENT for table `fields`
250159
--
251160
ALTER TABLE `fields`
252-
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=41;
161+
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=49;
253162
--
254163
-- AUTO_INCREMENT for table `forms`
255164
--
256165
ALTER TABLE `forms`
257-
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=55;
258-
--
259-
-- AUTO_INCREMENT for table `responses_50`
260-
--
261-
ALTER TABLE `responses_50`
262-
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=14;
166+
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=62;
263167
--
264168
-- AUTO_INCREMENT for table `types`
265169
--
266170
ALTER TABLE `types`
267-
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=4;
171+
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5;
268172
--
269173
-- AUTO_INCREMENT for table `users`
270174
--
@@ -275,11 +179,10 @@ ALTER TABLE `users`
275179
--
276180

277181
--
278-
-- Constraints for table `contact_form`
182+
-- Constraints for table `contacts`
279183
--
280-
ALTER TABLE `contact_form`
281-
ADD CONSTRAINT `contact_form_ibfk_1` FOREIGN KEY (`form_id`) REFERENCES `forms` (`id`),
282-
ADD CONSTRAINT `contact_form_ibfk_2` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`);
184+
ALTER TABLE `contacts`
185+
ADD CONSTRAINT `contacts_ibfk_1` FOREIGN KEY (`form_id`) REFERENCES `forms` (`id`);
283186

284187
--
285188
-- Constraints for table `fields`
@@ -288,12 +191,6 @@ ALTER TABLE `fields`
288191
ADD CONSTRAINT `fields_ibfk_3` FOREIGN KEY (`form_id`) REFERENCES `forms` (`id`),
289192
ADD CONSTRAINT `fields_ibfk_4` FOREIGN KEY (`type_id`) REFERENCES `types` (`id`);
290193

291-
--
292-
-- Constraints for table `responses_50`
293-
--
294-
ALTER TABLE `responses_50`
295-
ADD CONSTRAINT `responses_50_ibfk_1` FOREIGN KEY (`form_id`) REFERENCES `forms` (`id`);
296-
297194
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
298195
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
299196
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

templates/layout/layout.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<head>
77
<meta charset="utf-8">
88
<meta http-equiv="X-UA-Compatible" content="IE=edge">
9-
<title>{{ title }}</title>
9+
<title>{% block title %}{% endblock %} ~ HF Forms</title>
1010
<meta name="description" content="">
1111
<meta name="viewport" content="width=device-width, initial-scale=1">
1212
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->

templates/pages/editform.html

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{% extends "layout/layout.html" %}
2+
3+
{% block title %}Edit form{% endblock %}
4+
25
{% block content %}
36

47
<a href="/">Back to listing</a>

templates/pages/error.html

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{% extends "layout/layout.html" %}
2+
3+
{% block title %}Whoops!!{% endblock %}
4+
25
{% block content %}
36
<a href="/">Back to listing</a>
47
<h1>Error</h1>

templates/pages/listing.html

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{% extends "layout/layout.html" %}
2+
3+
{% block title %}Form listing{% endblock %}
4+
25
{% block content %}
36

47
<h1>Listing of forms</h1>

templates/pages/login.html

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{% extends "layout/layout.html" %}
2+
3+
{% block title %}Sign in{% endblock %}
4+
25
{% block content %}
36

47
<div class="container col-md-6 col-md-offset-2">

templates/pages/newform.html

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{% extends "layout/layout.html" %}
2+
3+
{% block title %}New form{% endblock %}
4+
25
{% block content %}
36

47
<a href="/">Back to listing</a>

templates/pages/responses.html

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{% extends "layout/layout.html" %}
2+
3+
{% block title %}Responses to {{ form.form_name }} {% endblock %}
4+
25
{% block content %}
36

47
<a href="/">Back to listing</a>

0 commit comments

Comments
 (0)