Browse Source

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

newsletter
Esther Kleinhenz 5 years ago
parent
commit
145fd921d9

+ 2
- 3
application/forms.py View File

from django import forms from django import forms
from .models import Post, CustomUser from .models import Post, CustomUser
from django.contrib.auth.forms import UserCreationForm, UserChangeForm


class PostForm(forms.ModelForm): class PostForm(forms.ModelForm):
published_date = forms.DateField(widget=forms.widgets.DateInput(format="%d. %h %Y, %M:%S"))
class Meta: class Meta:
model = Post 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

<title> {% block title %}Seitenname{% endblock %}</title> <title> {% block title %}Seitenname{% endblock %}</title>
<link href="{% static 'css/application.css' %}" rel="stylesheet"> <link href="{% static 'css/application.css' %}" rel="stylesheet">
<link href="{% static 'bootstrap/css/bootstrap.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> </head>


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



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

{% extends "base.html" %} {% block content %} {% 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 %} {% endblock %}

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

{% block content %} {% block content %}
<h1>New post</h1> <h1>New post</h1>
<form method="POST" class="post-form">{% csrf_token %} <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> <button type="submit" class="save btn btn-outline-dark">Save</button>
</form> </form>
{% endblock %} {% endblock %}

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



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

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

Loading…
Cancel
Save