Commit ea7e4725 authored by cynddl's avatar cynddl

Add initial templates

parent e3b6ae39
{% extends "base.html" %}
{% block content %}
{% for article in object_list %}
{% endfor %}
<div class="row">
<div class="col-md-12 white-pure">
<ul class="nav nav-integrated">
<li class="nav-item{% if filter_view == 'flux' %} active{% endif %}">
<a class="nav-link" href="{% url 'article-list' filter_view='flux'%}">
Flux <img style="width: 2rem; margin-left: 0.5rem;" src="/static/img/cochon-01.png" alt="">
</a>
</li>
<li class="nav-item {% if filter_view == 'draft' %} active{% endif %}">
<a class="nav-link" href="{% url 'article-list' filter_view='draft'%}">
En attente <span class="badge badge-default">{{nb_draft}}</span>
</a>
</li>
<li class="nav-item {% if filter_view == 'published' %} active{% endif %}">
<a class="nav-link" href="{% url 'article-list' filter_view='published'%}">Publiés</a>
</li>
</ul>
<div class="well">
{% if is_paginated %}
<div class="pagination">
<span class="page-links">
{% if page_obj.has_previous %}
<a href="?page={{ page_obj.previous_page_number }}"><<</a>
{% endif %}
<span class="page-current">
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}
</span>
{% if page_obj.has_next %}
<a href="?page={{ page_obj.next_page_number }}">>></a>
{% endif %}
</span>
</div>
{% endif %}
<table class="article-table table table-sm my-4">
<thead>
<tr>
<th>Priority</th>
<th>ID</th>
<th>Date</th>
<th>Language</th>
<th>Title</th>
<th>Note</th>
<th>Added&nbsp;by</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for article in object_list|slice:":10" %}
<tr class="empty-row"><td colspan="8"></td></tr>
<tr>
<td class="icon-cell"><i class="fa fa-dot-circle-o" aria-hidden="true" style="color:red"></i></td>
<td>{{article.id}}</td>
<td>{{article.created_at |date:'d/m/y'}}<br />{{article.created_at |date:'H:i'}}</td>
<td>{{article.lang}}</td>
<td class="title-cell"><a target="_blank" href="{{article.url}}"><strong>{{article.title}}</strong></a></td>
<td>
<ul class="votes-list">
<li><a href="">+3 <i class="fa fa-thumbs-up" aria-hidden="true" style="color:green"></i></a></li>
<li><a href="">-2 <i class="fa fa-thumbs-down" aria-hidden="true" style="color:red"></i></a></li>
</ul>
</td>
<td>{{article.und_votes.first.username}}</td>
<td class="actions-cell">
<ul class="actions-list">
<li class="actions-item-edit"><a href="#">
<i class="fa fa-pencil" aria-hidden="true"></i> Éditer</a>
</li>
<li class="actions-item-publish"><a href="#">
<i class="fa fa-check" aria-hidden="true"></i> Publier</a>
</li>
</ul>
</td>
</tr>
<tr class="tags-row">
<td colspan="8">
<strong>Tags</strong> tags tags
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endblock %}
from django.conf.urls import url
from rp.views.votes import upvote, downvote
from rp.views.articles import ArticleList
from rp.views.articles import ArticleListFlux
urlpatterns = [
url(
r"^article/list",
ArticleList.as_view(),
r"^article/list/(?P<filter_view>\w+)",
ArticleListFlux.as_view(),
name="article-list"
),
url(
......
......@@ -2,5 +2,24 @@ from rp.models import Article
from .votes import UDList
class ArticleList(UDList):
class ArticleListFlux(UDList):
model = Article
paginate_by = 10
def get_queryset(self):
filter_view = self.kwargs.get("filter_view", "draft")
if filter_view == "published":
qs = Article.objects.filter(status="PUBLISHED")
elif filter_view == "draft":
qs = Article.objects.filter(und_score__gte=3, status="PENDING")
else:
qs = Article.objects.filter(status="PENDING")
return qs.order_by('-created_at')
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context["filter_view"] = self.kwargs.get("filter_view", "draft")
context["nb_draft"] = Article.objects.filter(und_score__gte=3, status="PENDING").count()
return context
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>LQDN RP</title>
</head>
<body>
{% block content %}
{% endblock %}
</body>
{% load static %}
<!DOCTYPE html>
<!-- Header -->
<html>
<head>
<title>Soutenez La Quadrature du Net !</title>
<meta charset="utf-8" />
<meta name="author" content="La Quadrature du Net" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Open graph -->
<meta property="og:title" content="Soutenez La Quadrature du Net !" />
<meta property="og:url" content="https://soutien.laquadrature.net/" />
<!-- FIXME: Change the OG image -->
<meta property="og:image" content="https://soutien.laquadrature.net/static/img/anim_3.gif" />
<meta property="og:site_name" content="La Quadrature du Net" />
<meta property="og:description" content="Depuis sa création, La Quadrature du Net agit sans relâche pour qu'Internet demeure un outil de partage, de libre expression, d'émancipation et permette la participation de tous au débat démocratique." />
<!-- Twitter cards -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@laquadrature" />
<meta name="twitter:title" content="Soutenez la Quadrature du Net&nbsp!">
<meta name="twitter:image" content="https://soutien.laquadrature.net/static/img/anim_3.gif">
<meta name="twitter:description" content="Depuis sa création, La Quadrature du Net agit sans relâche pour qu'Internet demeure un outil de partage, de libre expression, d'émancipation et permette la participation de tous au débat démocratique.">
<!-- Styles -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
<!-- <link rel="stylesheet" href="/static/css/bootstrap.css" media="all"> -->
<link rel="stylesheet" href="/static/css/font-awesome.css" media="all">
<link rel="stylesheet" href="/static/css/fonts.css" media="all">
<link rel="stylesheet" href="/static/css/forms.css" media="all">
<link rel="stylesheet" href="/static/css/modals.css" media="all">
<link rel="stylesheet" href="/static/css/collapsibles.css" media="all">
<link rel="stylesheet" href="/static/css/layouts.css" media="all">
<link rel="stylesheet" href="/static/css/tables.css" media="all">
</head>
<body>
<div class="modal-form " id="login">
<div class="modal-form-title modal-form-only">
<a class="close modal-form-only" href="/#"><span>Fermer</span></a>
<h1>Se connecter</h1>
</div>
<form method="POST" class="form-inline" action="/login">
<div class="modal-form-body">
<input type="hidden" name="csrf" id="csrf" value="f0c2e16b60242fe65b800778d3b90f91" />
<fieldset class="form-group modal-form-only">
<div class="modal-row form-group">
<label for="email">Adresse mail</label>
<input class="form-control" type="email" name="email" id="email" required>
</div>
<div class="modal-row form-group">
<label for="password">Mot de passe</label>
<input class="form-control" type="password" name="password" id="password" required>
</div>
<div class="modal-row">
<a href="#password-reset">Réinitialiser votre mot de passe</a>
<input class="btn btn-lg btn-modal" type="submit" name="submit" id="submit" value="Connexion">
</div>
</fieldset>
</div>
</form>
</div>
<div class="modal-form" id="add-account">
<div class="modal-form-title modal-form-only">
<a class="close modal-form-only" href="#"><span>Fermer</span></a>
<h1>Créer un compte</h1>
</div>
<form method="POST" class="form-inline" action="/login">
<div class="modal-form-body">
<input type="hidden" name="csrf" id="csrf" value="f0c2e16b60242fe65b800778d3b90f91" />
<input type="hidden" name="action" id="action" value="create_account" />
<fieldset class="form-group modal-form-only">
<div class="modal-row form-group">
<label for="email">Adresse mail</label>
<input class="form-control" type="email" name="email" id="email" required>
</div>
<div class="modal-row form-group">
<label for="password">Mot de passe</label>
<input class="form-control" type="password" name="password" id="password" required>
</div>
<div class="modal-row">
<input class="btn btn-lg btn-modal" type="submit" name="submit" id="submit" value="Création du compte">
</div>
</fieldset>
</div>
</form>
</div>
<div class="modal-form" id="merci">
<div class="modal-form-title modal-form-only">
<a class="close modal-form-only" href="/#"><span>Fermer</span></a>
<h1>Merci &lt;3</h1>
</div>
<div class="modal-form-body modal-form-only">
<div class="modal-row">
<p>Merci de votre soutien</p>
</div>
</div>
</div>
<div class="modal-form" id="password-reset">
<div class="modal-form-title modal-form-only">
<a class="close modal-form-only" href="/#"><span>Fermer</span></a>
<h1>Réinitialiser votre mot de passe</h1>
</div>
<form method="POST" class="form-inline" action="/login">
<div class="modal-form-body">
<input type="hidden" name="csrf" id="csrf" value="f0c2e16b60242fe65b800778d3b90f91" />
<input type="hidden" name="action" id="action" value="renew_password" />
<fieldset class="form-group modal-form-only">
<div class="modal-row form-group">
<label for="email">Adresse mail</label>
<input class="form-control" type="email" name="email" id="email" required>
</div>
<div class="modal-row">
<input class="btn btn-lg btn-modal" type="submit" name="submit" id="submit" value="Réinitialiser le mot de passe">
</div>
</fieldset>
</div>
</form>
</div>
<div>
<nav class="navbar sticky-top navbar-toggleable-md dark-blue">
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item"><a class="nav-link" href="#add-account">Créer un compte</a></li>
<li class="nav-item"><a class="nav-link" href="#login">Se connecter</a></li>
<li class="nav-item"><a class="nav-link" href="https://soutien.laquadrature.net">[FR]</a></li>
<li class="nav-item"><a class="nav-link" href="https://support.laquadrature.net">[EN]</a></li>
</ul>
</div>
</nav>
<nav class="navbar navbar-toggleable-md">
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<a class="navbar-brand" href="/"><img class="float-left" src="/static/img/logo.png" alt=""></a>
<ul class="navbar-nav ml-auto">
<li class="nav-item"><a class="nav-link" href="#add-account">Vous êtes Padawan</a></li>
</ul>
</div>
</nav>
</div>
<!--
<div class="visible-xs visible-sm">
<nav id="toolbar" class="navbar navbar-default navbar-white">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="/">
<img src="/static/img/logo.png" alt="">
</a>
</div>
<ul class="nav navbar-nav">
<li class="pull-right"><a href="#login">Se connecter</a></li>
<li class="pull-right collapsible-menu"><a href="#action-menu">Menu</a>
</li>
</ul>
</div>
<span class="menu-collapsed-target" id="perso-menu"></span>
<div class="menu-collapsed">
<ul class="nav navbar-nav">
<li><a href="/perso/logout">Déconnexion</a></li>
<li><a href="/perso">Page Perso</a></li>
<li><a href="#">Fermer</a></li>
</ul>
</div>
<span class="menu-collapsed-target" id="action-menu"></span>
<div class="menu-collapsed">
<ul class="nav navbar-nav">
<li> <a href="/why" >À quoi sert votre don&nbsp;?</a></li>
<li> <a href="/what" >Que fait LQDN&nbsp;?</a></li>
<li> <a href="/who" >Comment fonctionne LQDN&nbsp;?</a></li>
<li> <a href="/faq" >FAQ</a></li>
<li> <a href="/material" >Relayer</a></li>
<li> <a href="/" >Home</a></li>
<li><a href="#">Fermer</a></li>
</ul>
</div>
</nav>
</div> -->
<section class="text-center container-fluid white">
<div id="subtitle" class="row justify-content-center">
<div class="page-header col-md-10">
<h1><span>Bienvenue sur la revue de presse de La Quadrature</span></h1>
</div>
</div>
<div class="row justify-content-center">
<div id="video" class="col-md-6">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corporis repellendus voluptates est nesciunt eum recusandae, quisquam reprehenderit impedit iusto, quo sint. Odio voluptatem odit voluptate, facilis esse dolores animi repellendus?</p>
</div>
<div id="donation" class="col-md-4">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Delectus voluptas earum assumenda, perspiciatis dicta maxime quo illum repudiandae itaque omnis fuga explicabo magni minus maiores laboriosam voluptatibus doloremque. Nostrum, corrupti.</p>
</div>
</div>
</section>
<section id="main" class="container-fluid white">
{% block content %}
{% endblock %}
</section>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment