First Commit
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% if error %}
|
||||
{{ error }}
|
||||
<br />
|
||||
<br />
|
||||
{% endif %}
|
||||
|
||||
<h1>Create</h1>
|
||||
|
||||
<form method="POST" action="{% url 'create' %}" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
Title:
|
||||
<br />
|
||||
<input type="text" name="title" />
|
||||
<br />
|
||||
Body:
|
||||
<br />
|
||||
<input type="text" name="body" />
|
||||
<br />
|
||||
URL:
|
||||
<br />
|
||||
<input type="text" name="url" />
|
||||
<br />
|
||||
Icon:
|
||||
<br />
|
||||
<input type="file" name="icon" />
|
||||
<br />
|
||||
Image:
|
||||
<br />
|
||||
<input type="file" name="image" />
|
||||
<br />
|
||||
<br />
|
||||
<input class="btn btn-primary" type="submit" value="Add Product" />
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,45 @@
|
||||
{% extends 'base.html'%}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-2">
|
||||
<img src="{{ product.icon.url }}" class="img-fluid"/>
|
||||
</div>
|
||||
<div class="col-10">
|
||||
<a href="{{ product.url }}"><h1>{{product.title}}</h1></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<img src="{{ product.image.url }}" class="img-fluid"/>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<a href="javascript:{document.getElementById('upvote').submit()}"><button class="btn btn-primary btn-lg btn-block "><span class="oi oi-caret-top"></span>Upvote {{product.votes_total}}</button></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-4 ">
|
||||
<h4>Hunted by {{ product.hunter.username }}</h4>
|
||||
</div>
|
||||
<div class="col-4 text-">
|
||||
<h4><span class="oi oi-clock"></span> {{ product.pub_date_pretty }}</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-8 ">
|
||||
<p>{{ product.body }}</p>
|
||||
</div>
|
||||
|
||||
|
||||
<form id="upvote" method="POST" action="{% url 'upvote' product.id %}" >
|
||||
{% csrf_token %}
|
||||
<input type="hidden">
|
||||
</form>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,32 @@
|
||||
{% extends 'base.html'%}
|
||||
|
||||
{% block content %}
|
||||
|
||||
|
||||
{% for product in products.all %}
|
||||
|
||||
|
||||
|
||||
<div class="row pt-3">
|
||||
<div class="col-2" onclick="window.location='{% url 'detail' product.id %}';" style="cursor: pointer;">
|
||||
<img src="{{ product.icon.url }}" class="img-fluid"/>
|
||||
</div>
|
||||
<div class="col-6 onclick="window.location='{% url 'detail' product.id %}';" style="cursor: pointer;"">
|
||||
<h1>{{product.title}}</h1>
|
||||
<p>{{product.summary}}</p>
|
||||
</div>
|
||||
<div class="col-4 onclick="window.location='{% url 'detail' product.id %}';" style="cursor: pointer;"">
|
||||
<a href="javascript:{document.getElementById('upvote{{product.id}}').submit()}"><button class="btn btn-primary btn-lg btn-block "><span class="oi oi-caret-top"></span>Upvote {{product.votes_total}}</button></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<form id="upvote{{product.id}}" method="POST" action="{% url 'upvote' product.id %}" >
|
||||
{% csrf_token %}
|
||||
<input type="hidden">
|
||||
</form>
|
||||
|
||||
{% endfor %}
|
||||
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user