Add statics
This commit is contained in:
		| @@ -1,8 +1,11 @@ | ||||
| {% load static %} | ||||
| <!DOCTYPE html> | ||||
| <html lang="en"> | ||||
| <head> | ||||
|     <meta charset="UTF-8"> | ||||
|     <title>{% block title %}{% endblock %} | Djanker News</title> | ||||
|     <script src="{% static 'js/vue.min.js' %}"></script> | ||||
|     <script defer src="{% static 'js/home.js' %}"></script> | ||||
| </head> | ||||
| <body> | ||||
|     <header> | ||||
| @@ -15,7 +18,7 @@ | ||||
|             </li> | ||||
|         </ul> | ||||
|     </header> | ||||
|     <main> | ||||
|     <main id="app"> | ||||
|         <h1>Djanker News</h1> | ||||
|         {% block main %}{% endblock %} | ||||
|     </main> | ||||
|   | ||||
| @@ -1,12 +1,11 @@ | ||||
| {% extends 'layouts/base.html' %} | ||||
| {% block title %}Welcome{% endblock %} | ||||
| {% block main %} | ||||
|     {% for item in news %} | ||||
|     <article> | ||||
|         <h2>{{ item.title }}</h2> | ||||
|     <article v-for="item in news"> | ||||
|         <h2><span>[[ item.votes ]]</span> - [[ item.title ]]</h2> | ||||
|         <p> | ||||
|             <a href="{{ item.url }}">Ver completo</a> | ||||
|             <a :href="item.url" target="_blank">Ver completo</a> | ||||
|             <button @click.prevent="votar(item.id)">Votar</button> | ||||
|         </p> | ||||
|     </article> | ||||
|     {% endfor %} | ||||
| {% endblock %} | ||||
| @@ -1,11 +1,8 @@ | ||||
| from django.shortcuts import render | ||||
| from app.api.models import News | ||||
|  | ||||
|  | ||||
| def home(request): | ||||
|     return render(request, 'pages/list.html', { | ||||
|         'news': News.objects.all() | ||||
|     }) | ||||
|     return render(request, 'pages/list.html', {}) | ||||
|  | ||||
|  | ||||
| def add_news(request): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user