Browse Source

added new js file and make the published date editable on webiste

newsletter
Esther Kleinhenz 6 years ago
parent
commit
145fd921d9

+ 2
- 3
application/forms.py View File

@@ -1,9 +1,8 @@
from django import forms
from .models import Post, CustomUser
from django.contrib.auth.forms import UserCreationForm, UserChangeForm

class PostForm(forms.ModelForm):
published_date = forms.DateField(widget=forms.widgets.DateInput(format="%d. %h %Y, %M:%S"))
class Meta:
model = Post
fields = ('title', 'text')
fields = ('title', 'text', 'published_date', 'tags')

+ 0
- 0
application/static/js/app.js View File


+ 3
- 3
application/templates/base.html View File

@@ -8,8 +8,6 @@
<title> {% block title %}Seitenname{% endblock %}</title>
<link href="{% static 'css/application.css' %}" rel="stylesheet">
<link href="{% static 'bootstrap/css/bootstrap.css' %}" rel="stylesheet">
{% include "taggit_templatetags2/tagcanvas_include_js_static.html" %}
{% include_tagcanvas 'tag-cloud' 'width px' 'height px' 'post_list.html' 'application' %}
</head>

<body>
@@ -62,7 +60,8 @@
<li>
<form class="form" role="form" method="post" action="{% url 'login' %}" accept-charset="UTF-8" id="login-nav">
{% csrf_token %} {% if next %}
<input type="hidden" name="next" value="{{ next }}" /> {% endif %}
<input type="hidden" name="next" value="{{ next }}" />
{% endif %}
<div class="form-group">
<label class="sr-only" for="username">Benutzername</label>
<input type="text" class="form-control" id="username" name="username" placeholder="Benutzername" required>
@@ -93,6 +92,7 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="{% static 'bootstrap/js/jquery-1.11.1.js' %} "></script>
<script src="{% static 'bootstrap/jsjquery.tagcanvas.min.js' %} " type="text/javascript"></script>
<script src="{% static 'js/app.js' %}"></script>
<script src="{% static 'bootstrap/js/bootstrap.bundle.js' %}"></script>
</body>


+ 7
- 1
application/templates/blog_search_list_view.html View File

@@ -1,4 +1,10 @@
{% extends "base.html" %} {% block content %}

hi
<div id="tag-cloud">
<ul>
{% for tag in tags %}
<li>{{tag}} ({{tag.num_times}})</li>
{% endfor %}
</ul>
</div>
{% endblock %}

+ 1
- 1
application/templates/post_edit.html View File

@@ -3,7 +3,7 @@
{% block content %}
<h1>New post</h1>
<form method="POST" class="post-form">{% csrf_token %}
{{ form.as_p }}
{{ form.as_p }}
<button type="submit" class="save btn btn-outline-dark">Save</button>
</form>
{% endblock %}

+ 2
- 1
application/templates/post_list.html View File

@@ -18,7 +18,8 @@

</div>
{% endfor %}
{% get_tagcloud as tags for 'application' %}
{% include "taggit_templatetags2/tagcanvas_include_js_static.html" %}

<div id="tag-cloud">
<ul>
{% for tag in tags %}

Loading…
Cancel
Save