49 lines
2.8 KiB
HTML
49 lines
2.8 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Añadir Fuente URL{% endblock %}
|
|
{% block content %}
|
|
<div class="row justify-content-center">
|
|
<div class="col-md-8">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h4 class="mb-0">Añadir Nueva Fuente de Noticias URL</h4>
|
|
</div>
|
|
<div class="card-body">
|
|
<p class="card-text text-muted">Añade un periódico o sitio de noticias para poder procesar sus artículos más tarde.</p>
|
|
<form action="{{ url_for('add_url_source') }}" method="post" class="mt-3">
|
|
<div class="mb-3">
|
|
<label for="nombre" class="form-label"><strong>Nombre de la Fuente</strong></label>
|
|
<input type="text" class="form-control" id="nombre" name="nombre" required placeholder="Ej: El País (Portada)">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="url" class="form-label"><strong>URL de la Fuente</strong></label>
|
|
<input type="url" class="form-control" id="url" name="url" required placeholder="https://elpais.com">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="categoria_id" class="form-label"><strong>Categoría por Defecto</strong></label>
|
|
<select class="form-select" id="categoria_id" name="categoria_id">
|
|
<option value="">-- Sin categoría --</option>
|
|
{% for cat in categorias %}<option value="{{ cat.id }}">{{ cat.nombre }}</option>{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="pais_id" class="form-label"><strong>País por Defecto</strong></label>
|
|
<select class="form-select" id="pais_id" name="pais_id">
|
|
<option value="">-- Sin país --</option>
|
|
{% for p in paises %}<option value="{{ p.id }}">{{ p.nombre }}</option>{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="idioma" class="form-label"><strong>Idioma (código de 2 letras)</strong></label>
|
|
<input type="text" class="form-control" id="idioma" name="idioma" value="es" required pattern="[a-z]{2}">
|
|
</div>
|
|
<div class="d-flex justify-content-end pt-3">
|
|
<a href="{{ url_for('manage_urls') }}" class="btn btn-secondary" style="margin-right: 10px;">Cancelar</a>
|
|
<button type="submit" class="btn">Guardar Fuente</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|