Commit 29c4a274 authored by Rachana's avatar Rachana

Merge pull request #1251 from kedar2a/mongokit-nroer

Contributors form updated. After file upload redirection changed.
parents 311d9362 702c31ed
......@@ -45,7 +45,7 @@
</div>
<div class="large-9 columns">
<label>{% trans "Title of File" %}</label>
<input type="text" name="docTitle" id ="docTitle" tabindex=2 placeholder="Enter Title of File" required>
<input type="text" name="docTitle" id ="docTitle" tabindex=2 placeholder="Title of File" required>
<small class="error">Please provide the title of the resource.</small>
</div>
</div>
......@@ -53,12 +53,12 @@
<!-- other details -->
<fieldset style="background:#ccc;">
<legend style="background:#10c1cb">{% trans "Enter Details" %}</legend>
<legend style="background:#10c1cb">{% trans "Details" %}</legend>
<div class ="row">
<div class="large-5 columns">
<b>Add Description</b>
{% include "ndf/add_editor.html" with var_name="content_org" var_placeholder="Please enter question" %}
{% include "ndf/add_editor.html" with var_name="content_org" var_placeholder="Describe the file" %}
<div class="row">
......@@ -100,7 +100,7 @@
<div class="large-7 columns">
<div class ="row">
<div class="large-4 columns">
<b>Set Language</b>
<b>Language</b>
<select name="lan" tabindex=3 required>
<option value="">--- Select Language ---</option>
{% get_language_info_list for LANGUAGES as languages %}
......@@ -118,13 +118,16 @@
<a href="#view-map-edit-widget" data-reveal-id="view-map-edit-widget" title="Click to add location markers" class="tiny secondary button expand"> <i class="fi-marker"></i> &nbsp; {% trans "Add Location" %}
</a>
</div>
<!--
<div class="large-4 columns">
<b>Set Privacy</b><br/>
<input id="PUBLIC" name="login-mode" value="PUBLIC" type="radio" checked>
<label for="PUBLIC" onclick="">{% trans "Public" %} <i class="fi-torsos-all"></i></label>
<input id="PRIVATE" name="login-mode" value="PRIVATE" type="radio">
<label for="PRIVATE" onclick="">{% trans "Private" %} <i class="fi-lock"></i></label>
</div>
</div> -->
<input id="PUBLIC" name="login-mode" value="PUBLIC" type="hidden" >
</div>
<br/>
<div class ="row">
......@@ -171,6 +174,7 @@
{% for opts in v %}
<option>{% trans opts %}</option>
{% endfor %}
<option>Not Sure</option>
</select>
<small class="error">Please select resource Subject</small>
......@@ -188,6 +192,7 @@
{% for opts in v %}
<option>{% trans opts %}</option>
{% endfor %}
<option>Not Sure</option>
</select>
<small class="error">Please select resource audience</small>
......@@ -221,7 +226,7 @@
<b>Source</b>
</div>
<div class="large-10 columns">
<input id="source_id" name="Source" type="text" placeholder="Enter source name" tabindex="8"/>
<input id="source_id" name="Source" type="text" placeholder="Owner of the file" tabindex="8"/>
</div>
</div>
......@@ -230,7 +235,7 @@
<b>Based on url</b>
</div>
<div class="large-9 columns">
<input id="based_on_id" name="based_url" type="text" placeholder="Enter valid url" tabindex="9"/>
<input id="based_on_id" name="based_url" type="text" placeholder="Web Address (url) of the file if you sourced it from a website" tabindex="9"/>
</div>
</div>
......
......@@ -6,10 +6,23 @@
{% block meta_content %}
<!-- This content displayed into the left panel to display the info/hrlp document -->
<h3>{% trans "Uploader Form" %}</h3>
<p class="text-justify subheader">
{% trans "You can upload <b>files</b> of any format to your group library." %}
</p>
<h3>{% trans "Contribute File" %}</h3>
<ul class="text-justify subheader">
<li>
{% trans "You can contribute only Open Educational Resources" %}
({% trans "Copyrighted material cannot be contributed" %})
</li>
<li>
{% trans "You can upload files of any format" %}
</li>
<li>
{% trans "All files get uploaded under the CC-BY-SA licence (This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license their new creations under the identical terms) unless you chose a different licence" %}
</li>
<li>
{% trans "Please visit" %} https://creativecommons.org/licenses/ {% trans "and" %} http://www.gnu.org/licenses/fdl-1.3.en.html {% trans "to learn more about licenses" %}
</li>
</ul>
{% endblock %}
......
......@@ -550,11 +550,11 @@
var c = this.getAttribute("data-filetype");
if(educationaluse_stats.hasOwnProperty(c)){
$(this).find("a > span.count:visible").fadeOut().fadeIn().text(educationaluse_stats[c]);
$(this).find("a > span.count:visible").text(educationaluse_stats[c]);
}
else
{
$(this).find("a > span.count:visible").fadeOut().fadeIn().text("0");
$(this).find("a > span.count:visible").text("0");
}
});
......
......@@ -8,6 +8,14 @@
#select-search-container{
width: 100%;
background-color: whitesmoke;
padding-right: 5px;
}
#select-search-container > i.fi-play{
position: absolute;
right: 12px;
transform: rotate(90deg);
color: gray;
}
#selected-items > .selection{
......@@ -63,12 +71,14 @@
.item-title{
text-transform: uppercase;
color: #020;
}
.item-description{
color: gray;
}
</style>
<div class="selector-widget" id="{{for}}-selector-widget">
......@@ -78,7 +88,9 @@
<div id="select-search-container">
<div id="selected-items" style=""></div>
<i class="fi-play"></i>
<div id="selected-items"></div>
<div id="search-text" contenteditable>search</div>
......
......@@ -736,10 +736,13 @@ def submitDoc(request, group_id):
source = request.POST.get("Source", "")
Audience = request.POST.get("audience", "")
fileType = request.POST.get("FileType", "")
subject = request.POST.get("Subject", "")
level = request.POST.get("Level", "")
Based_url = request.POST.get("based_url", "")
map_geojson_data = request.POST.get('map-geojson-data')
subject = request.POST.get("Subject", "")
level = request.POST.get("Level", "")
subject = '' if (subject=='Not Sure') else subject
level = '' if (level=='Not Sure') else level
if map_geojson_data:
map_geojson_data = map_geojson_data + ","
......@@ -756,11 +759,11 @@ def submitDoc(request, group_id):
if index == 0:
# f, is_video = save_file(each, mtitle, userid, group_id, content_org, tags, img_type, language, usrname, access_policy, oid=True)
f, is_video = save_file(each, mtitle, userid, group_id, content_org, tags, img_type, language, usrname, access_policy, license, source, Audience, fileType, subject, level, Based_url, request, map_geojson_data, oid=True)
f, is_video = save_file(each, mtitle, userid, group_id, content_org, tags, img_type, language, usrname, access_policy, license, source, Audience, fileType, subject, level, Based_url, request, map_geojson_data)
else:
title = mtitle + "_" + str(i) # increament title
f, is_video = save_file(each, title, userid, group_id, content_org, tags, img_type, language, usrname, access_policy, license, source, Audience, fileType, subject, level, Based_url, request, map_geojson_data, oid=True)
f, is_video = save_file(each, title, userid, group_id, content_org, tags, img_type, language, usrname, access_policy, license, source, Audience, fileType, subject, level, Based_url, request, map_geojson_data)
i = i + 1
else:
title = each.name
......@@ -770,15 +773,24 @@ def submitDoc(request, group_id):
# if not obj_id_instance.is_valid(f):
# check if file is already uploaded file
# if isinstance(f, list):
f = save_file(each,title,userid,group_id, content_org, tags, img_type, language, usrname, access_policy, license, source, Audience, fileType, subject, level, Based_url, request, map_geojson_data, oid=True)
f, is_video = save_file(each,title,userid,group_id, content_org, tags, img_type, language, usrname, access_policy, license, source, Audience, fileType, subject, level, Based_url, request, map_geojson_data)
if isinstance(f, list):
alreadyUploadedFiles_append_temp(f)
title = mtitle
# print "=============== : ", f
try:
ObjectId(f)
except:
if isinstance(f, list):
# alreadyUploadedFiles_append_temp(f)
alreadyUploadedFiles = f
title = mtitle
# str1 = alreadyUploadedFiles
# print "=============== : ", alreadyUploadedFiles
if img_type != "":
# print "----------1-----------"
return HttpResponseRedirect(reverse('dashboard', kwargs={'group_id': int(userid)}))
......@@ -791,8 +803,8 @@ def submitDoc(request, group_id):
if alreadyUploadedFiles:
# return HttpResponseRedirect(page_url+'?var='+str1)
# if (type(alreadyUploadedFiles[0][0]).__name__ == "ObjectId"):
# print "----------3-----------", alreadyUploadedFiles[0][1]
return HttpResponseRedirect(reverse("file_detail", kwargs={'group_id': group_id, "_id": alreadyUploadedFiles[0][1].__str__() }))
# print "----------3-----------", alreadyUploadedFiles
return HttpResponseRedirect(reverse("file_detail", kwargs={'group_id': group_id, "_id": alreadyUploadedFiles[1].__str__() }))
# else:
# if alreadyUploadedFiles[0][1]:
# return HttpResponseRedirect(reverse("file_detail", kwargs={'group_id': group_id, "_id": alreadyUploadedFiles[0][0].__str__() }))
......@@ -809,8 +821,9 @@ def submitDoc(request, group_id):
t = create_moderator_task(request, fileobj.group_set[0], fileobj._id,on_upload=True)
return HttpResponseRedirect(reverse('moderation_status', kwargs={'group_id': fileobj.group_set[1], 'node_id': f }))
else:
# print "----------5-----------"
return HttpResponseRedirect(reverse('file', kwargs={'group_id': group_id }))
# print "----------5-----------", f
return HttpResponseRedirect(reverse("file_detail", kwargs={'group_id': group_id, "_id": ObjectId(f) }))
# if is_video == "True":
# return HttpResponseRedirect(page_url+'?'+'is_video='+is_video)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment