Skip to content
Open
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
82 changes: 56 additions & 26 deletions gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/add_asset.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ <h4 class="page-name">{% firstof asset_obj.altnames|truncatechars:25 asset_obj.
<div class="small-3 columns page-name">
{% include 'ndf/rating.html' with node=asset_obj %}
</div>

<form >
<!-- tags -->
<div class="small-10 columns left">
{% if asset_obj.tags %}
Expand Down Expand Up @@ -123,17 +123,17 @@ <h3 class="left overlay-title">&nbsp;
<label>
{% if edit or not asset_obj %}
{% if title == "raw material" or 'raw@material' in asset_obj.tags %}
{% trans "Resource Name" %}
{% trans "Resource Name" %} <h9 style="color: red;" id="req2"></h9>

{% elif title == "gallery" or 'asset@gallery' in asset_obj.tags %}
{% trans "Folder Name" %}
{% trans "Folder Name" %} <h9 style="color: red;" id="req2"></h9>

{% else %}
{% trans "Asset Name:" %} {% endif %}<h9 style="color: red;">*</h9>
<input type="text" placeholder="" class="required" id = "asset-name" name="asset_unique_name" value="{% if asset_obj %} {{asset_obj.name}}{% endif %}"/>

{% trans "Display Name:" %} <h9 style="color: red;">*</h9>
<input type="text" placeholder="" class="required" id = "asset-disp-name" name="asset_display_name" value="{% if asset_obj %} {{asset_obj.altnames}}{% endif %}"/>
{% trans "Asset Name:" %} {% endif %}<h9 style="color: red;">*</h9> <h9 style="color: red;" id="req2"></h9>
<input type="text" placeholder="" class="required" id = "asset-name" name="asset_unique_name" value="{% if asset_obj %} {{asset_obj.name}}{% endif %}" required/>
{% trans "Display Name:" %} <h9 style="color: red;">*</h9> <h9 style="color: red;" id="req3"></h9>
<input type="text" placeholder="" class="required" id = "asset-disp-name" name="asset_display_name" value="{% if asset_obj %} {{asset_obj.altnames}}{% endif %}" required />


{% endif %}
Expand All @@ -148,14 +148,14 @@ <h3 class="left overlay-title">&nbsp;
<label>

{% if title == "raw material" or 'raw@material' in asset_obj.tags %}
{% trans "Resource Description" %}
{% trans "Resource Description" %} <h9 style="color: red;" id="req1"></h9>

{% elif title == "gallery" or 'asset@gallery' in asset_obj.tags %}
{% trans "Folder Description" %}
{% trans "Folder Description" %} <h9 style="color: red;" id="req1"></h9>
{% else %}

{% trans "Asset description" %} {% endif %} <h9 style="color: red;">*</h9>
<textarea rows="4" cols="2" class="small-12 columns" placeholder="Enter Description" id="asset-descid" value=''>{% if asset_obj %} {{asset_obj.content|safe|striptags}}{% endif %}</textarea>
{% trans "Asset description" %} {% endif %} <h9 style="color: red;">* </h9 \t> <h9 style="color: red;" id="req1"></h9>
<textarea rows="4" cols="2" class="small-12 columns" placeholder="Enter Description" id="asset-descid" value='' required>{% if asset_obj %} {{asset_obj.content|safe|striptags}}{% endif %}</textarea>
</label>
</div>
</div>
Expand Down Expand Up @@ -230,8 +230,8 @@ <h3 class="left overlay-title">&nbsp;
</div>
</div>

<button type="button" class="button-save-new save-asset" data-asset_id='{{asset_obj.pk}}' style="margin-top: 9px;margin-right: -150px;">{% trans "Save" %}</button>

<button type="submit" class="button-save-new save-asset" data-asset_id='{{asset_obj.pk}}' style="margin-top: 9px;margin-right: -150px;">{% trans "Save" %}</button>
</form>
{% endif %}

<div class="asset-content-area"{% if not asset_obj %} style="display:none"{% endif %}>
Expand All @@ -243,7 +243,7 @@ <h3 class="left overlay-title">&nbsp;
<div class="row">
<div class="small-8 medium-6 large-6 columns">
<form class="dropzone" id ="docPost" enctype="multipart/form-data" method="post" action="{% url 'add_assetcontent' group_id %}" style="margin-left: -13px;width: 429px;" > {% csrf_token %}
<label>{% trans "Enter File Name" %} <h9 style="color: red;">*</h9>
<label>{% trans "Enter File Name" %} <h9 style="color: red;" id= "req">*</h9>
<input type="text" placeholder="Enter File name" class="required" id = "asset_content_name" name="name" style="padding-bottom: 10px;margin-bottom: 31px;"/>
</label>
<input type="file" id="docFile" class="asset_content_upload" placeholder="" name="filehive"/>
Expand Down Expand Up @@ -399,7 +399,7 @@ <h3 class="left overlay-title">&nbsp;

// $('.save-asset').attr('disabled',true);
$('#upload_asset').attr('disabled',true);

$('#asset_content_name').keyup(function(){
if($(this).val().length !=0 )
$('#upload_asset').attr('disabled', false);
Expand All @@ -408,27 +408,52 @@ <h3 class="left overlay-title">&nbsp;
})

$('#asset-name').keyup(function(){
if($(this).val().length !=0 && $('#asset-descid').val().length !=0 && $('#asset-disp-name').val().length !=0 )
//if($(this).val().length !=0 && $('#asset-descid').val().length !=0 && $('#asset-disp-name').val().length !=0 )
if($(this).val().length !=0 )
$('#req2').html("");
$('.save-asset').attr('disabled', false);
else
$('.save-asset').attr('disabled',true);
// else
// $('.save-asset').attr('disabled',true);
})

$('#asset-descid').keyup(function(){
if($(this).val().length !=0 && $('#asset-name').val().length !=0 && $('#asset-disp-name').val().length !=0)
// if($(this).val().length !=0 && $('#asset-name').val().length !=0 && $('#asset-disp-name').val().length !=0)
if($(this).val().length !=0 )
$('#req1').html("");
$('.save-asset').attr('disabled', false);
else
$('.save-asset').attr('disabled',true);
// else
// $('.save-asset').attr('disabled',true);
})
$('#asset-disp-name').keyup(function(){
if($(this).val().length !=0 && $('#asset-name').val().length !=0 && $('#asset-descid').val().length !=0 )
//if($(this).val().length !=0 && $('#asset-name').val().length !=0 && $('#asset-descid').val().length !=0 )
if($(this).val().length !=0 )
$('#req3').html("");
$('.save-asset').attr('disabled', false);
else
$('.save-asset').attr('disabled',true);
//else
// $('.save-asset').attr('disabled',true);
})
$( ".save-asset" ).click(function(event) {
updateAllTags();
coll_arr = []
if($('#asset-name').val().length==0)
{
$('#req2').html("* This is a required field");
}

else if ($('#asset-disp-name').val().length==0)
{
$('#req3').html(" This is a required field *");
}

else if($('#asset-descid').val().length==0)
{
$('#req1').html("* This is a required field");
}


// If x is Not a Number or less than one or greater than 10



$('#topic_list :selected').each(function(){
coll_arr.push($(this).val())
Expand Down Expand Up @@ -460,7 +485,11 @@ <h3 class="left overlay-title">&nbsp;
asset_disp_name = $("#asset-disp-name").val();
asset_description = $("#asset-descid").val();
var asset_id = $(this).attr('data-asset_id');
if (asset_name != '' && asset_description != ''){




if (asset_name != '' && asset_description != ''){
$.ajax({
type: "POST",
data:{
Expand Down Expand Up @@ -500,6 +529,7 @@ <h3 class="left overlay-title">&nbsp;
else{
event.preventDefault()
}


});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% extends "ndf/gbase.html" %}
{% load i18n %}
{% load ndf_tags %}


{% block title %} {% trans "Topic Map" %} -- {{curriculum_obj.name }}
{% endblock %}

Expand Down Expand Up @@ -76,6 +74,20 @@
<a href="" class="hyperlink-style">Title: {{curriculum_obj.name}} </a>
<a href="" class="hyperlink-info"> No. of Sections:{{curriculum_obj.collection_set|length}} </a>
<a href="" class="hyperlink-info"> Created on: {{curriculum_obj.created_at}}</a>
<div class="content reveal-modal graph-div " id="view-prerequisite-graph" data-reveal>
<a class="close-reveal-modal">&#215;</a>
{% include "ndf/graph_prerequisites.html" with node=curriculum_obj %}
</div>








<a href="#view-prerequisite-graph" data-reveal-id="view-prerequisite-graph" type="button" class="button-hollow-grey" style="margin-left: 0px;">
View Graph </a>
</div>
</div>
{% if is_gstaff or curriculum_obj.created_by == request.user.id %}
Expand Down Expand Up @@ -166,8 +178,8 @@ <h4 class="subsection-label-heading" style="margin-left: 20px" >Create new Sub-S
<p><span class="w3-tag w3-blue">New!</span></p>-->
<div class ="elements_for_editing" style="display:none">
<div class="tagsfor">
<ul> <h4 style="margin-left: 5px; ">Prequisites: </h4></ul>
{% comment %}
<ul> <h4 style="margin-left: 5px; ">Prerequisites: </h4></ul>
{% comment %}
<span id="tag1">

<ul><a href="#">molecule<i id="reveal-tag" onclick="$(this).closest('a').remove();return false;" class="fa fa-close"></i></a></ul>
Expand Down Expand Up @@ -227,11 +239,27 @@ <h4 class="subsection-label-heading" style="margin-left: 20px" >Create new Sub-S
<div> molecule , ion , proton</div>
</span>-->
</br>













<button type="button" class="button-hollow-grey edit_subsection" style="margin-left: 0px;">
Edit
</button>

<a href="#view-prerequisite-graph" data-reveal-id="view-prerequisite-graph" type="button" class="button-hollow-grey" style="margin-left: 0px;">
View Graph </a>


{% endif %}
</div>

Expand Down Expand Up @@ -265,7 +293,7 @@ <h4 class="subsection-label-heading" style="margin-left: 20px" >Create new Sub-S



<script type="text/javascript">
<script type="text/javascript">
// var baseTree = [{
// name: 'Add Branch',
// class: 'create_branch',
Expand Down Expand Up @@ -396,11 +424,15 @@ <h4 class="subsection-label-heading" style="margin-left: 20px" >Create new Sub-S
//$('.subsection-label-heading').append("<h6>Select Prequisite topics for : " +node.name+ "</h6>");

$('.subsection-label-view').append(" <div>Topic Name " + ": " +node.name+ "</div>" ).css("margin-left","0px" ,"color","#000000");

if(node.prerequisite_name){

$('.subsection-label-view ').append("<div>Prequisites Of " +node.name+ " are " + ":</div>").css('color','#A9A9A9');

$('.subsection-label-view').append("<div class='prerequisite_name'>" + node.prerequisite_name + " </div>").css('color','#A9A9A9');
}


$('.subsection-label-view ').append("<div class='prerequisite_name'>Prequisites Of " +node.name+ " are " + ":" + node.prerequisite_name + " </div>").css('color','#A9A9A9');
}


$('.elements_for_editing').css('display','block');
Expand Down Expand Up @@ -661,6 +693,7 @@ <h4 class="subsection-label-heading" style="margin-left: 20px" >Create new Sub-S
$(".section-edit-area").css('display', 'none')
$('.section-view-area').css('display', 'block')
$("option:selected").removeAttr("selected");

});

$('.edit_section').click(function(event) {
Expand All @@ -675,7 +708,11 @@ <h4 class="subsection-label-heading" style="margin-left: 20px" >Create new Sub-S

});


//$('.edit_graphsection').click(function(event) {
// $(".listing-row").html("");
// $('.prereqgraph').css('display' , 'block')

//});


function search_func(){
Expand Down
Loading