{% extends "ndf/base.html" %} {% load ndf_tags %} {% load i18n %} {% block title %}Edit Forum{% endblock %} {% block head %} {% endblock %} {% block meta_content %} {% blocktrans %}

Existing Discussion

Use a relevant topic for the Forum so that people interested can join the discussion.

{% endblocktrans %} {% endblock %} {% block body_content %}

{% trans "Edit forum: " %} {{forum.name}}


{% csrf_token %}
{% trans "Forum name:" %}


{% trans "Description:" %}
{% include "ndf/add_editor.html" with var_name="content_org" var_value=forum.content_org|default_if_none:"" node_id=forum.pk %}


{% comment %} {% endcomment %} {% endblock %} {% block script %} var old_forum_name; $("#node_search_form").parent().hide(); // method to provide autocomplete/intellisence of forum names // orgitdown $('#orgitdown').orgitdown(mySettings); // for datetimepicker // startDtInput.val().trim() // var startDtInput = $("#startDtInput"), // endDtInput = $("#endDtInput"); // startDtInput.datetimepicker({ // hourGrid: 6, // minuteGrid: 15, // onClose: function(dateText, inst) { // if (endDtInput.val() != '') { // var testStartDate = startDtInput.datetimepicker('getDate'); // var testEndDate = endDtInput.datetimepicker('getDate'); // if (testStartDate > testEndDate) // endDtInput.datetimepicker('setDate', testStartDate); // } // else { // endDtInput.val(dateText); // } // }, // onSelect: function (selectedDateTime){ // endDtInput.datetimepicker('option', 'minDate', startDtInput.datetimepicker('getDate') ); // } // }); // endDtInput.datetimepicker({ // hourGrid: 6, // minuteGrid: 15, // numberOfMonths: 2, // onClose: function(dateText, inst) { // if (startDtInput.val() != '') { // var testStartDate = startDtInput.datetimepicker('getDate'); // var testEndDate = endDtInput.datetimepicker('getDate'); // if (testStartDate > testEndDate) // startDtInput.datetimepicker('setDate', testEndDate); // } // else { // startDtInput.val(dateText); // } // }, // onSelect: function (selectedDateTime){ // startDtInput.datetimepicker('option', 'maxDate', endDtInput.datetimepicker('getDate') ); // } // }); // function checkDay(){ // console.log(this) // var testStartDate = startDtInput.datetimepicker('getDate'); // var testEndDate = endDtInput.datetimepicker('getDate'); // var d = new Date(); // var weekday = new Array(7); // weekday[0]= "Sunday"; // weekday[1] = "Monday"; // weekday[2] = "Tuesday"; // weekday[3] = "Wednesday"; // weekday[4] = "Thursday"; // weekday[5] = "Friday"; // weekday[6] = "Saturday"; // var n = weekday[d.getDay()]; // } $("#edit_forum").submit(function(event){ var name = $("#forum_name").val().trim().toLowerCase(); var nodes = {{nodes_list|safe}} if (name != old_forum_name && name != "") { if (nodes.indexOf(name) != -1) { $("#message").css("display", "block"); $("#message").text("Forum '"+ name +"' already exist. Please choose another name"); event.preventDefault(); } } else if (name == ""){ $("#message").css("display", "block"); $("#message").text("Forum name cannot be empty."); event.preventDefault(); } else { $("#message").css("display", "none"); } }); {% endblock %} {% block document_ready %} /* function saveforum(){ var name=$("#forum_name").val(); if (name=="" ) { alert("Please enter forum name"); } else { $("#forum").trigger('click'); } } var forumn=$("#forum_name").val() $("#forum_name").change(function(){ var name = $("#forum_name").val(); var nodes = $("#nodes_list").val(); if (name != forumn) { if (nodes.indexOf(name) > 0) { $("#message").css("display", "block"); $("#message").html("Name '"+ name +"' already exist .. Please choose another name"); $("#forum_name").val(""); } else { $("#message").css("display", "none"); } } }); */ old_forum_name = $("#forum_name").val() {% endblock %}