Skip to content
This repository has been archived by the owner on Feb 7, 2019. It is now read-only.

Commit

Permalink
style and cleaning html
Browse files Browse the repository at this point in the history
  • Loading branch information
xmarcoied committed Aug 27, 2017
1 parent 1259d15 commit 2828786
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 107 deletions.
60 changes: 28 additions & 32 deletions html/channel.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
}
</style>
</head>

<body>
{{ template "head.html" . }}
<hr>
Expand Down Expand Up @@ -44,39 +43,37 @@ <h2>New Channel </h2>
</form>
{{end}}
{{if eq .title "view channel"}}
<table style="width:50%">
<tr>
<th colspan="2">
<h2>{{.channel.Name}} channel</h2>
</th>
</tr>
<tr>
<th>Name :</th>
<td> {{.channel.Name}} </td>
</tr>
<tr>
<th>Public Key :</th>
<td> <textarea rows="10" cols="65" readonly>{{.channel.PublicKey}}</textarea></td>
</tr>
<tr>
<th>fingerprint</th>
<td>{{.fingerprint}}</td>
</tr>
<tr>
<th>releases count :</th>
<td>{{.channel.ReleasesCount}} releases</td>
</tr>
<tr>
<td colspan="2">
<button onclick="DeleteChannel()">Delete</button>
</td>
</tr>
</table>
<table style="width:50%">
<tr>
<th colspan="2">
<h2>{{.channel.Name}} channel</h2>
</th>
</tr>
<tr>
<th>Name :</th>
<td> {{.channel.Name}} </td>
</tr>
<tr>
<th>Public Key :</th>
<td> <textarea rows="10" cols="65" readonly>{{.channel.PublicKey}}</textarea></td>
</tr>
<tr>
<th>fingerprint</th>
<td>{{.fingerprint}}</td>
</tr>
<tr>
<th>releases count :</th>
<td>{{.channel.ReleasesCount}} releases</td>
</tr>
<tr>
<td colspan="2">
<button onclick="DeleteChannel()">Delete</button>
</td>
</tr>
</table>
{{end}}
<hr>
<script type="text/javascript">
'strict mode'
var foo = 1 ;
function DeleteChannel() {
if (confirm("You're going to delete the {{.channel.Name}} channel ") == true) {
var xhr = new XMLHttpRequest();
Expand All @@ -85,7 +82,6 @@ <h2>{{.channel.Name}} channel</h2>
window.location.href='/admin/dashboard/channels'
}
}

function ValidatePubKey(oFormElement){
var request = new XMLHttpRequest();
request.open('POST', '/admin/dashboard/channels/check', /* async = */ false);
Expand Down
9 changes: 2 additions & 7 deletions html/channels.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,19 @@
<td colspan="2"><h2>All Channels</h2></td>
</tr>
<tr>
<td colspan="2"><a href="/admin/dashboard/channels/add">Add new channel</a></td>
<td colspan="2"><a href = "/admin/dashboard/channels/add">Add new channel</a></td>
</tr>
<tr>
<th>ID</th>
<th>Name</th>
</tr>
{{ range .channels }}
<tr onclick="GoNav('/admin/dashboard/channel/{{.Name}}')" style="cursor: pointer;">
<tr onclick="location.href = '/admin/dashboard/channel/{{.Name}}'" style="cursor: pointer;">
<td>{{.ID}}</td>
<td> <a href="/admin/dashboard/channel/{{.Name}}"> {{.Name}} </a></td>
</tr>
{{ end }}
</table>
<hr>
<script type="text/javascript">
function GoNav(url){
document.location.href = url;
}
</script>
</body>
</html>
10 changes: 5 additions & 5 deletions html/newrelease.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,17 @@ <h1>New Release</h1>
<th>Product Version : </th>
<th> <input name="product_ver" style="height: 30px;" required> </th>
</tr>
<tr>
<th>URL : </th>
<th> <input name="url" style="height: 30px;" required> </th>
</tr>
<tr>
<th>Title : </th>
<th> <input name="title" style="height: 30px;" required> </th>
</tr>
<tr>
<th>URL : </th>
<th> <input name="url" style="width:450px;height:30px" required> </th>
</tr>
<tr>
<th>Description : </th>
<th> <input name="desc" style="height: 30px;" required> </th>
<th> <textarea name="desc" style="width:450px;height:100px" required> </textarea> </th>
</tr>
<tr>
<td><input type="reset"></td>
Expand Down
17 changes: 10 additions & 7 deletions html/release.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ <h2 style="display: inline;color: blue;">active</h2>
</div>
<hr>
<div>
<form style="display: inline; margin: 0;" action="/admin/dashboard/release/{{.release.ID}}/active" method="post">
<form style="display: inline; margin: 0;" action="/admin/dashboard/release/{{.release.ID}}/active" onsubmit ="return ActivateHandler()" method="post">
{{if eq .release.Active false}}
<input type="submit" value="Activate">
{{end}}
{{if eq .release.Active true}}
<input type="submit" value="Deactivate">
{{end}}
</form>
<button style="display: inline;" onclick="Duplicate()">Duplicate</button>
<button style="display: inline;" onclick="DeleteRelease()">Delete</button>
<button style="display: inline;" onclick="DuplicateHandler()">Duplicate</button>
<button style="display: inline;" onclick="Delete_ReleaseHandler()">Delete</button>
</div>

</th>
Expand Down Expand Up @@ -164,11 +164,11 @@ <h2 style="display: inline;color: blue;">active</h2>
</tr>
<tr>
<th>URL :</th>
<th> <input name="url" value="{{.release.URL}}" style="width:450; height: 30px;" required> </th>
<th> <input name="url" value="{{.release.URL}}" style="width:450px; height: 30px;" required> </th>
</tr>
<tr>
<th>Description :</th>
<th> <textarea name="desc" style="width:450;height:100" style="height: 30px;" required>{{.release.Description}}</textarea></th>
<th> <textarea name="desc" style="width:450px;height:100px" required>{{.release.Description}}</textarea></th>
</tr>
<tr>
<th>CreatedAt</th>
Expand All @@ -185,13 +185,16 @@ <h2 style="display: inline;color: blue;">active</h2>
</table>
</form>
<script type="text/javascript">
function Duplicate(){
function ActivateHandler(){
return (confirm("You're going to active the release #{{.release.ID}}"));
}
function DuplicateHandler(){
if (confirm("You're going to duplicate the release #{{.release.ID}}")){
document.location.href = '/admin/dashboard/release/{{.release.ID}}/duplicate';
}
}

function DeleteRelease() {
function Delete_ReleaseHandler() {
if (confirm("You're going to delete the release #{{.release.ID}}") == true) {
var xhr = new XMLHttpRequest();
xhr.open('DELETE', '/admin/dashboard/release/{{.release.ID}}/delete');
Expand Down
60 changes: 27 additions & 33 deletions html/releases.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,33 @@
<td colspan="6"><a href="/admin/dashboard/releases/new">Add new release</a></td>
</tr>
<tr>
<td colspan="10">
<form style=" margin: 0;" action="/admin/dashboard/releases" method="get">
<label>Status:</label>
<select name="status">
<option value=""></option>
<option {{if eq $.release.Status "true"}}selected{{end}} value="true">Active</option>
<option {{if eq $.release.Status "false"}}selected{{end}} value="false">Inactive</option>
</select>
<label>Product:</label>
<input style="width: 100" type=text name=product value="{{.release.Product}}">
<label>Channel:</label>
<select name="channel">
<option value=""></option>
{{range .allchannels}}
{{if eq .Name $.release.Channel}}
<option selected="selected" value={{.Name}}>{{.Name}}</option>
{{end}}
{{if ne .Name $.release.Channel}}
<option value={{.Name}}>{{.Name}}</option>
{{end}}
<td colspan="10">
<form style=" margin: 0;" action="/admin/dashboard/releases" method="get">
<label>Status:</label>
<select name="status">
<option value=""></option>
<option {{if eq $.release.Status "true"}}selected{{end}} value="true">Active</option>
<option {{if eq $.release.Status "false"}}selected{{end}} value="false">Inactive</option>
</select>
<label>Product:</label>
<input style="width: 100" type=text name=product value="{{.release.Product}}">
<label>Channel:</label>
<select name="channel">
<option value=""></option>
{{range .allchannels}}
{{if eq .Name $.release.Channel}}
<option selected="selected" value={{.Name}}>{{.Name}}</option>
{{end}}
</select>
| <input type="submit" value="view"> |
<input type="reset" value="reset">
</form>
</td>
</tr>
{{if ne .Name $.release.Channel}}
<option value={{.Name}}>{{.Name}}</option>
{{end}}
{{end}}
</select>
| <input type="submit" value="view"> |
<input type="reset" value="reset">
</form>
</td>
</tr>
<tr>
<th>ID</th>
<th>Status</th>
Expand All @@ -60,7 +60,7 @@
<th>OS</th>
</tr>
{{ range .releases }}
<tr onclick="GoNav('/admin/dashboard/release/{{ .ID }}')" style="cursor: pointer;">
<tr onclick="location.href = '/admin/dashboard/release/{{ .ID }}'" style="cursor: pointer;">
<td> <a href="/admin/dashboard/release/{{.ID}}"> {{.ID}} </a></td>
<td>
{{if eq .Active true}}
Expand All @@ -76,13 +76,7 @@
<td>{{.OS}}-{{.OsVer}}/{{.OsArch}}bit</td>
</tr>
{{ end }}

</table>
<hr>
<script type="text/javascript">
function GoNav(url){
document.location.href = url;
}
</script>
</body>
</html>
45 changes: 22 additions & 23 deletions html/requests.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@
<input {{if ne $.request.OsArch ""}}checked{{end}} type='checkbox' id = "os_arch" onclick='handleClick(this);'>OS Arch
</label>
<br>
<div id = "release-product" style="margin:1;display: inline-flex;">
<div id = "request-product" style="margin:1;display: inline-flex;">
<label>Product:</label>
<input style="width: 100" type=text name=product value="{{.request.Product}}">
</div>
<div id = "release-channel" style="margin:1;display: inline-flex;">
<div id = "request-channel" style="margin:1;display: inline-flex;">
<label>Channel:</label>
<select name="channel">
<option value="">All</option>
Expand All @@ -66,23 +66,23 @@
{{end}}
</select>
</div>
<div id = "release-status" style="margin:1;display: none;">
<div id = "request-status" style="margin:1;display: none;">
<label>Status:</label>
<select name="status">
<option value=""></option>
<option {{if eq $.request.Status "true"}}selected{{end}} value="true">Accepted</option>
<option {{if eq $.request.Status "false"}}selected{{end}} value="false">Refused</option>
</select>
</div>
<div id = "release-os" style="margin:1;display: none;">
<div id = "request-os" style="margin:1;display: none;">
<label>OS:</label>
<input style="width: 100" type=text name=os value="{{.request.OS}}">
</div>
<div id = "release-os_ver" style="margin:1;display: none;">
<div id = "request-os_ver" style="margin:1;display: none;">
<label>OS Ver:</label>
<input style="width: 100" type=text name=os_ver value="{{.request.OsVer}}">
</div>
<div id = "release-os_arch" style="margin:1;display: none;">
<div id = "request-os_arch" style="margin:1;display: none;">
<label>OS Arch:</label>
<input style="width: 100" type=text name=os_arch value="{{.request.OsArch}}">
</div>
Expand Down Expand Up @@ -139,22 +139,21 @@
</table>
<hr>
<script type="text/javascript">
function handleClick(cb) {
console.log('release-' + cb.id , cb.checked)
if (cb.checked){
document.getElementById('release-' + cb.id).style.display = "inline-flex";
}else{
document.getElementById('release-' + cb.id).style.display = "none";
function handleClick(cb) {
if (cb.checked){
document.getElementById('request-' + cb.id).style.display = "inline-flex";
}else{
document.getElementById('request-' + cb.id).style.display = "none";
}
}
}
var requests_ch = ["os" , "status" , "channel" , "product" , "os_ver" ,"os_arch"]
for (i = 0; i < requests_ch.length; i++) {
if(document.getElementById(requests_ch[i]).checked == true){
document.getElementById('release-'+requests_ch[i]).style.display = "inline-flex";
}else{
document.getElementById('release-'+requests_ch[i]).style.display = "none";
}
}
</script>
var requests_ch = ["os" , "status" , "channel" , "product" , "os_ver" ,"os_arch"]
for (i = 0; i < requests_ch.length; i++) {
if(document.getElementById(requests_ch[i]).checked == true){
document.getElementById('request-'+requests_ch[i]).style.display = "inline-flex";
}else{
document.getElementById('request-'+requests_ch[i]).style.display = "none";
}
}
</script>
</body>
</html>
</html>

0 comments on commit 2828786

Please sign in to comment.