Commit bbbf6341 authored by Kedar A.'s avatar Kedar A. 💻

Merge pull request #1242 from katkamrachana/course_player

Course Event updates
parents db21ab6c eaf93b7e
......@@ -16,8 +16,8 @@ Master Trainer,"[""Person""]","[""factory_types""]",[],[],[]
Faculty Coordinator,"[""Person""]","[""factory_types""]",[],[],[]
NSS Coordinator,"[""Person""]","[""factory_types""]",[],[],[]
Course Developer,"[""Person""]","[""factory_types""]",[],[],[]
Steering Committee Member,"[""Person""]","[""factory_types""]",[],[],"[""Organization"", ""University"", ""College"", ""Course"", ""NUSSD Course"", ""Announced Course"", ""Person"", ""Partners"", ""Program Manager"", ""Steering Committee Member"", ""Faculty Coordinator"", ""Program Officer"", ""NSS Coordinator"", ""Course Developer"", ""Master Trainer"", ""Voluntary Teacher"", ""Student"", ""Enrollment"", ""StudentCourseEnrollment""]"
Program Officer,"[""Person""]","[""factory_types""]",[],[],"[""Person"", ""Student"", ""Enrollment"", ""StudentCourseEnrollment""]"
Steering Committee Member,"[""Person""]","[""factory_types""]",[],[],[]
Program Officer,"[""Person""]","[""factory_types""]",[],[],[]
Program Manager,"[""Person""]","[""factory_types""]",[],[],[]
Partners,"[""Person""]","[""factory_types""]",[],[],[]
Event,[],"[""GAPP""]",[],[],[]
......@@ -34,8 +34,8 @@ Lab Session,"[""Event""]","[""factory_types""]",[],[],[]
Exam,"[""Event""]","[""factory_types""]",[],[],[]
Enrollment,[],"[""factory_types""]",[],[],[]
StudentCourseEnrollment,"[""Enrollment""]","[""factory_types""]",[],[],[]
MIS,[],"[""GAPP""]",[],[],"[""Organization"", ""University"", ""College"", ""Course"", ""NUSSD Course"", ""Announced Course"", ""Person"", ""Partners"", ""Program Manager"", ""Steering Committee Member"", ""Faculty Coordinator"", ""Program Officer"", ""NSS Coordinator"", ""Course Developer"", ""Master Trainer"", ""Voluntary Teacher"", ""Student"", ""Enrollment"", ""StudentCourseEnrollment""]"
MIS-PO,[],"[""GAPP""]",[],[],"[""Person"", ""Voluntary Teacher"", ""Student""]"
MIS,[],"[""GAPP""]",[],[],[]
MIS-PO,[],"[""GAPP""]",[],[],[]
CourseSection,[],"[""factory_types""]",[],[],[]
CourseSubSection,[],"[""factory_types""]",[],[],[]
CourseUnit,[],"[""factory_types""]",[],[],[]
......
......@@ -17,12 +17,12 @@
// Function for manipulating tree when user visits to page directly via browser url
TreeTillNode();
});
function TreeTillNode () {
// This gives the last hierarchy node id from browser url.
var url = window.location.search.replace("?selected=", "")
// var url = window.location.search.replace("?selected=", "")
var url = "{{selected}}";
// Condition to check whether the tree has been loaded on the page completely or not before attempting any function on tree(such as 'getNodeById')
if (url && $(".collection").not(".jqtree-loading").length > 0){
......@@ -37,8 +37,7 @@
setTimeout(function(){
// console.log($(".collection"))
if(url && ($(".collection").length > 0)) { TreeTillNode() }
}, 100 );
$(".jqtree-title-folder").addClass('jqtree-toggler').removeClass('jqtree-title').removeClass('jqtree-title-folder');}, 100 );
}
......@@ -50,12 +49,6 @@
var node_type = "{{node_type}}";
if(node_type=="Group"||node_type=="Course"){
$('.collection').tree({
autoOpen: true
});
}
$tree.tree({
selectable: true,
});
......@@ -97,10 +90,10 @@
}
}
var nav_list = parent_arr.reverse();
if(node['node_type']!="CourseSectionEvent" && node['node_type']!="CourseSubSectionEvent" && node['node_type']!="CourseUnitEvent"){
// alert(nav_list);
// alert(node_type);
if(node_type!="Group"){
// alert("node_type");
$.ajax({
type: "POST",
......@@ -126,21 +119,18 @@
// else if (node_type == "Course"){
// window.history.pushState("", "", "/{{group_id}}/course/course_detail/{{node.pk}}"+"?selected="+node.id+"");
// }
// else if (node_type == "Group"){
// window.history.pushState("", "", "/{{node.pk}}"+"?selected="+node.id+"");
// }
if (node_type == "CourseEventGroup"){
window.history.pushState("", "", "/{{node.pk}}"+"?selected="+node.id+"");
$(".view_page_link").trigger('click')
}
// else if (node_type == "Topic"){
// window.history.pushState("", "", "/{{group_name_tag}}/topic_details/{{node.pk}}"+"?selected="+node.id+"");
// }
$("#view_page").html(data);
}
});
}
}
}
);
......
......@@ -27,35 +27,8 @@
{% block collection_content %}
<div id="view_collection">
{{node_type}}
{% include "ndf/collection_ajax_view.html" %}
</div>
{% if node_type == "Course" %}
{% user_access_policy groupid request.user as user_access %}
{% if user_access == "allow" %}
<span><a class="tiny button" href="{% url 'create_course_struct' group_id node.pk %}">{% if course_structure_exists %}{% trans "Edit Course Structure" %}{% else %}{% trans "Add Course Structure" %}{% endif %}</a></span>
{% endif %}
{% endif %}
{% endblock %}
{% block meta_content %}
{% endblock %}
<!-- overiding block_related content -->
{% block related_content %}
<!-- <section class="medium-6 large-12 columns">
<h3>{% trans "Modules" %}</h3>
<div class ="row">
{% for each in node.collection_set %}
bellow div for making tree from json data
<div class="tree" data-url="{% url 'get_module_json' groupid %}?_id={{each}}"></div>
{% endfor %}
</div>
</section> -->
{% endblock %}
<!-- overiding block from node_detail_base.html -->
......@@ -95,7 +68,15 @@
</small>
</section>
<section class="medium-3 columns name-section" >
<span><a class="small publish-btn button" style="width:73%" href="{% url 'create_event_group' group_id 'CourseEventGroup' %}?cnode_id={{node.pk}}">{% trans "Announce" %}</a></span>
<span><a class="tiny publish-btn button" href="{% url 'create_event_group' group_id 'CourseEventGroup' %}?cnode_id={{node.pk}}">{% trans "Announce" %}</a></span>
{% if node_type == "Course" %}
{% check_is_gstaff groupid request.user as is_gstaff %}
{% if is_gstaff %}
<span><a class="tiny button" href="{% url 'create_course_struct' group_id node.pk %}">{% if course_structure_exists %}{% trans "Edit Course Structure" %}{% else %}{% trans "Add Course Structure" %}{% endif %}</a></span>
{% endif %}
{% endif %}
</section>
</header>
......@@ -108,30 +89,6 @@
{% endwith %}
</div>
<br>
{% if node_type != "Course" %}
<section class="medium-8 columns" >
<div class="ann_for row">
<label class="small-3 columns "> {% trans "Announced Course for :"%}</label>
<span class="small-6 columns end"><u><a href="{% url 'course_detail' group_name_tag cnode.pk %}">{{cnode.name}}</a></u></span>
</div>
<br/>
</section>
{% if user.is_authenticated %}
{% user_access_policy groupid request.user as user_access %}
{% if user_access != "allow" %}
<section class="medium-4 columns" >
<div class="row">
<div class="small-6 columns">
<input type="button" class="button enroll-btn" value="Enroll">
</div>
</div>
</section>
{% endif %}
{% endif %}
{% endif %}
<div id="view_page"></div>
......@@ -140,35 +97,6 @@
{% block script %}
{{block.super}}
$(document).on("click", ".enroll-btn", function(event) {
console.log("{{request.user.id}}")
enr_btn = $(this)
$.ajax({
url: "{% url 'course_enroll' group_id %}",
data: {
node_id: "{{node.pk}}",
usr_id: "{{request.user.id}}",
'csrfmiddlewaretoken': "{{csrf_token}}"
},
type: "POST",
dataType: "json",
success: function(data){
success_state = data["success"]
if(success_state){
enr_btn.attr("disabled",true)
.val("Enrolled");
}
else{
alert("Something went wrong. Please try again later.")
}
},
});//end of ajax
})
// Click on delete button
$(document).on('click','.fi-trash',function(){
lbl_msg = "Are you sure you want to delete '{{node.name}}' course?"
......@@ -198,11 +126,6 @@
{% block document_ready %}
{{block.super}}
{% if enrolled_status %}
$(".enroll-btn").attr("disabled",true)
.val("Enrolled");
{% endif %}
$(function() {
$('.tree').tree({
autoOpen: 0
......
......@@ -117,7 +117,7 @@
{% endif %}
</div>
<div class="small-3 columns">
<span data-tooltip title="You will be redirected to Course Authoring page" style="float:right;">
<span data-tooltip title="You will be redirected previous page" style="float:right;">
<a class="done_units tiny button round" style="float:right;">Back</a>
</span>
</div>
......@@ -498,11 +498,16 @@
$(document).on('click','.done_units',function(){
turl = "{% url 'create_course_struct' groupid course_node.pk %}"
if("{{app_id}}"!= ""){
turl += "?app_id={{app_id}}&app_set_id={{app_set_id}}"
}
$(this).attr("href",turl)
{% get_group_object groupid as group_object %}
{% if "CourseEventGroup" in group_object.member_of_names_list %}
$(this).attr('href', '/{{group_id}}/course/structure/create/{{group_id}}')
{% else %}
turl = "{% url 'create_course_struct' groupid course_node.pk %}"
if("{{app_id}}"!= ""){
turl += "?app_id={{app_id}}&app_set_id={{app_set_id}}"
}
$(this).attr("href",turl)
{% endif %}
})
......@@ -518,7 +523,7 @@
var cell2 = row.insertCell(1);
var cell3 = row.insertCell(2);
cell1.innerHTML = "Type";
cell2.innerHTML = "Name";
cell2.innerHTML = "All Resources";
cell3.innerHTML = "Action";
{% get_node unit_node.pk as unit_node %}
......
......@@ -9,11 +9,15 @@
{% get_group_name groupid as group_name_tag %}
{% block meta_content %}
{% if 'NUSSD Course' in cnode.member_of_names_list %}
<a href="{% url 'mis_course_detail' group_name_tag app_id app_set_id cnode %}"><h3><u>{{cnode.name}}</u></h3></a>
{% get_group_object groupid as group_object %}
{% if "CourseEventGroup" in group_object.member_of_names_list %}
<a href="{% url 'groupchange' groupid %}"><h3><u>{{cnode.name}}</u></h3></a>
{% else %}
<a href="{% url 'course_detail' group_name_tag cnode %}"><h3><u>{{cnode.name}}</h3></u></a>
{% if 'NUSSD Course' in cnode.member_of_names_list %}
<a href="{% url 'mis_course_detail' group_name_tag app_id app_set_id cnode %}"><h3><u>{{cnode.name}}</u></h3></a>
{% else %}
<a href="{% url 'course_detail' group_name_tag cnode %}"><h3><u>{{cnode.name}}</h3></u></a>
{% endif %}
{% endif %}
{% endblock %}
......
......@@ -398,6 +398,7 @@ this template is modified. So for the fields in the template it supports -
dateFormat: 'dd/mm/yy',
yearRange: lowerYearLimit + ":" + upperYearLimit,
defaultDate: '0',
minDate: '0',
onClose: function(dateText, inst) {
if($(this).attr('id') == 'event_start_date' || $(this).attr('id') == 'event_end_date'){
......
......@@ -7,9 +7,9 @@
<br/>
<div onclick="createDiscussion()" id="create-discussion" data-id="{{ node.pk }}" class="button" style="margin-bottom:0;">
{% if all_replies %}
Initiate New Discussion Thread
Comment
{% else %}
Initiate discussion on {{ node.name }}
Comment on {{ node.name }}
{% endif %}
</div>
......@@ -100,7 +100,7 @@
function createDiscussion()
{
// if( user_access == "allow" && edit_policy == "allow" )
if( user_access == "allow"){
if( is_user_authenticated )
{
{% if request.user.is_authenticated %}
......@@ -150,15 +150,19 @@
// alert("To start discussion you need to login and be the member of this group.");
alert("Login to start discussion");
}
}
else{
alert("Only group members can comment.");
}
}
// --- END of createDiscussion()
// function called by "Add Reply" and "Reply" buttons to open editor
function openOrgEditor(sourceObj)
{
// if( user_access == "allow" && edit_policy == "allow" )
if( user_access == "allow"){
if( is_user_authenticated )
{
......@@ -195,6 +199,11 @@
alert("Login to start discussion.");
}
}
else{
alert("Only group members can reply to comment.");
}
}
function updateDiscussionTabText()
......@@ -203,7 +212,7 @@
if(totalReplies == 0)
{
$(".view-discussion span").fadeOut().fadeIn().html("Begin Discussion");
$("#create-discussion").text("Initiate discussion on " + $("h1 span.node[itemprop]").text().trim());
$("#create-discussion").text("Comment " + $("h1 span.node[itemprop]").text().trim());
}
else
{
......@@ -252,7 +261,7 @@
$('#org').foundation('reveal', 'close');
var priorNodeId = $("#prior-node").val(),
replyContent = $("#orgitdownreps").val().trim();
replyContent = $("#orgitdownreps:visible").val().trim();
// If reply is non empty - make ajax to save reply.
if( (replyContent.length > 0) && (priorNodeId.length == 24) )
......@@ -296,7 +305,7 @@
if(priorNodeId == "{{ node.pk }}") // main reply
{
// change the text of Start discussion and make it visible
$("#create-discussion").html("Initiate New Discussion Thread");
$("#create-discussion").html("Comment");
// $("#create-discussion").fadeIn();
//sample format of data = [0:"status_info", 1:"reply_id", 2:"prior_node", 3:"html_content", 4:"org_content", 5:"user_id", 6:"user_name", 7:"created_at" ]
......@@ -315,6 +324,7 @@
}
// updating tab-text
updateDiscussionTabText();
location.reload();
}
else if( data[0] == "no_content" ){
......
......@@ -122,10 +122,17 @@
<h5> {% trans "Sorry, No resources found with selected filters :(" %}</h5>
{% else %}
{% if not dont_show_error %}
{% if "CourseEventGroup" in node.member_of_names_list %}
<h5>
{% blocktrans %}No files have been uploaded yet.{% endblocktrans %}
</h5>
{% else %}
<h5>
{% blocktrans %}This group doesn't have any files. <b>Be the first to upload a file!</b>{% endblocktrans %}
</h5>
{% endif %}
{% endif %}
{% endif %}
</div>
......
{% load get_nroer_menu get_user_group get_group_object get_existing_groups_excluded get_profile_pic get_gapps_iconbar from ndf_tags %}
{% load get_nroer_menu get_user_group get_group_object get_existing_groups_excluded get_profile_pic get_gapps_iconbar user_access_policy get_user_object check_is_gstaff from ndf_tags %}
<style type="text/css">
#search_text {
......@@ -11,7 +11,8 @@
color: #fff !important;
height: inherit;
box-shadow: none;
}
}
::-webkit-input-placeholder {
color: gray;
}
......@@ -138,7 +139,7 @@
<!-- Current group selector -->
<li class="group">
<a title="{{group_object.name|default:' -- '}}" class="active" >
<a title="{{group_object.name|default:' -- '}}" class="active" href="{% url 'groupchange' group_object.name %}">
{{group_object.name|truncatechars:20}}
</a>
</li>
......@@ -461,9 +462,40 @@
<!-- {#% endcache %} -->
{% endif %} <!-- end of "/welcome" landing page check -->
{% endif %} <!-- end of "accounts" urls check -->
</nav>
{% else %}
<ul class="title-area">
<li class="name" ><h1><a href="#">Invitation to CLIx</a></h1></li>
</ul>
<!-- Right Nav Section -->
{% if user.is_authenticated %}
{% get_user_object request.user.id as user_obj %}
{% check_is_gstaff groupid user_obj as gstaff_access %}
{% if not gstaff_access %}
<section>
<ul class="right" >
{% user_access_policy groupid request.user as user_access %}
<li>
{% if user_access == "allow" %}
<input class="enroll-btn button large" type="button" value="ENROLLED" disabled="disabled">
{% else %}
{% if allow_to_join %}
<input class="enroll-btn button large" type="button" value="ENROLL">
{% else %}
<input class="enroll-btn button large" type="button" value="ENROLLMENT CLOSED" disabled="disabled">
{% endif %}
{% endif %}
</li>
</ul>
</section>
{% endif %}
{% endif %}
{% endif %} <!-- end of "group's edit_policy" urls check -->
</nav>
</div>
<!-- end of second nav -->
......
......@@ -105,7 +105,7 @@ function adget_all_data(){
</script>
<div id="subscr_admins">
<li><a href="#" data-reveal-id="inviteadmins">Subscribe Admins</a></li>
<li><a href="#" data-reveal-id="inviteadmins" class="button tiny round">Subscribe Admins</a></li>
<div id="inviteadmins" class="reveal-modal " data-reveal >
......
......@@ -105,7 +105,7 @@ function get_all_data(){
</script>
<div id="subscr_users">
<li><a href="#" data-reveal-id="inviteusers">Subscribe Users</a></li>
<li><a href="#" data-reveal-id="inviteusers" class="button tiny round">Subscribe Users</a></li>
<div id="inviteusers" class="reveal-modal " data-reveal >
......
......@@ -1267,12 +1267,12 @@ ul#navigation li a.last {
<section class="medium-3 columns">
{% if 'CourseEventGroup' not in group_object.member_of_names_list %}
<!-- Modal links for associated views like graphs and map-->
<ul class="side-nav">
<div class="panel" style="background-color:#ddd;">
{% get_group_object groupid as group_object %}
{% user_access_policy groupid request.user as user_access %}
{% if user.is_authenticated %}
......@@ -1293,7 +1293,7 @@ ul#navigation li a.last {
{% get_sg_member_of groupid as list_of_sg_member_of %}
{% if "ProgramEventGroup" in list_of_sg_member_of %}
<li><a href="{% url 'edit_event_group' group_id 'ProgramEventGroup' %}" class="tiny round button edit"><i class="fi-pencil"></i> {% trans "Edit ProgramEvent" %}</a></li><br>
{% elif "CourseEventGroup" in list_of_sg_member_of %}
{% elif "CourseEventGroup" in node.member_of_names_list %}
<li><a href="{% url 'edit_event_group' group_id 'CourseEventGroup' %}" class="tiny round button edit"><i class="fi-pencil"></i> {% trans "Edit CourseEvent" %}</a></li><br>
{% else %}
<li><a href="{% url edit_url group_id %}" class="tiny round button edit"><i class="fi-pencil"></i> {% trans "Edit" %}</a></li><br>
......@@ -1363,8 +1363,6 @@ ul#navigation li a.last {
</a>
</li>
{% endif %}
{% endif %}
......@@ -1471,10 +1469,9 @@ ul#navigation li a.last {
{% check_is_gstaff groupid request.user as is_gstaff %}
{% if is_gstaff %}
{% ifnotequal group_object.edit_policy "EDITABLE_MODERATED" %}
{% if group_object.edit_policy != EDITABLE_MODERATED%}
{% include "ndf/invite_users.html" %}
{% endifnotequal %}
{% endif %}
{% include "ndf/invite_admins.html" %}
{% endif %}
......@@ -1625,7 +1622,7 @@ ul#navigation li a.last {
</div>
</ul>
{% endif %}
{% if "video" in node.mime_type %}
<link rel="stylesheet" href="/static/ndf/bower_components/videojs/dist/video-js/video-js.min.css">
<script src="/static/ndf/bower_components/videojs/dist/video-js/video.js"></script>
......
......@@ -91,6 +91,7 @@ i.remove-tag{
<!-- change name of collection tab overide block in your code -->
<a>{% block page_tab %} {% trans "Node" %} {% endblock %}</a>
</dd>
{% if not ce_id %}
<dd class="prior_node_tab" title="Click here to add/edit Prior Node">
<a>{% block prior_node_tab %} {% trans "Requires" %} {% endblock %}</a>
</dd>
......@@ -110,6 +111,7 @@ i.remove-tag{
<dd class="assesses_tab" title="Click here to add/edit teaches">
<a>{% trans "Assesses" %} </a>
</dd>
{% endif %}
</dl>
</div>
......@@ -130,8 +132,13 @@ i.remove-tag{
<div class="medium-8 columns">
{% include "ndf/add_editor.html" with var_name="content_org" var_placeholder="Enter the content here" var_value=node.content_org|default_if_none:"" node_id=node.pk %}
</div>
<!-- -->
{% if ce_id %}
<input type="hidden" name="ce_id" value="{{ce_id}}">
<input type="hidden" name="res" value="{{res}}">
{% endif %}
{% if not ce_id %}
<div class="large-4 columns">
<div class="panel">
<h5>{% trans "Settings" %}</h5>
......@@ -221,25 +228,13 @@ i.remove-tag{
<span style="width: 70px; float: left;" > Page Type: </span>
</div>
<div class="small-8 columns" ends>
{% if ce_id %}
<input type="hidden" name="ce_id" value="{{ce_id}}">
<select name="type_of" id="type_of" disabled="disabled">
{% else %}
<select name="type_of" id="type_of">
{% endif %}
{% for i in page_instance %}
{% if ce_id %}
{% if i.name == "Blog page" %}
<option value = {{i.pk}} selected> {{i.name}} </option>
{% endif %}
{% else %}
{% if i.name == "Wiki page" %}
<option value = {{i.pk}} selected> {{i.name}} </option>
{% else %}
<option value = {{i.pk}} > {{i.name}} </option>
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
</select>
</div>
......@@ -248,6 +243,7 @@ i.remove-tag{
</div>
</div>
{% endif %}
<div class="row">
<div class="small-8 columns">
......@@ -255,7 +251,6 @@ i.remove-tag{
<div class="row">
<h3 >
<span class="subheader small-3 columns" data-tooltip class="has-tip" title="{% trans 'Tags help identify similiar work easily. Just add tag text and click Add Tag button' %}"> {% trans "Add Tag" %}:
</span>
......
......@@ -2743,13 +2743,14 @@ def get_sg_member_of(group_id):
group_obj = node_collection.one({'_id': ObjectId(group_id)})
# Fetch post_node of group
post_node_id_list = group_obj.post_node
if post_node_id_list:
# getting parent's sub group's member_of in a list
for each_sg in post_node_id_list:
each_sg_node = node_collection.one({'_id': ObjectId(each_sg)})
sg_member_of_list.extend(each_sg_node.member_of_names_list)
if group_obj.post_node:
post_node_id_list = group_obj.post_node
if post_node_id_list:
# getting parent's sub group's member_of in a list
for each_sg in post_node_id_list:
each_sg_node = node_collection.one({'_id': ObjectId(each_sg)})
sg_member_of_list.extend(each_sg_node.member_of_names_list)
return sg_member_of_list
def get_objectid_name(nodeid):
......
......@@ -25,10 +25,8 @@ urlpatterns = patterns('gnowsys_ndf.ndf.views.course',
url(r'^/change_order/$', 'change_order', name='change_order'),
url(r'^/delete_from_structure/$', 'delete_from_course_structure', name='delete_from_cs'),
url(r'^/delete/(?P<node_id>[\w-]+)$', 'delete_course', name='del_course'),
url(r'^/enroll/$', 'enroll_generic', name='course_enroll'),
url(r'^/remove/$', 'remove_resource_from_unit', name='remove_resource_from_unit'),
url(r'^/unitevents/$', 'find_units_of_subsection', name='find_units_of_subsection'),
url(r'^/thread_posts/$', 'get_res_disc_thread', name='get_res_disc_thread'),
url(r'^/add_course_file/$', 'add_course_file', name='add_course_file'),
url(r'^/enroll_to_course/$', 'enroll_to_course', name='enroll_to_course'),
)
......@@ -135,7 +135,7 @@ def collection_nav(request, group_id):
node_id = request.POST.get("node_id", '')
curr_node_id = request.POST.get("curr_node", '')
node_type = request.POST.get("nod_type", '')
template = "ndf/node_ajax_view.html"
breadcrumbs_list = []
curr_node_obj = node_collection.one({'_id': ObjectId(curr_node_id)})
if node_type == "Topic":
......@@ -146,7 +146,11 @@ def collection_nav(request, group_id):
breadcrumbs_list.append((str(prior._id), prior.name))
topic = ""
node_obj = node_collection.one({'_id': ObjectId(node_id)})
group_obj = node_collection.one({'_id': ObjectId(group_id)})
if "CourseEventGroup" in group_obj.member_of_names_list:
template = "ndf/res_node_ajax_view.html"
nav_list = request.POST.getlist("nav[]", '')
n_list = request.POST.get("nav", '')
......@@ -189,7 +193,7 @@ def collection_nav(request, group_id):
else:
breadcrumbs_list.remove(e)
# print "breadcrumbs_list: ",breadcrumbs_list,"\n"
return render_to_response('ndf/node_ajax_view.html',
return render_to_response(template,
{ 'node': node_obj,
'original_node':curr_node_obj,
'group_id': group_id,
......@@ -747,7 +751,7 @@ def get_inner_collection(collection_list, node):
inner_list = []
error_list = []
inner_list_append_temp=inner_list.append #a temp. variable which stores the lookup for append method
if node.collection_set and "CourseUnitEvent" not in node.member_of_names_list:
if node.collection_set:
for each in node.collection_set:
col_obj = node_collection.one({'_id': ObjectId(each)})
if col_obj:
......@@ -937,6 +941,8 @@ def add_page(request, group_id):
if name not in collection_list:
page_node = node_collection.collection.GSystem()
page_node.save(is_changed=get_node_common_fields(request, page_node, group_id, gst_page))
page_node.status = u"PUBLISHED"
page_node.save()
context_node.collection_set.append(page_node._id)
context_node.save()
response_dict["success"] = True
......
This diff is collapsed.
......@@ -892,10 +892,11 @@ def save_file(files,title, userid, group_id, content_org, tags, img_type = None,
# group id stored in group_set field
fileobj.group_set.append(group_object._id)
# if group is of EDITABLE_MODERATED, update group_set accordingly
if group_object.edit_policy ==