mirror of
https://koodu.h-i.works/projects/thebadspace
synced 2025-06-25 16:04:37 -05:00
Location Editing Part. 1
Now that full-text searching is set up in the DB, the next step is data population. The adding and editing templates were added as long as routes and base functionality to add single locations. Adding works and editing is almost there but both still need to cleaned up. The basic plumbing will be completed and then the tweaking to account for roles and login status for the sake of security. Part 2 will include clean up and and bulk uploads through the use of CSV files.
This commit is contained in:
34
templates/back/locations.twig
Normal file
34
templates/back/locations.twig
Normal file
@ -0,0 +1,34 @@
|
||||
{% extends "base/frame.twig" %}
|
||||
{% block stylesheets %}
|
||||
<link rel="stylesheet" type="text/css" href="/assets/css/front/start.css?=sdfsdf">
|
||||
{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<section role="loc-index">
|
||||
<h1>
|
||||
Location Listing
|
||||
</h1>
|
||||
{% if notice is defined %}
|
||||
<div role="system-notice">
|
||||
{{ notice }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if mode == "add" %}
|
||||
<h2>Add New Location</h2>
|
||||
{{ include("forms/add-location.twig") }}
|
||||
{% elseif mode == "edit" %}
|
||||
<h2>Editing
|
||||
{{ location.name }}</h2>
|
||||
{{ include("forms/edit-location.twig") }}
|
||||
{% else %}
|
||||
<h2>Take care. These are bad places.</h2>
|
||||
{% for location in list.locations %}
|
||||
<a href="/den/locations/edit/{{ location.uuid }}">
|
||||
<sup>ID:{{ location.id }}</sup>
|
||||
{{ location.name }}</a><br/>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
</section>
|
||||
{% endblock %}
|
@ -1,17 +1,14 @@
|
||||
{% extends "base/frame.twig" %}
|
||||
{% block stylesheets %}
|
||||
<link rel="stylesheet" type="text/css" href="/assets/css/front/start.css?=sdfsdf">
|
||||
<link rel="stylesheet" type="text/css" href="/assets/css/front/start.css?=dfdferer">
|
||||
{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<section>
|
||||
<section role="den-index">
|
||||
<h1>
|
||||
Welcome to the Den.
|
||||
</h1>
|
||||
Hey
|
||||
{{ handle }}
|
||||
. Nice to see you again.
|
||||
<a href="/logout">Bye bye</a>
|
||||
|
||||
</h1>
|
||||
Remember to pace yourself because you're working with some of the worse places on the web. Drink water, takes lot of breaks and remember you are the reason the interent is becoming safer.
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
@ -10,6 +10,28 @@
|
||||
{% block stylesheets %}{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<nav>
|
||||
<div role="nav-left">
|
||||
<a href="/den">The Bad Space</a>
|
||||
</div>
|
||||
<div role="nav-right">
|
||||
|
||||
{% if handle is defined %}
|
||||
<strong>Hey
|
||||
{{ handle }}
|
||||
</strong>
|
||||
{% endif %}
|
||||
<a href="/den/members">Members
|
||||
</a>
|
||||
<a href="/den/locations/page/1">Locations
|
||||
</a>
|
||||
<a href="/logout">Bye</a>
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
|
||||
</header>
|
||||
<main>
|
||||
{% block main %}{% endblock %}
|
||||
</main>
|
||||
|
27
templates/forms/add-location.twig
Normal file
27
templates/forms/add-location.twig
Normal file
@ -0,0 +1,27 @@
|
||||
<form action="{{ path('location-add') }}" method="post" enctype="multipart/form-data">
|
||||
<div>
|
||||
<label>Name</label><br/>
|
||||
<input type="text" name="loc_name" value=""/>
|
||||
<br/>
|
||||
<label>URL</label><br/>
|
||||
<input type="text" name="loc_url" value=""/>
|
||||
<br/>
|
||||
<label>Tags</label><br/>
|
||||
<input type="text" name="loc_tags" value=""/>
|
||||
<br/>
|
||||
<label>Description</label><br/>
|
||||
<textarea name="loc_desc"></textarea>
|
||||
<br/>
|
||||
<label>Rating</label><br/>
|
||||
<select name="rating">
|
||||
<option value="" disabled selected>Choose Rating
|
||||
</option>
|
||||
<option value="silence">Silence</option>
|
||||
<option value="defederate">Defederate</option>
|
||||
</select>
|
||||
<br/>
|
||||
<label>Images</label><br/>
|
||||
<input type="file" id="loc_examples" name="loc_examples[]" multiple/>
|
||||
</div>
|
||||
<input type="hidden" name="token" value="{{ csrf_token('upload') }}"/>
|
||||
<input type="submit" value="Edit Location" name="submit_button"></form>
|
31
templates/forms/edit-location.twig
Normal file
31
templates/forms/edit-location.twig
Normal file
@ -0,0 +1,31 @@
|
||||
<form action="{{ path('location-edit') }}" method="post" enctype="multipart/form-data">
|
||||
<div>
|
||||
<label>Name</label><br/>
|
||||
<input type="text" name="loc_name" value="{{ location.name }}"/>
|
||||
<br/>
|
||||
<label>URL</label><br/>
|
||||
<input type="text" name="loc_url" value="{{ location.url }}"/>
|
||||
<br/>
|
||||
<label>Tags</label><br/>
|
||||
<input type="text" name="loc_tags" value="{{ location.tags }}"/>
|
||||
<br/>
|
||||
<label>Description</label><br/>
|
||||
<textarea name="loc_desc">{{ location.description }}</textarea>
|
||||
<br/>
|
||||
<label>Rating</label><br/>
|
||||
<select name="rating">
|
||||
{% if location.rating == "silence" %}
|
||||
<option value="silence" selected>Silence</option>
|
||||
<option value="defederate">Defederate</option>
|
||||
{% else %}
|
||||
<option value="silence">Silence</option>
|
||||
<option value="defederate" selected>Defederate</option>
|
||||
{% endif %}
|
||||
|
||||
</select>
|
||||
<br/>
|
||||
<label>Images</label><br/>
|
||||
<input type="file" id="loc_examples" name="loc_examples[]" multiple/>
|
||||
</div>
|
||||
<input type="hidden" name="token" value="{{ csrf_token('upload') }}"/>
|
||||
<input type="submit" value="Edit Location" name="submit_button"></form>
|
Reference in New Issue
Block a user