diff options
-rw-r--r-- | gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/UploadDoc.html | 121 | ||||
-rw-r--r-- | gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/file.html | 4 | ||||
-rw-r--r-- | gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/image_detail.html | 7 | ||||
-rw-r--r-- | gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/video_detail.html | 20 | ||||
-rw-r--r-- | gnowsys-ndf/gnowsys_ndf/ndf/urls/file.py | 4 | ||||
-rw-r--r-- | gnowsys-ndf/gnowsys_ndf/ndf/urls/image.py | 2 | ||||
-rw-r--r-- | gnowsys-ndf/gnowsys_ndf/ndf/urls/video.py | 4 | ||||
-rw-r--r-- | gnowsys-ndf/gnowsys_ndf/ndf/views/file.py | 2 | ||||
-rw-r--r-- | gnowsys-ndf/gnowsys_ndf/ndf/views/imageDashboard.py | 3 |
9 files changed, 65 insertions, 102 deletions
diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/UploadDoc.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/UploadDoc.html index d60a39d9..976a696e 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/UploadDoc.html +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/UploadDoc.html @@ -3,94 +3,51 @@ {% block head %} <!-- Dropzonejs : Enable dropping of files with thumbnails and progress bar http://www.dropzonejs.com/ MIT LICENSE--> - -<!-- script src="/static/ndf/dropzonejs/dropzone.js"></script> -<link rel="stylesheet" href="/static/ndf/dropzonejs/css/dropzone.css" --> - +<!-- +<script src="/static/ndf/dropzonejs/dropzone.js"></script> +<link rel="stylesheet" href="/static/ndf/dropzonejs/css/dropzone.css"> +--> {% endblock %} {% block body_content %} {% if user.is_authenticated %} - - -<form class="dropzone" id ="docPost" enctype="multipart/form-data" method="post" action="{% url 'submitDoc' group_name %}">{% csrf_token %} - <fieldset> - <legend>Upload File</legend> - - <div class="fallback"> - <label>Choose File</label> - <input type="file" name="doc[]" id="docFile" multiple/> - <label>Title of File</label> - <input type="text" name="docTitle" id ="docTitle" placeholder="Enter Title of File"> - </div> - </fieldset> - <fieldset> - <legend>Add Description</legend> - {% include "ndf/add_editor.html" with var_name="content_org" var_placeholder="Please enter question" %} - </fieldset> - <fieldset> - <legend>Add Tag</legend> - <input id="tags_id" name="tags" type="text" value="{{node.tags|join:', '|default_if_none:""}}" placeholder="Example: abc, XYZ" /> - </fieldset> - <input type="hidden" name="user" value="{{user.id}}"> - <input type="hidden" name="page_url" value="{{page_url}}"> - <input type="submit" id="submitpostid" value="Submit" class="button small-10 small-push-1 column"> - <p id="message" style="display:none"> It will take time to upload and process files, you can continue your work on this site - <br/> - For fast uploading of videos, upload videos in webm format </p> - </form> - - <!-- -<h4>Submit Documents</h4> -<div style='display:table; border:1px; border-spacing:10px; '> +<form class="dropzone" id ="docPost" enctype="multipart/form-data" method="post" action="{% url 'submitDoc' group_name %}">{% csrf_token %} + <div class="fallback"> + <input type="file" name="doc[]" id="docFile" multiple/> + <input type="hidden" name="user" value="{{user.id}}"> + <input type="hidden" name="page_url" value="{{page_url}}"> + </div> +</form> +--> +<form class="dropzone" id ="docPost" enctype="multipart/form-data" method="post" action="{% url 'submitDoc' group_name %}">{% csrf_token %} + <div class ="row"> + <fieldset small-6 large-12 coloumns> + <legend>Upload File</legend> + <div class="fallback"> + <label>Choose File</label> + <input type="file" name="doc[]" id="docFile" multiple/> + <label>Title of File</label> + <input type="text" name="docTitle" id ="docTitle" placeholder="Enter Title of File"> + </div> + </fieldset> + <fieldset> + <legend>Add Description</legend> + {% include "ndf/add_editor.html" with var_name="content_org" var_placeholder="Please enter question" %} + </fieldset> + <fieldset> + <legend>Add Tag</legend> + <input id="tags_id" name="tags" type="text" value="{{node.tags|join:', '|default_if_none:""}}" placeholder="Example: abc, XYZ" \ + /> + </fieldset> + <input type="hidden" name="user" value="{{user.id}}"> + <input type="hidden" name="page_url" value="{{page_url}}"> + <input type="submit" id="submitpostid" value="Submit" class="button small-10 small-push-1 column"> + <p id="message" style="display:none"> It will take time to upload and process files, you can continue your work on this site + <br/> + For fast uploading of videos, upload videos in webm format </p> +</form> - <form id ="docPost" enctype="multipart/form-data" method="post" action="{% url 'submitDoc' group_name %}">{% csrf_token %} - <div style='display:table-row;' > - <div style='display:table-cell;'> - <font size="3" >Title</font> - </div> - <div style='display:table-cell;'> - <input type="text" name="docTitle" id ="docTitle" placeholder="Enter Title of File"> - </div> - </div> - <div style='display:table-row;' > - <div style='display:table-cell;'> - <font size="3" >Choose File</font> - </div> - <div style='display:table-cell;'> - <input type="file" name="doc[]" id="docFile" multiple/> - </div> - </div> - <div style='display:table-row;' > - <div style='display:table-cell;'> - <font size="3" >Descrption</font> - </div> - <div style='display:table-cell;'> - <input type="text" name="Tags" placeholder="Write Description about File"> - </div> - </div> - <div style='display:table-row;' > - <div style='display:table-cell;'> - <font size="3" >Tags</font> - </div> - <div style='display:table-cell;'> - <input type="text" name="Tags" placeholder="Enter Tags for File"> - </div> - </div> - <div style='display:table-row;' > - <div style='display:table-cell;' colspan="2"> - <input type="hidden" name="user" value="{{user.id}}"> - <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> - <p id="message" style="display:none"> It will take time to upload and process files, you can continue your work on this site - <br/> - For fast uploading of videos, upload videos in webm format </p> - </form> -</div> ---> {% else %} <p><em>You are Not Authorised user please login to upload files </em></p> diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/file.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/file.html index 5c24e3e7..9c3b4ecf 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/file.html +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/file.html @@ -53,11 +53,11 @@ {% get_user_object file.created_by as user_obj %} {% get_grid_fs_object file as grid_fs_obj %} <tr> - <td>{{file.name}}</td> + <td><a href ="{% url 'read_file' group_name file grid_fs_obj.filename %}">{{file.name}}</a></td> <td>{{file.file_size.size}}{{file.file_size.unit}}</td> <td>{{file.mime_type}}</td> <td>{{ user_obj.username }}</td> - <td><a href="{% url 'read_file' 'group' file %}" download="{{ grid_fs_obj.filename }}">Download </a></td> + <td><a href="{% url 'read_file' group_name file grid_fs_obj.filename %}" download="{{ grid_fs_obj.filename }}">Download </a></td> <td> {% get_user_object file.created_by as user_obj %} {% ifequal user_obj.username user.username %} diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/image_detail.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/image_detail.html index f3220fb6..f923b419 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/image_detail.html +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/image_detail.html @@ -4,15 +4,16 @@ {% block add_list %} {% get_grid_fs_object node as grid_fs_obj %} <li> -<a href="{% url 'read_file' 'group' node %}" class="button tiny secondary" download="{{ grid_fs_obj.filename }}"> +<a href="{% url 'read_file' 'group' node grid_fs_obj.filename %}" class="button tiny secondary" download="{{ grid_fs_obj.filename }}"> <i class="fi-download large"> download </i> </a> </li> {% endblock %} {% block add_fields %} +{% get_grid_fs_object node as grid_fs_obj %}x <div> - <a href="{% url 'getFullImage' group_name node %}"> - <img src="{% url 'getFullImage' group_name node %}" altname="{{node.name}}"></img> + <a href="{% url 'getFullImage' group_name node grid_fs_obj.filename %}"> + <img src="{% url 'getFullImage' group_name node grid_fs_obj.filename %}" altname="{{node.name}}"></img> </a> </div> {% endblock %} diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/video_detail.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/video_detail.html index d94a138f..3c4bb1b5 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/video_detail.html +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/video_detail.html @@ -1,12 +1,24 @@ {% extends "ndf/node_details_base.html" %} - +{% load ndf_tags %} {% block url %}{% url 'video_edit' group_name node %}{% endblock %} + +{% block add_list %} +{% get_grid_fs_object node as grid_fs_obj %} +<li> +<a href="{% url 'getFullvideo' group_name node %}" class="button tiny secondary" download="{{ grid_fs_obj.filename }}"> + <i class="fi-download large"> download </i> +</a> +</li> +{% endblock %} + {% block add_fields %} + + <div> <video width="640px" controls buffered> - <source src="{% url 'getFullvideo' group_name node %}" type="video/webm"> - <source src="{% url 'getFullvideo' group_name node %}" type="video/ogg"> + <source src="{% url 'getFullvideo' group_name node %}" type="video/webm"> + <source src="{% url 'getFullvideo' group_name node %}" type="video/ogg"> Your browser does not support the video tag. -</video> +</video> </div> {% endblock %} diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/urls/file.py b/gnowsys-ndf/gnowsys_ndf/ndf/urls/file.py index e6604895..26619f8c 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/urls/file.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/urls/file.py @@ -8,13 +8,11 @@ from gnowsys_ndf.ndf.views import * urlpatterns = patterns('gnowsys_ndf.ndf.views.file', url(r'^(?P<file_id>[\w-]+)$', 'file', name='file'), - #url(r'^uploadDoc/$', TemplateView.as_view(template_name='ndf/UploadDoc.html')), #Direct ot html template - # url(r'^uploadDoc/(?P<pageurl>\w+)/$', 'uploadDoc', name='uploadDoc'), #Direct ot html template url(r'^uploadDoc/$', 'uploadDoc', name='uploadDoc'), #Direct ot html template url(r'^submitDoc/', 'submitDoc', name='submitDoc'), url(r'^submit/', 'submitDoc', name='submitDoc'), url(r'^documentList/', 'GetDoc', name='documentList'), - url(r'^readDoc/(?P<_id>[\w-]+)$', 'readDoc', name='read_file'), + url(r'^readDoc/(?P<_id>[\w-]+)/(?P<file_name>[^/]+)$', 'readDoc', name='read_file'), url(r'^search/$', 'file_search', name='file_search'), url(r'^delete_file/(?P<_id>[\w-]+)$', 'delete_file', name='delete_file'), diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/urls/image.py b/gnowsys-ndf/gnowsys_ndf/ndf/urls/image.py index dca7b380..fa4abf74 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/urls/image.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/urls/image.py @@ -10,7 +10,7 @@ urlpatterns = patterns('gnowsys_ndf.ndf.views.imageDashboard', url(r'^(?P<image_id>[\w-]+)$', 'imageDashboard', name='image'), #url(r'^images/', 'imageDashboard', name='imageDashboard'), url(r'^imageThumbnail/(?P<_id>[\w-]+)$', 'getImageThumbnail', name='getImageThumbnail'), - url(r'^fullImage/(?P<_id>[\w-]+)$', 'getFullImage', name='getFullImage'), + url(r'^fullImage/(?P<_id>[\w-]+)/(?P<file_name>[^/]+)$', 'getFullImage', name='getFullImage'), url(r'^get_mid_size_img/(?P<_id>[\w-]+)$', 'get_mid_size_img', name='get_mid_size_img'), url(r'^image_search/$', 'image_search', name='image_search'), url(r'^image_detail/(?P<_id>[\w-]+)$', 'image_detail', name='image_detail'), diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/urls/video.py b/gnowsys-ndf/gnowsys_ndf/ndf/urls/video.py index 7490ecb9..29b460dc 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/urls/video.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/urls/video.py @@ -1,11 +1,7 @@ from django.conf.urls import patterns, url - from django.views.generic import TemplateView - from gnowsys_ndf.ndf.views import * - - urlpatterns = patterns('gnowsys_ndf.ndf.views.videoDashboard', url(r'^(?P<video_id>[\w-]+)$', 'videoDashboard', name='video'), #url(r'^videos/', 'videoDashboard', name='videoDashboard'), diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/views/file.py b/gnowsys-ndf/gnowsys_ndf/ndf/views/file.py index 457c5ee8..93cd4155 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/views/file.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/views/file.py @@ -290,7 +290,7 @@ def GetDoc(request, group_name): variable = RequestContext(request, {'filecollection':files}) return render_to_response(template, variable) -def readDoc(request, _id, group_name): +def readDoc(request, _id, group_name, file_name = ""): filecollection = get_database()[File.collection_name] fileobj = filecollection.File.one({"_id": ObjectId(_id)}) grid_fs_obj = fileobj.fs.files.get(ObjectId(fileobj.fs_file_ids[0])) diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/views/imageDashboard.py b/gnowsys-ndf/gnowsys_ndf/ndf/views/imageDashboard.py index d7c53bfb..f2e4793d 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/views/imageDashboard.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/views/imageDashboard.py @@ -30,7 +30,6 @@ def imageDashboard(request, group_name, image_id): already_uploaded=request.GET.getlist('var',"") variable = RequestContext(request, {'imageCollection': img_col,'already_uploaded':already_uploaded }) return render_to_response(template, variable) - def getImageThumbnail(request, group_name, _id): ''' this funciton can be called to get thumbnail of image throw url @@ -44,7 +43,7 @@ def getImageThumbnail(request, group_name, _id): return HttpResponse("") -def getFullImage(request, group_name, _id): +def getFullImage(request, group_name, _id, file_name = ""): img_obj = collection.File.one({"_id": ObjectId(_id)}) if img_obj is not None: if (img_obj.fs.files.exists(img_obj.fs_file_ids[0])): |