comparison farol/templates/new.j2 @ 0:4a9f23230eba

Initial Release
author Benoît Allard <benoit.allard@greenbone.net>
date Wed, 24 Sep 2014 10:07:49 +0200
parents
children 2ce3676c9b2e
comparison
equal deleted inserted replaced
-1:000000000000 0:4a9f23230eba
1 {#
2 # Description:
3 # Web Template used in Farol Design
4 #
5 # Authors:
6 # BenoƮt Allard <benoit.allard@greenbone.net>
7 #
8 # Copyright:
9 # Copyright (C) 2014 Greenbone Networks GmbH
10 #
11 # This program is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU General Public License
13 # as published by the Free Software Foundation; either version 2
14 # of the License, or (at your option) any later version.
15 #
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
20 #
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
24 -#}
25
26 {% extends "base.j2" %}
27 {% from "macros.j2" import textinput, textarea %}
28
29 {% set active='new' %}
30
31 {% block title %}New{% endblock %}
32
33 {% block content %}
34 {% if has_document %}
35 <p class="text-danger">You have an unsaved document, maybe you want to <a href={{ url_for('save') }}>save</a> it first ?</p>
36 {% endif %}
37 <h3>New Document</h3>
38
39 <div class="panel-group" id="accordion">
40
41 <div class="panel panel-default">
42 <div class="panel-heading">
43 <h4 class="panel-title">
44 <a data-toggle="collapse" data-parent="#accordion" href="#fromURL">
45 Download document from URL
46 </a>
47 </h4>
48 </div>
49 <div id="fromURL" class="panel-collapse collapse in">
50 <div class="panel-body">
51 <form role="form" method="POST">
52 {{ textinput("url", "URL", "https://...", required=True, type="url") }}
53 <button type="submit", class="btn btn-primary">Download</button>
54 </form>
55 </div>
56 </div>
57 </div>
58
59 <div class="panel panel-default">
60 <div class="panel-heading">
61 <h4 class="panel-title">
62 <a data-toggle="collapse" data-parent="#accordion" href="#fromFile">
63 Upload document
64 </a>
65 </h4>
66 </div>
67 <div id="fromFile" class="panel-collapse collapse">
68 <div class="panel-body">
69 <form role="form" method="POST" enctype="multipart/form-data">
70 {{ textinput("local", "Local File", type="file", required=True) }}
71 <button type="submit", class="btn btn-primary">Upload</button>
72 </form>
73 </div>
74 </div>
75 </div>
76
77 <div class="panel panel-default">
78 <div class="panel-heading">
79 <h4 class="panel-title">
80 <a data-toggle="collapse" data-parent="#accordion" href="#fromText">
81 Some text
82 </a>
83 </h4>
84 </div>
85 <div id="fromText" class="panel-collapse collapse">
86 <div class="panel-body">
87 <form role="form" method="POST">
88 {{ textarea("text", "Document content", value='<?xml version="1.0" encoding="utf-8"?>
89 <cvrfdoc xmlns="http://www.icasi.org/CVRF/schema/cvrf/1.1">
90 <DocumentTitle>Title</DocumentTitle>
91 <DocumentType>Type</DocumentType>
92 <DocumentPublisher Type="Other">
93 </DocumentPublisher>
94 <DocumentTracking>
95 <Identification>
96 <ID>1234</ID>
97 </Identification>
98 <Status>Draft</Status>
99 <Version>0.1</Version>
100 <RevisionHistory>
101 <Revision>
102 <Number>0.1</Number>
103 <Date>' + now.isoformat() + '</Date>
104 <Description>First Revision</Description>
105 </Revision>
106 </RevisionHistory>
107 <InitialReleaseDate>' + now.isoformat() + '</InitialReleaseDate>
108 <CurrentReleaseDate>' + now.isoformat() + '</CurrentReleaseDate>
109 </DocumentTracking>
110 </cvrfdoc>' | escape, required=True) }}
111 <button type="submit", class="btn btn-primary">Parse</button>
112 </form>
113 </div>
114 </div>
115 </div>
116
117 <div class="panel panel-default">
118 <div class="panel-heading">
119 <h4 class="panel-title">
120 <a data-toggle="collapse" data-parent="#accordion" href="#newDoc">
121 Create an empty Document
122 </a>
123 </h4>
124 </div>
125 <div id="newDoc" class="panel-collapse collapse">
126 <div class="panel-body">
127 <form role="form" method="POST">
128 {{ textinput("title", "Document Title", required=True) }}
129 {{ textinput("type", "Document Type", "Security Advisory", required=True) }}
130 <button type="submit", class="btn btn-primary">Create</button>
131 </form>
132 </div>
133 </div>
134 </div>
135
136 </div>
137
138 {% endblock %}

http://farol.wald.intevation.org