Skip to content

Commit

Permalink
Update Form
Browse files Browse the repository at this point in the history
Remove duplicate fields
  • Loading branch information
anoited007 committed Aug 8, 2019
1 parent 17594a3 commit 08cec53
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 28 deletions.
2 changes: 1 addition & 1 deletion chrome_bpki.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def generate_csr() -> html:
csr = CsrGenerator(request.form)
nic_id = request.form['CN']
password = request.form['password']
org_id = request.form['org_id']
org_id = request.form['O']
user_directory = generate_hash(nic_id, org_id)[:12]
generate_pem(nic_id, user_directory, password, csr.csr)
generate_p12(nic_id, user_directory, password, csr.private_key)
Expand Down
2 changes: 1 addition & 1 deletion firefox_bpki.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def generate_csr():
csr = CsrGenerator(request.form)
nic_id = request.form['CN']
password = request.form['password']
org_id = request.form['org_id']
org_id = request.form['O']
user_directory = generate_hash(nic_id, org_id)[:12]
generate_pem(nic_id, user_directory, password, csr.csr)
generate_p12(nic_id, user_directory, password, csr.private_key)
Expand Down
5 changes: 0 additions & 5 deletions static/js/main.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@

$(function() {

$(".close").on("click", function() {
$(this).closest(".modal").removeClass("active");
});

$("#csr-form").submit(function (e) {
e.preventDefault();
$("#csr-modal").addClass("active");

$.post("/generate", $(this).serialize())
.done(function (data) {
// console.log(data);
Expand Down
36 changes: 15 additions & 21 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,24 @@
<div class="columns">
<div class="centered column col-10 bg-grey">

<form id="csr-form">
<form id="csr-form" enctype="multipart/form-data">

<div class="form-group" id="basic-details">
<!-- <div class="form-group" id="basic-details">
<label class="form-label tooltip tooltip-left" data-tooltip="Your Org Handle" for="org-id">Org Handle</label>
<input class="form-input input-lg" type="text" name="org_id" id="org-id" placeholder="Org Handle" autofocus required/>
</div>

<div class="form-group">
<label class="form-label tooltip tooltip-left" data-tooltip="Your NIC Handle" for="nic-id">NIC Handle</label>
<input class="form-input input-lg" type="text" name="nic-id" id="nic-id" list="nic-ids" required placeholder="Enter Nic handle or select from dropdown"/>
<datalist class="form-select" id="nic-ids" >
<option value=""> Please select NIC-Handle</option>

</datalist>
</div>
</div> -->
<div class="form-group">
<label class="form-label tooltip tooltip-left" data-tooltip="Organization Handle" for="org">Organization Handle</label>
<input class="form-input input-lg" type="text" id="org-id" placeholder="Org Handle" name="O" autofocus required />
</div>

<div class="form-group">
<label class="form-label tooltip tooltip-left" data-tooltip="Your NIC Handle" for="nic-id">NIC Handle</label>
<input class="form-input input-lg" type="text" name="CN" id="nic-id" list="nic-ids" required placeholder="XXXX-XXXXXX"/>
<datalist class="form-select" id="nic-ids" >
<option value=""> Please select NIC-Handle</option>
</datalist>
</div>

<div class="form-group">
<label class="form-label tooltip-left" data-tooltip="Your password" for="password">Password</label>
Expand All @@ -45,20 +48,11 @@
<input class="form-input input-lg" type="text" id="locality" placeholder="Locality" name="L" required />
</div>

<div class="form-group">
<label class="form-label tooltip tooltip-left" data-tooltip="Full legal company or personal name" for="org">Organization</label>
<input class="form-input input-lg" type="text" id="org" placeholder="Your Company Name" name="O" readonly required />
</div>

<div class="form-group">
<label class="form-label tooltip tooltip-left" data-tooltip="Branch of organization" for="org-unit">Organizational Unit</label>
<input class="form-input input-lg" type="text" id="org-unit" placeholder="Marketing" name="OU" required />
</div>

<div class="form-group">
<label class="form-label tooltip tooltip-left" data-tooltip="The FQDN for your domain" for="common-name">Common Name</label>
<input class="form-input input-lg" type="text" id="common-name" placeholder="example.com" name="CN" readonly required />
</div>

<div class="form-group">

Expand Down

0 comments on commit 08cec53

Please sign in to comment.