Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/ImageDashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@
{% block title %} Image Gallery {% endblock %}
{% block body_content %}

{% if alreadyUploadedFiles %}
{% if already_uploaded %}
<div id="message">
<span style="color:red">Listed below files are already uploaded please choose different files</span>
<ul>
{% for each in alreadyUploadedFiles %}
{% for each in already_uploaded %}
<li>{{each}}</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% get_group_name request.path as group_name %}


<center>
<div style='display:table; padding-top:20px'>
<div style='display:table-row;'>
Expand All @@ -26,13 +25,9 @@
</form>
</div>
<div style='display:table-cell; padding-left:5px'>
<form id ="imgPost" enctype="multipart/form-data" method="post" action="{% url 'uploadDoc' group_name %}">{% csrf_token %}
<input type="hidden" name="stId" value={{stId}}>
<input type="hidden" name="pageUrl" value={{pageUrl}}>
<a href="{% url 'uploadDoc' group_name %}">
<input type="submit" class="btn btn-large btn-primary" value="upload" />
<a class="btn btn-large btn-primary" href="{% url 'uploadDoc' group_name %}?next={{request.path}}">
Upload
</a>
</form>
</div>
</div>
</div>
Expand All @@ -46,6 +41,10 @@
<a href="{% url 'getFullImage' group_name image %}">
<img src="{% url 'getImageThumbnail' group_name image %}"></img><br/>
<span align="left">{{image.name}}</span></a>
{% get_user_object image.created_by as user_obj %}
{% ifequal user_obj.username user.username %}
<a class="btn btn-block btn-lg btn-danger" href="{% url 'delete_file' 'group_name' image %}?next={{request.path}}">Delete </a>
{% endifequal %}
</div>
{% if not forloop.last and forloop.counter|divisibleby:"6" %}
</div>
Expand Down
2 changes: 1 addition & 1 deletion gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/UploadDoc.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ <h4>Submit Documents</h4>
<div style='display:table-cell;' colspan="2">
<input type="hidden" name="user" value={{user.id}}>
<input type="hidden" name="stId" value={{stId}}>
<input type="hidden" name="mainPageUrl" value={{mainPageUrl}}>
<input type="hidden" name="page_url" value={{page_url}}>
<input type="submit" id="submitpostid" value="Upload" class="btn btn-primary btn-large btn-block">
</div>
</div>
Expand Down
37 changes: 33 additions & 4 deletions gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/file.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
{% extends "ndf/base.html" %}
{% block title %} {{title}} {% endblock %}
{% block body_content %}
{% if user.is_authenticated %}
{% block body_content %}
{% load ndf_tags %}
{% if already_uploaded %}
<div id="message">
<span style="color:red">Listed below files are already uploaded please choose different files</span>
<ul>
{% for each in already_uploaded %}
<li>{{each}}</li>
{% endfor %}
</ul>
</div>
{% endif %}
<center>
<form id ="file_search" enctype="multipart/form-data" method="GET" action="{% url 'file_search' 'group_name' %}">
<div style="padding-top:10px">
<input type="text" style="width:400px" placeholder="Enter keyword to search" name="search" />
<input type="submit" class="btn btn-large btn-primary" value="search" />
<a href="{% url 'uploadDoc' 'file' %}">
{% if user.is_authenticated %}
<a href="{% url 'uploadDoc' 'file' %}?next={{request.path}}">
<input type="button" class="btn btn-large btn-primary" value="Upload" />
</a>
{% endif %}
</div>
</form>
</center>
<hr />
{% endif %}
{% load url from future %}

{% if files %}
Expand All @@ -29,11 +40,18 @@ <h4>File Size </h4>
<div style='display:table-cell;' align="middle">
<h4>File Type </h4>
</div>
<div style='display:table-cell;' align="middle">
<h4>Posted by </h4>
</div>
<div style='display:table-cell;' align="middle">
<h4 >Download </h4>
</div>
<div style='display:table-cell;' align="middle">
<h4 >Delete </h4>
</div>
</div>
{% for file in files %}
{% get_user_object file.created_by as user_obj %}
<div style='display:table-row;' >
<div style='display:table-cell;' align="middle">
<lable>{{file.name}} </lable>
Expand All @@ -44,9 +62,20 @@ <h4 >Download </h4>
<div style='display:table-cell;' align="middle">
<lable>{{file.mime_type}}</lable>
</div>
<div style='display:table-cell;' align="middle">
<lable>{{ user_obj.username }}</lable>
</div>
<div style='display:table-cell;' align="middle">
<a href="{% url 'read_file' 'group' file %}">Download </a>
</div>

<div style='display:table-cell;' align="middle">
{% get_user_object file.created_by as user_obj %}
{% ifequal user_obj.username user.username %}
<a class="btn btn-block btn-lg btn-danger" href="{% url 'delete_file' 'group' file %}?next={{request.path}}">Delete </a>
{% endifequal %}
</div>

</div>
{% endfor %}
</div>
Expand Down
16 changes: 8 additions & 8 deletions gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/videoDashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
{% block title %} video Gallery {% endblock %}
{% block body_content %}

{% if alreadyUploadedFiles %}
{% if already_uploaded %}
<div id="message">
<span style="color:red">Listed below files are already uploaded please choose different files</span>
<ul>
{% for each in alreadyUploadedFiles %}
{% for each in already_uploaded %}
<li>{{each}}</li>
{% endfor %}
</ul>
Expand All @@ -26,13 +26,9 @@
</form>
</div>
<div style='display:table-cell; padding-left:5px'>
<form id ="imgPost" enctype="multipart/form-data" method="post" action="{% url 'uploadDoc' group_name %}">{% csrf_token %}
<input type="hidden" name="stId" value={{stId}}>
<input type="hidden" name="pageUrl" value={{pageUrl}}>
<a href="{% url 'uploadDoc' group_name %}">
<input type="submit" class="btn btn-large btn-primary" value="upload" />
<a class="btn btn-large btn-primary" href="{% url 'uploadDoc' group_name %}?next={{request.path}}">
Upload
</a>
</form>
</div>
</div>
</div>
Expand All @@ -46,6 +42,10 @@
<a href="{% url 'getFullvideo' group_name video %}">
<img src="{% url 'getvideoThumbnail' group_name video %}" style="border-radius:10px;"></img><br/>
<span align="left">{{video.name}}</span></a>
{% get_user_object video.created_by as user_obj %}
{% ifequal user_obj.username user.username %}
<a class="btn btn-block btn-lg btn-danger" href="{% url 'delete_file' 'group' video %}?next={{request.path}}">Delete </a>
{% endifequal %}
</div>
{% if not forloop.last and forloop.counter|divisibleby:"6" %}
</div>
Expand Down
1 change: 1 addition & 0 deletions gnowsys-ndf/gnowsys_ndf/ndf/templatetags/ndf_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from gnowsys_ndf.ndf.views.methods import get_drawers



register = Library()
db = get_database()

Expand Down
1 change: 1 addition & 0 deletions gnowsys-ndf/gnowsys_ndf/ndf/urls/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
url(r'^documentList/', 'GetDoc', name='documentList'),
url(r'^readDoc/(?P<_id>[\w-]+)$', 'readDoc', name='read_file'),
url(r'^search/$', 'file_search', name='file_search'),
url(r'^delete_file/(?P<_id>[\w-]+)$', 'delete_file', name='delete_file'),

)
Loading