Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TFG-Informatica-PabloMarcos
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pabmarc
TFG-Informatica-PabloMarcos
Commits
8ae47a6c
Commit
8ae47a6c
authored
Jun 22, 2023
by
pabmarc
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
a343eb80
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/template_landingpage.html
+225
-0
225 additions, 0 deletions
app/template_landingpage.html
with
225 additions
and
0 deletions
app/template_landingpage.html
0 → 100644
+
225
−
0
View file @
8ae47a6c
<!doctype html>
<html
lang=
"es"
>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, shrink-to-fit=no"
>
<!-- Bootstrap CSS -->
<link
rel=
"stylesheet"
href=
"https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css"
integrity=
"sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"
crossorigin=
"anonymous"
>
<title>
TFGPabloMarcos
</title>
<link
rel=
"icon"
href=
"https://upload.wikimedia.org/wikipedia/commons/thumb/1/1d/Logotipo_de_la_Universidad_de_Valladolid.svg/1200px-Logotipo_de_la_Universidad_de_Valladolid.svg.png"
>
</head>
<body
style=
"overflow-x: hidden;"
>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script
src=
"https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity=
"sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin=
"anonymous"
></script>
<script
src=
"https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js"
integrity=
"sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
crossorigin=
"anonymous"
></script>
<script
src=
"https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js"
integrity=
"sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
crossorigin=
"anonymous"
></script>
<div
class=
"container-fluid p-0"
style=
"padding:0"
>
<div
class=
"row p-0 g-0 align-items-center"
id=
"cabecera"
style=
"background: linear-gradient(0deg, rgba(139,139,139,0.5) 0%, rgba(202,202,202,0.5) 100%); border-bottom: 5px solid black"
>
<!-- Titulos -->
<div
class=
"col-2 align-self-center text-center"
id=
"boton-about"
>
<a
class=
"btn btn-primary"
href=
"{{ url_for('about') }}"
role=
"button"
style=
"margin-bottom: 5px"
>
Sobre la página
</a>
</div>
<div
class=
"col-10 p-0 g-0 justify-content-md-center"
id=
"logo"
style=
"text-align: center"
>
<a
href=
"/"
><img
src=
"/static/ethical-news-nobg.png"
alt=
"Ethical News"
style=
"margin: 5px; height: 65%; width: 25%"
></a>
</div>
</div>
<div
class=
"row justify-content-start"
id=
"content"
>
<div
class=
"col-2"
id=
"filtro"
style=
"background: linear-gradient(0deg, rgba(202,202,202,0.3) 0%, rgba(139,139,139,0.5) 100%)"
>
<form
action=
"/news_list"
method=
"post"
style=
"text-align: justify; margin-top: 5px"
>
<div
class=
"row"
>
<div
class=
"col-11"
style=
"margin:auto"
>
<div
class=
"form-group"
id=
"buscador"
>
<label><b>
Palabra clave
</b></label>
<input
class=
"form-control"
type=
"text"
name=
"keyword"
placeholder=
"Inserte palabra clave"
style=
"text-align: center; margin: auto"
>
</div>
</div>
</div>
<!-- Checkbox sources -->
<div
class=
"row"
>
<div
class=
"col-11"
style=
"margin:auto"
>
<div
class=
"form-group"
id=
"fuentes"
>
<label><b>
Fuentes
</b></label>
<div
class=
"form-check"
>
<label
class=
"form-check-label"
>
<input
class=
"form-check-input"
type=
"checkbox"
name=
"source"
value=
"'Colpisa'"
{{
'
checked=
"checked"
'
if
"'
Colpisa
'"
in
session.get
('
sources
')
else
""
}}
>
Colpisa
</label>
</div>
<div
class=
"form-check"
>
<label
class=
"form-check-label"
>
<input
class=
"form-check-input"
type=
"checkbox"
name=
"source"
value=
"'EFE'"
{{
'
checked=
"checked"
'
if
"'
EFE
'"
in
session.get
('
sources
')
else
""
}}
>
EFE
</label>
</div>
<div
class=
"form-check"
>
<label
class=
"form-check-label"
>
<input
class=
"form-check-input"
type=
"checkbox"
name=
"source"
value=
"'EuropaPress'"
{{
'
checked=
"checked"
'
if
"'
EuropaPress
'"
in
session.get
('
sources
')
else
""
}}
>
EuropaPress
</label>
</div>
<div
class=
"form-check"
>
<label
class=
"form-check-label"
>
<input
class=
"form-check-input"
type=
"checkbox"
name=
"source"
value=
"'ElMundoToday'"
{{
'
checked=
"checked"
'
if
"'
ElMundoToday
'"
in
session.get
('
sources
')
else
""
}}
>
ElMundoToday
</label>
</div>
<div
class=
"form-check"
>
<label
class=
"form-check-label"
>
<input
class=
"form-check-input"
type=
"checkbox"
name=
"source"
value=
"'Outono'"
{{
'
checked=
"checked"
'
if
"'
Outono
'"
in
session.get
('
sources
')
else
""
}}
>
Outono
</label>
</div>
<div
class=
"form-check"
>
<label
class=
"form-check-label"
>
<input
class=
"form-check-input"
type=
"checkbox"
name=
"source"
value=
"'VisionTimes'"
{{
'
checked=
"checked"
'
if
"'
VisionTimes
'"
in
session.get
('
sources
')
else
""
}}
>
VisionTimes
</label>
</div>
</div>
</div>
</div>
<!-- Orden (por defecto fecha descendente) -->
<div
class=
"row"
>
<div
class=
"col-11"
style=
"margin:auto"
>
<div
class=
"form-group"
id=
"orden"
>
<label><b>
Ordenar por
</b></label>
<select
class=
"form-control"
name=
"order"
style=
"text-align: center"
>
<option
value=
"publication_date DESC"
selected
>
Fecha publicación (desc.)
</option>
<option
value=
"publication_date ASC"
>
Fecha publicación (asc.)
</option>
<option
value=
"collection_date DESC"
>
Fecha extraccion (desc.)
</option>
<option
value=
"collection_date DESC"
>
Fecha extraccion (asc.)
</option>
<option
value=
"headline ASC"
>
Título (A-Z)
</option>
<option
value=
"headline DESC"
>
Título (Z-A)
</option>
</select>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col text-center"
id=
"botones"
>
<button
type=
"submit"
class=
"btn btn-primary"
id=
"filtrar"
style=
"margin: 5px"
>
Filtrar
</button>
<button
class=
"btn btn-primary"
onclick=
"resetForm()"
id=
"reset"
>
Reset
</button>
</div>
</div>
</form>
</div>
<div
class=
"col-10"
id=
"tabla-noticias"
style=
"background: linear-gradient(0deg, rgba(202,202,202,0.1) 0%, rgba(139,139,139,0.1) 100%)"
>
<!-- Numero de resultados encontrados -->
<h5
style=
"text-align: center; margin: 10px"
id=
"num-resultados"
><b>
{{num_news}} noticias encontradas
</b></h5>
<div
class=
"row"
>
<!-- Tabla con los resultados (25 resultados por pagina) -->
<div
class=
"table table-striped table-bordered table-hover"
>
<table
style=
"width:100%"
>
<thead
class=
"thead-dark"
>
<tr>
<th>
Título
</th>
<th>
Fuente
</th>
<th>
Fecha de publicación
</th>
<th>
Tema
</th>
</tr>
</thead>
<tbody>
{% for new in news %}
<tr>
<td
class=
"news_headline"
id=
"headline"
><a
href=
"{{ url_for('noticia', id=new[0]) }}"
>
{{ new[1] }}
</a></td>
<td
class=
"news_source"
id=
"fuente"
>
{{ new[5] }}
</td>
<td
class=
"news_publicationdate"
id=
"publicacion"
>
{{ new[3] }}
</td>
<td
class=
"news_topic"
id=
"tema"
>
{{ new[4][0]|upper }}{{ new[4][1:] }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-2"
style=
"background: linear-gradient(0deg, rgba(139,139,139,0.3) 0%, rgba(202,202,202,0.3) 100%)"
></div>
<div
class=
"col-10"
style=
"background: linear-gradient(0deg, rgba(139,139,139,0.3) 0%, rgba(202,202,202,0.3) 100%)"
>
<!-- Paginacion -->
<nav
aria-label=
"Page navigation"
id=
pagination
style=
"margin-top:15px"
>
<ul
class=
"pagination justify-content-center"
>
<!-- Condicion si numero de pagina actual es mayor que uno mostrar boton previous -->
{% if page > 1 %}
<li
class=
"page-item"
><a
class=
"page-link"
href=
"/news_list?page={{page-1}}"
>
Previous
</a></li>
{% endif %}
<!-- Condicion si el numero de paginas es menor que 6 -->
{% if pages
<
6
%}
{%
for
i
in
range
(1,
pages
+1)
%}
{%
if
i=
=page
%}
<
li
class=
"page-item active"
><a
class=
"page-link"
href=
"/news_list?page={{i}}"
>
{{i}}
</a></li>
{% else %}
<li
class=
"page-item"
><a
class=
"page-link"
href=
"/news_list?page={{i}}"
>
{{i}}
</a></li>
{% endif %}
{% endfor %}
{% else %}
<!-- Si la pagina actual es menor que 6 -->
{% if page
<
6
%}
{%
for
i
in
range
(1,
page
+4)
%}
{%
if
i=
=page
%}
<
li
class=
"page-item active"
><a
class=
"page-link"
href=
"/news_list?page={{i}}"
>
{{i}}
</a></li>
{% else %}
<li
class=
"page-item"
><a
class=
"page-link"
href=
"/news_list?page={{i}}"
>
{{i}}
</a></li>
{% endif %}
{% endfor %}
<!-- Si la pagina es mayor que 6 -->
{% else %}
<li
class=
"page-item"
><a
class=
"page-link"
href=
"/news_list?page=1"
>
1
</a></li>
<li
class=
"disabled"
style=
"margin: 5px"
>
...
</li>
<!-- Si son las ultimas paginas -->
{% if page> pages-4 %}
{% for i in range(page-3, pages+1) %}
{% if i==page %}
<li
class=
"page-item active"
><a
class=
"page-link"
href=
"/news_list?page={{i}}"
>
{{i}}
</a></li>
{% else %}
<li
class=
"page-item"
><a
class=
"page-link"
href=
"/news_list?page={{i}}"
>
{{i}}
</a></li>
{% endif %}
{% endfor %}
{% else %}
<!-- Si no son las ultimas paginas -->
{% for i in range(page-3, page+4) %}
{% if i==page %}
<li
class=
"page-item active"
><a
class=
"page-link"
href=
"/news_list?page={{i}}"
>
{{i}}
</a></li>
{% else %}
<li
class=
"page-item"
><a
class=
"page-link"
href=
"/news_list?page={{i}}"
>
{{i}}
</a></li>
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% endif %}
<!-- Para mostrar ... {paginafinal} -->
{% if page
<
pages-3
%}
<
li
class=
"disabled"
style=
"margin: 5px"
>
...
</li>
<li
class=
"page-item"
><a
class=
"page-link"
href=
"/news_list?page={{pages}}"
>
{{pages}}
</a></li>
{% endif %}
<!-- Condicion si numero de pagina actual es mayor que uno mostrar boton next -->
{% if page
<
pages
%}
<
li
class=
"page-item"
><a
class=
"page-link"
href=
"/news_list?page={{page+1}}"
>
Next
</a></li>
{% endif %}
</ul>
</nav>
</div>
</div>
<div
class=
"row g-0 p-0"
>
<div
class=
"col-2"
style=
"background: AliceBlue"
></div>
<div
class=
"col-10"
id=
"foot"
style=
"text-align: center; background: AliceBlue;font-style: italic; bottom:0;"
>
TFG Pablo Marcos Parra - Proyecto Ethical News - Año 2023 - Universidad de Valladolid - Air Institute
</div>
</div>
</div>
</body>
<!-- Script para actualizar o no campos de keyword y order -->
<script>
var
keyword_cookie
=
{{
session
.
get
(
'
keyword
'
,
''
)
|
tojson
}};
var
order_cookie
=
{{
session
.
get
(
'
order
'
,
'
publication_date DESC
'
)
|
tojson
}};
$
(
'
input[name="keyword"]
'
).
val
(
keyword_cookie
);
$
(
'
select[name="order"]
'
).
val
(
order_cookie
);
</script>
<script>
function
resetForm
(){
$
(
'
input[name="keyword"]
'
).
val
(
""
);
$
(
'
select[name="order"]
'
).
val
(
'
publication_date DESC
'
);
$
(
'
input[type=checkbox]
'
).
prop
(
'
checked
'
,
true
);
}
</script>
</html>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment