Added the Post Button when Staff
Added the ability to post directly from the navbar when logged in as a staff member `User.is_staff == True`pull/3/head
parent
bef63db9d1
commit
bdc8451f22
Binary file not shown.
|
|
@ -5,7 +5,7 @@ urlpatterns = [
|
||||||
path('', views.home, name='Home'),
|
path('', views.home, name='Home'),
|
||||||
path('news/', views.news, name='News'),
|
path('news/', views.news, name='News'),
|
||||||
path('blog/<int:pk>', views.BlogDetailView.as_view(), name='Blog'),
|
path('blog/<int:pk>', views.BlogDetailView.as_view(), name='Blog'),
|
||||||
path('blog/create/', views.BlogCreateView.as_view(), name='Blog Create'),
|
path('blog/create/', views.BlogCreateView.as_view(), name='BlogCreate'),
|
||||||
path('dev/', views.dev, name='Dev'),
|
path('dev/', views.dev, name='Dev'),
|
||||||
path('dev/support/', views.support, name='Support'),
|
path('dev/support/', views.support, name='Support'),
|
||||||
]
|
]
|
||||||
|
|
|
||||||
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
|
|
@ -29,6 +29,11 @@
|
||||||
<div class="justify-content-center" id="navbarNav">
|
<div class="justify-content-center" id="navbarNav">
|
||||||
<ul class="navbar-nav">
|
<ul class="navbar-nav">
|
||||||
{% if user.is_authenticated %}
|
{% if user.is_authenticated %}
|
||||||
|
<li class="nav-item">
|
||||||
|
{% if user.is_staff %}
|
||||||
|
<a class="nav-link" href="{% url 'BlogCreate' %}">Post</a>
|
||||||
|
{% endif %}
|
||||||
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<form action="{% url 'Logout' %}" method="post">
|
<form action="{% url 'Logout' %}" method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="card mb-4">
|
<div class="card mb-4">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
Create a Blog
|
Create a New Blog Article
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{{ form | crispy }}
|
{{ form | crispy }}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
<p class="card-text">{{ object.content | markdown | safe }}</p>
|
<p class="card-text">{{ object.content | markdown | safe }}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-footer">
|
<div class="card-footer">
|
||||||
By <cite title="{{ object.author }}"><a href="#">{{ object.author }}</a></cite> on <cite title="{{ object.date_posted }}">{{ object.date_posted|date:"M j, o" }}</cite>
|
By <cite title="{{ object.author }}"><a href="#" class="link text-dark">{{ object.author }}</a></cite> on <cite title="{{ object.date_posted }}">{{ object.date_posted|date:"M j, o" }}</cite>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue