summaryrefslogtreecommitdiff
path: root/gstudio/templates/gstudio/image.html
diff options
context:
space:
mode:
authorAnkita <ankita@ankita-Inspiron-N5010.(none)>2012-07-13 12:31:27 +0530
committerAnkita <ankita@ankita-Inspiron-N5010.(none)>2012-07-13 12:31:27 +0530
commit527ab688a8608ded5fc854cf8641228181efa981 (patch)
tree825f17422ce610922f8f34854c5e54db7a7f35ad /gstudio/templates/gstudio/image.html
parentef3793b349be5744d6ef98a034f0c009159ed85b (diff)
downloadgnowsys-527ab688a8608ded5fc854cf8641228181efa981.tar.gz
this patch was added for metastudio by BITS Pilani team in 2012.
Diffstat (limited to 'gstudio/templates/gstudio/image.html')
-rw-r--r--gstudio/templates/gstudio/image.html119
1 files changed, 119 insertions, 0 deletions
diff --git a/gstudio/templates/gstudio/image.html b/gstudio/templates/gstudio/image.html
new file mode 100644
index 0000000..f70a24b
--- /dev/null
+++ b/gstudio/templates/gstudio/image.html
@@ -0,0 +1,119 @@
+<html>
+<body>
+{% extends "gstudio/base.html" %}
+{% load adminmedia grp_tags %}
+{% load i18n %}
+{% block content %}
+{% if user.is_authenticated %}
+<h1 style="color: teal;">Welcome to the ImageNation</h1>
+<p><img id="zoomable" src="{% admin_media_prefix %}img/imagenation.jpg" alt="{{ image.title }}" class="left" /></p>
+<h2>Logged in as: {{user.username}}</h2>
+<br>
+<form enctype="multipart/form-data" method="post" action="">
+{% csrf_token %}
+<h4 style="color: black;">Post Image:</h4>
+<p>Title: <input type="text" name="title1"></p><br>
+<p><input type=file name="image[]" multiple="multiple" /></p>
+<input type="hidden" name="user" value={{user.username}}>
+<input type="submit" value="Post">
+</form>
+<br>
+<form method="post" action="">
+{% csrf_token %}
+<h4 style="color: black;">Search Image</h4>
+<p><input type="text" name="simg" value={{val}}></p>
+<h4 style="color: black;">Sort images by:</h4>
+<p><div align="center">
+<select name="mydropdown">
+<option value="title">Title</option>
+<option value="creation_date">Creation Date</option>
+</select>
+</div>
+<input type="submit" value="Search">
+</form>
+<br>
+<h4 style="color: teal;">IMAGES</h4>
+{% for image in images %}
+ <div class="gbobject-body span-16 last">
+ <div class="gbobject-image">
+ <p>
+<img src="{% admin_media_prefix %}img/{{image.title}}" width="300" height="225" alt="{{ image.title }}" >
+
+ </p>
+ </div>
+ <div class="gbobject-content">
+ <!-- {{ object_content }}-->
+ </div>
+ </div>
+<h4>{{image.title}}
+<form method="post" action="">
+{% csrf_token %}
+<input type="hidden" name="fulid" value={{image.id}}>
+<input type="submit" value="View Fullscreen">
+</form>
+</h4>
+<font color = 'black'>Posted By : </font>
+{% for author in image.authors.all %}
+ <font color = 'teal'>{{author}}</font>
+{% endfor %}
+<br>
+<font color = 'black'>Posted At : </font><font color = 'teal'>{{image.creation_date}}</font>
+<br>
+{% for author in image.authors.all %}
+ {% ifequal author.username user.username %}
+<form method="post" action="" onclick="return makesure();">
+{% csrf_token %}
+<input type="hidden" name="pict" value={{image.id}}>
+<input type="submit" name="delete" value="Delete">
+<input type="hidden" name="user" value={{user.username}}>
+</form>
+<script type="text/javascript">
+ function makesure() {
+ if (confirm('Are you sure you want to delete this image?')) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+</script>
+{% else %}
+ <script type="text/javascript">
+ function myFunction()
+ {
+ alert("You are not authorised to delete other users image!");
+ }
+ </script>
+
+ <input type="button" onclick="myFunction()" value="Delete" />
+ {% endifequal %}
+{% endfor %}
+<br>
+<font color = 'black'>Current rating is </font><h4>{{ image.rating.get_rating }}</h4>
+<br>
+<form method="post" action="">
+{% csrf_token %}
+<input name="star1" type="radio" value=1 class="star"/>
+<input name="star1" type="radio" value=2 class="star"/>
+<input name="star1" type="radio" value=3 class="star"/>
+<input name="star1" type="radio" value=4 class="star"/>
+<input name="star1" type="radio" value=5 class="star"/>
+</br>
+<input type="hidden" name="imgid" value={{image.id}}>
+<input type="submit" value="Rate it!!!">
+</form>
+<br>
+<hr width="100%" style="height:5px;" color="black"/>
+<br>
+{% endfor %}<br>
+<br><br>
+{% else %}
+
+<h2 style="color: indigo;">Sorry you need to log in to see this content !</h2>
+
+{% endif %}
+
+
+{% endblock %}
+</body>
+</html>