added new student page
This commit is contained in:
parent
9be60fb7a4
commit
b4415af0b8
@ -8,6 +8,8 @@
|
|||||||
<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">
|
||||||
|
<link href="{% static 'css/signin.css' %}" rel="stylesheet">
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
@ -31,8 +33,13 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="{% url 'admin:index' %}">Administration</a>
|
<a class="nav-link" href="{% url 'admin:index' %}">Administration</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %} {% if user.is_staff %}
|
{% elif user.is_staff %}
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="{% url 'logout' %}">Administration</a>
|
||||||
|
</li>
|
||||||
|
{% else %}
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="{% url 'student_page' %}">My Page</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -5,13 +5,13 @@
|
|||||||
{{ post.published_date }}
|
{{ post.published_date }}
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a class="btn btn-default" href="{% url 'post_publish' pk=post.pk %}">Publish</a>
|
<a class="btn btn-outline-dark" href="{% url 'post_publish' pk=post.pk %}">Publish</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a class="btn btn-default" href="{% url 'post_edit' pk=post.pk %}">
|
<a class="btn btn-outline-dark" href="{% url 'post_edit' pk=post.pk %}">
|
||||||
<span class="glyphicon glyphicon-pencil"></span>
|
<span class="glyphicon glyphicon-pencil">Edit</span>
|
||||||
</a>
|
</a>
|
||||||
<a class="btn btn-default" href="{% url 'post_remove' pk=post.pk %}">
|
<a class="btn btn-outline-dark" href="{% url 'post_remove' pk=post.pk %}">
|
||||||
<span class="glyphicon glyphicon-remove"></span>
|
<span class="glyphicon glyphicon-remove">Remove</span>
|
||||||
</a>
|
</a>
|
||||||
<h1>{{ post.title }}</h1>
|
<h1>{{ post.title }}</h1>
|
||||||
<p>{{ post.text|linebreaksbr }}</p>
|
<p>{{ post.text|linebreaksbr }}</p>
|
||||||
|
@ -4,6 +4,6 @@
|
|||||||
<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-default">Save</button>
|
<button type="submit" class="save btn btn-outline-dark">Save</button>
|
||||||
</form>
|
</form>
|
||||||
{% endblock %}
|
{% endblock %}
|
@ -24,7 +24,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<input type="submit" value="login" />
|
<input type="submit" value="login" class="btn btn-lg btn-primary"/>
|
||||||
<input type="hidden" name="next" value="{{ next }}" />
|
<input type="hidden" name="next" value="{{ next }}" />
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
3
application/templates/student_page.html
Normal file
3
application/templates/student_page.html
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
{% block content %}
|
||||||
|
{% endblock %}
|
@ -3,6 +3,7 @@ from . import views
|
|||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'^$', views.post_list, name='post_list'),
|
url(r'^$', views.post_list, name='post_list'),
|
||||||
|
url(r'^student/', views.student_page, name='student_page'),
|
||||||
url(r'^post/(?P<pk>\d+)/$', views.post_detail, name='post_detail'),
|
url(r'^post/(?P<pk>\d+)/$', views.post_detail, name='post_detail'),
|
||||||
url(r'^post/new/$', views.post_new, name='post_new'),
|
url(r'^post/new/$', views.post_new, name='post_new'),
|
||||||
url(r'^post/(?P<pk>\d+)/edit/$', views.post_edit, name='post_edit'),
|
url(r'^post/(?P<pk>\d+)/edit/$', views.post_edit, name='post_edit'),
|
||||||
|
@ -96,3 +96,7 @@ def post_remove(request, pk):
|
|||||||
post = get_object_or_404(Post, pk=pk)
|
post = get_object_or_404(Post, pk=pk)
|
||||||
post.delete()
|
post.delete()
|
||||||
return redirect('post_list')
|
return redirect('post_list')
|
||||||
|
|
||||||
|
@login_required
|
||||||
|
def student_page(request):
|
||||||
|
return render(request, 'student_page.html', {})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user