Cars cz. 2
This commit is contained in:
1 parent
d60f8a91a7
commit
3b96ac1be8
9 files changed
+265
-23
No files matched your search
Whitespace-only changes.
@@ -0,0 +1,40 @@
|
||||
<h2>delete cars</h2>
|
||||
<section>
|
||||
<form method="post">
|
||||
<input type="submit" value="Delete Selected"><button onclick=" event.preventDefault();
|
||||
const res = confirm('Confirm deletion');
|
||||
if(res) {
|
||||
window.location='/deleteAll';
|
||||
}" style="margin-left: 1rem;">Delete
|
||||
All</button><br><br>
|
||||
<table>
|
||||
<tr>
|
||||
<th>_id</th>
|
||||
<th>model</th>
|
||||
<th>ubezpieczony</th>
|
||||
<th>benzyna</th>
|
||||
<th>uszkodzony</th>
|
||||
<th>naped4x4</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
{{#each car}}
|
||||
<tr>
|
||||
<td>{{_id}}</td>
|
||||
<td>{{model}}</td>
|
||||
<td>{{ubezpieczony}}</td>
|
||||
<td>{{benzyna}}</td>
|
||||
<td>{{uszkodzony}}</td>
|
||||
<td>{{naped4x4}}</td>
|
||||
<td style="text-align: center;">
|
||||
<button
|
||||
onclick="event.preventDefault(); window.location='/deleteSpecific?id={{_id}}';">DELETE</button>
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" name="deletions" id="del_{{_id}}" value="{{_id}}">
|
||||
</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</table>
|
||||
</form>
|
||||
</section>
|
||||
@@ -0,0 +1,62 @@
|
||||
<h2>edit cars</h2>
|
||||
<section>
|
||||
<table>
|
||||
<tr>
|
||||
<th>_id</th>
|
||||
<th>model</th>
|
||||
<th>ubezpieczony</th>
|
||||
<th>benzyna</th>
|
||||
<th>uszkodzony</th>
|
||||
<th>naped4x4</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
{{#each car}}
|
||||
{{#if edycja}}
|
||||
<tr>
|
||||
<form method="post">
|
||||
<td>{{_id}}<input type="hidden" name="_id" value="{{_id}}"></td>
|
||||
<td><input type="text" name="model" value="{{model}}"></td>
|
||||
<td><select name="ubezpieczony">
|
||||
<option>TAK</option>
|
||||
<option {{#if (equ ubezpieczony 'NIE' )}}selected{{/if}}>NIE</option>
|
||||
<option {{#if (equ ubezpieczony 'BRAK DANYCH' )}}selected{{/if}}>BRAK DANYCH</option>
|
||||
</select></td>
|
||||
<td><select name="benzyna">
|
||||
<option>TAK</option>
|
||||
<option {{#if (equ benzyna 'NIE' )}}selected{{/if}}>NIE</option>
|
||||
<option {{#if (equ benzyna 'BRAK DANYCH' )}}selected{{/if}}>BRAK DANYCH</option>
|
||||
</select></td>
|
||||
<td><select name="uszkodzony">
|
||||
<option>TAK</option>
|
||||
<option {{#if (equ uszkodzony 'NIE' )}}selected{{/if}}>NIE</option>
|
||||
<option {{#if (equ uszkodzony 'BRAK DANYCH' )}}selected{{/if}}>BRAK DANYCH</option>
|
||||
</select></td>
|
||||
<td><select name="naped4x4">
|
||||
<option>TAK</option>
|
||||
<option {{#if (equ naped4x4 'NIE' )}}selected{{/if}}>NIE</option>
|
||||
<option {{#if (equ naped4x4 'BRAK DANYCH' )}}selected{{/if}}>BRAK DANYCH</option>
|
||||
</select></td>
|
||||
<td style="text-align: center;"><button
|
||||
style="background-color: greenyellow; color: black;">UPDATE</button></td>
|
||||
<td style="text-align: center;"><button onclick="event.preventDefault(); window.location='/edit';"
|
||||
style="background-color: orange;">CANCEL</button></td>
|
||||
</form>
|
||||
</tr>
|
||||
{{else}}
|
||||
<tr>
|
||||
<td>{{_id}}</td>
|
||||
<td>{{model}}</td>
|
||||
<td>{{ubezpieczony}}</td>
|
||||
<td>{{benzyna}}</td>
|
||||
<td>{{uszkodzony}}</td>
|
||||
<td>{{naped4x4}}</td>
|
||||
<td style="text-align: center;">
|
||||
<button onclick="window.location = '/edit?id={{_id}}';">EDIT</button>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
</table>
|
||||
</section>
|
||||
@@ -16,6 +16,7 @@
|
||||
<a href="/delete">Delete</a>
|
||||
<a href="/edit">Edit</a>
|
||||
<a href="/search">Search</a>
|
||||
<a href="/advanced_search">Advanced search</a>
|
||||
</nav>
|
||||
{{{ body }}}
|
||||
</body>
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<h2>search cars</h2>
|
||||
<section>
|
||||
<form method="post">
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<div style="width: 50%;">
|
||||
<h3>Wybierz cechę</h3>
|
||||
<input style="margin-top: .5rem;" type="radio" name="criterion" id="r_ubezpieczony"
|
||||
value="ubezpieczony">
|
||||
<label for="r_ubezpieczony">Ubezpieczony</label><br>
|
||||
<input style="margin-top: .5rem;" type="radio" name="criterion" id="r_benzyna" value="benzyna"> <label
|
||||
for="r_benzyna">Benzyna</label><br>
|
||||
<input style="margin-top: .5rem;" type="radio" name="criterion" id="r_uszkodzony" value="uszkodzony">
|
||||
<label for="r_uszkodzony">Uszkodzony</label><br>
|
||||
<input style="margin-top: .5rem;" type="radio" name="criterion" id="r_naped4x4" value="naped4x4"> <label
|
||||
for="r_naped4x4">Napęd
|
||||
4x4</label><br>
|
||||
</div>
|
||||
<div style="width: 50%;">
|
||||
<h3>Wybierz wartość</h3>
|
||||
<input style="margin-top: .5rem;" type="radio" name="value" id="r_tak" value="TAK"> <label
|
||||
for="r_tak">TAK</label><br>
|
||||
<input style="margin-top: .5rem;" type="radio" name="value" id="r_nie" value="NIE"> <label
|
||||
for="r_nie">NIE</label><br>
|
||||
<input style="margin-top: .5rem;" type="radio" name="value" id="r_brakdanych" value="BRAK DANYCH">
|
||||
<label for="r_brakdanych">BRAK DANYCH</label><br>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div>
|
||||
<button>WYSZUKAJ POJAZDY</button>
|
||||
<a href="/search"
|
||||
style="margin-left: 1rem; text-decoration: none; font-weight: bold; color: darkgray;">Reset</a>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
Reference in new issue
Block a user