merging 9989 to the trunk

This commit is contained in:
tworrall 2012-08-03 14:29:56 +00:00
parent 083678f5b2
commit 6a63de6144
6 changed files with 79 additions and 26 deletions

View file

@ -31,7 +31,7 @@
float:right; float:right;
padding-right:5px; padding-right:5px;
} }
.sparqlHtmlContent { .contentSectionContainer {
background-color:#f9f9f9; background-color:#f9f9f9;
padding-left:6px; padding-left:6px;
padding-top:2px; padding-top:2px;
@ -86,9 +86,9 @@ p#templatePTag {
margin-top:8px; margin-top:8px;
margin-bottom:2px; margin-bottom:2px;
} }
p#checkboxPTag { p#menuCheckboxPTag {
margin-top:10px; margin-top:15px;
margin-bottom:0px; margin-bottom:3px;
} }
section.hideMenuSection { section.hideMenuSection {
margin-top:10px; margin-top:10px;
@ -97,6 +97,10 @@ section.hideMenuSection {
section.showMenuSection { section.showMenuSection {
margin-top:10px; margin-top:10px;
} }
section#addPageOne {
margin-bottom:-12px;
margin-top:8px;
}
input.doneWithContent { input.doneWithContent {
display: inline; display: inline;
padding: 5px 18px 7px; padding: 5px 18px 7px;
@ -118,6 +122,12 @@ input.doneWithContent {
margin-bottom:8px; margin-bottom:8px;
margin-top:0px; margin-top:0px;
} }
input#contentCheckbox {
margin-left:30px;
margin-top:5px;
vertical-align:top;
padding: 0;
}
span.deleteLinkContainer { span.deleteLinkContainer {
float:left; float:left;
margin-left:100px; margin-left:100px;

View file

@ -105,10 +105,11 @@ var pageManagementUtils = {
//From original menu management edit //From original menu management edit
this.defaultTemplateRadio = $('input.default-template'); this.defaultTemplateRadio = $('input.default-template');
this.customTemplateRadio = $('input.custom-template'); this.customTemplateRadio = $('input.custom-template');
this.selfContainedTemplateRadio = $('input.selfContained-template');
this.customTemplate = $('#custom-template'); this.customTemplate = $('#custom-template');
//In this version, these don't exist but we can consider this later //In this version, these don't exist but we can consider this later
// this.changeContentType = $('#changeContentType'); // this.changeContentType = $('#changeContentType');
this.selectContentType = $('#selectContentType'); // this.selectContentType = $('#selectContentType');
// this.existingContentType = $('#existingContentType'); // this.existingContentType = $('#existingContentType');
this.selectClassGroupDropdown = $('select#selectClassGroup'); this.selectClassGroupDropdown = $('select#selectClassGroup');
this.classesForClassGroup = $('section#classesInSelectedGroup'); this.classesForClassGroup = $('section#classesInSelectedGroup');
@ -141,7 +142,6 @@ var pageManagementUtils = {
this.sparqlQuerySection.hide(); this.sparqlQuerySection.hide();
this.fixedHTMLSection.hide(); this.fixedHTMLSection.hide();
this.classesForClassGroup.addClass('hidden'); this.classesForClassGroup.addClass('hidden');
// tlw72 this.moreContentButton.hide();
//left side components //left side components
//These depend on whether or not this is an existing item or not //These depend on whether or not this is an existing item or not
if(this.isAdd()) { if(this.isAdd()) {
@ -161,10 +161,20 @@ var pageManagementUtils = {
pageManagementUtils.customTemplate.addClass('hidden'); pageManagementUtils.customTemplate.addClass('hidden');
//Also clear custom template value so as not to submit it //Also clear custom template value so as not to submit it
pageManagementUtils.clearInputs(pageManagementUtils.customTemplate); pageManagementUtils.clearInputs(pageManagementUtils.customTemplate);
pageManagementUtils.rightSideDiv.show();
pageManagementUtils.disablePageSave();
}); });
this.customTemplateRadio.click( function() { this.customTemplateRadio.click( function() {
pageManagementUtils.customTemplate.removeClass('hidden'); pageManagementUtils.customTemplate.removeClass('hidden');
pageManagementUtils.rightSideDiv.show();
pageManagementUtils.disablePageSave();
});
this.selfContainedTemplateRadio.click( function() {
pageManagementUtils.customTemplate.removeClass('hidden');
pageManagementUtils.rightSideDiv.hide();
pageManagementUtils.enablePageSave();
}); });
this.isMenuCheckbox.click( function() { this.isMenuCheckbox.click( function() {
@ -190,6 +200,8 @@ var pageManagementUtils = {
pageManagementUtils.sparqlQuerySection.hide(); pageManagementUtils.sparqlQuerySection.hide();
pageManagementUtils.contentTypeSelectOptions.eq(0).attr('selected', 'selected'); pageManagementUtils.contentTypeSelectOptions.eq(0).attr('selected', 'selected');
pageManagementUtils.contentTypeSelect.focus(); pageManagementUtils.contentTypeSelect.focus();
pageManagementUtils.adjustSaveButtonHeight();
pageManagementUtils.checkSelfContainedRadio();
}); });
//replacing with menu management edit version which is extended with some of the logic below //replacing with menu management edit version which is extended with some of the logic below
this.selectClassGroupDropdown.change(function() { this.selectClassGroupDropdown.change(function() {
@ -242,16 +254,19 @@ var pageManagementUtils = {
//Form submission //Form submission
handleFormSubmission:function(event) { handleFormSubmission:function(event) {
var validationError = pageManagementUtils.validateMenuItemForm(); var validationError = pageManagementUtils.validateMenuItemForm();
//Add any errors from page content sections //Add any errors from page content sections if necessary
// Only validate the content sections if the self contained template section is NOT selected tlw72
if ( !pageManagementUtils.selfContainedTemplate.is(':checked') ) {
validationError += pageManagementUtils.validatePageContentSections(); validationError += pageManagementUtils.validatePageContentSections();
}
if (validationError == "") { if (validationError == "") {
//Check if menu label needs to be page title //Check if menu label needs to be page title
pageManagementUtils.checkMenuTitleSubmission(); pageManagementUtils.checkMenuTitleSubmission();
//Create the appropriate json objects //Create the appropriate json objects if necessary
pageManagementUtils.createPageContentForSubmission(); pageManagementUtils.createPageContentForSubmission();
pageManagementUtils.mapCustomTemplateName();
return true; return true;
} else{ } else{
$('#error-alert').removeClass('hidden'); $('#error-alert').removeClass('hidden');
$('#error-alert p').html(validationError); $('#error-alert p').html(validationError);
event.preventDefault(); event.preventDefault();
@ -278,6 +293,7 @@ var pageManagementUtils = {
pageManagementUtils.sparqlQuerySection.hide(); pageManagementUtils.sparqlQuerySection.hide();
pageManagementUtils.headerBar.text("Browse Class Group - "); pageManagementUtils.headerBar.text("Browse Class Group - ");
pageManagementUtils.headerBar.show(); pageManagementUtils.headerBar.show();
$('div#selfContainedDiv').hide();
} }
if ( _this.contentTypeSelect.val() == "fixedHtml" || _this.contentTypeSelect.val() == "sparqlQuery" ) { if ( _this.contentTypeSelect.val() == "fixedHtml" || _this.contentTypeSelect.val() == "sparqlQuery" ) {
pageManagementUtils.classGroupSection.hide(); pageManagementUtils.classGroupSection.hide();
@ -295,6 +311,7 @@ var pageManagementUtils = {
pageManagementUtils.headerBar.show(); pageManagementUtils.headerBar.show();
pageManagementUtils.classesForClassGroup.addClass('hidden'); pageManagementUtils.classesForClassGroup.addClass('hidden');
$('div#selfContainedDiv').hide();
} }
if ( _this.contentTypeSelect.val() == "" ) { if ( _this.contentTypeSelect.val() == "" ) {
pageManagementUtils.classGroupSection.hide(); pageManagementUtils.classGroupSection.hide();
@ -303,6 +320,7 @@ var pageManagementUtils = {
pageManagementUtils.classesForClassGroup.addClass('hidden'); pageManagementUtils.classesForClassGroup.addClass('hidden');
pageManagementUtils.headerBar.hide(); pageManagementUtils.headerBar.hide();
pageManagementUtils.headerBar.text(""); pageManagementUtils.headerBar.text("");
pageManagementUtils.checkSelfContainedRadio();
} }
//Collapse any divs for existing content if it exists //Collapse any divs for existing content if it exists
pageManagementUtils.collapseAllExistingContent(); pageManagementUtils.collapseAllExistingContent();
@ -337,7 +355,6 @@ var pageManagementUtils = {
}, },
clearInputs:function($el) { clearInputs:function($el) {
// jquery selector :input selects all input text area select and button elements // jquery selector :input selects all input text area select and button elements
// $el.find("input").val(""); cannot delete the value of the done button -- tlw72
$el.find("input").each( function() { $el.find("input").each( function() {
if ( $(this).attr('id') != "doneWithContent" ) { if ( $(this).attr('id') != "doneWithContent" ) {
$(this).val(""); $(this).val("");
@ -445,7 +462,7 @@ var pageManagementUtils = {
}); });
//remove button //remove button
$newRemoveLink = $innerDiv.find('a#remove' + counter); // tlw72 changed button to link $newRemoveLink = $innerDiv.find('a#remove' + counter);
//remove the content entirely //remove the content entirely
$newRemoveLink.click(function(event) { $newRemoveLink.click(function(event) {
//if content type of what is being deleted is browse class group, then //if content type of what is being deleted is browse class group, then
@ -457,6 +474,7 @@ var pageManagementUtils = {
//remove the section //remove the section
$innerDiv.parent("div").remove(); $innerDiv.parent("div").remove();
pageManagementUtils.adjustSaveButtonHeight(); pageManagementUtils.adjustSaveButtonHeight();
pageManagementUtils.checkSelfContainedRadio();
//Because this is now a link, have to prevent default action of navigating to link //Because this is now a link, have to prevent default action of navigating to link
event.preventDefault(); event.preventDefault();
}); });
@ -465,7 +483,7 @@ var pageManagementUtils = {
createCloneObject:function(contentType, counter) { createCloneObject:function(contentType, counter) {
var originalObjectPath = 'section#' + contentType; var originalObjectPath = 'section#' + contentType;
var $newContentObj = $(originalObjectPath).clone(); var $newContentObj = $(originalObjectPath).clone();
$newContentObj.removeClass("sparqlHtmlContent"); $newContentObj.removeClass("contentSectionContainer");
$newContentObj.addClass("pageContent"); $newContentObj.addClass("pageContent");
$newContentObj.attr("contentNumber", counter); $newContentObj.attr("contentNumber", counter);
//Save content type //Save content type
@ -794,6 +812,22 @@ var pageManagementUtils = {
}); });
} }
return validationErrorMsg; return validationErrorMsg;
},
//If the selfContained-template radio is checked, copy the custom template name to the hidden
//selfContainedTemplate input element. We need that for edit mode to select the correct radio button.
mapCustomTemplateName:function() {
if ( this.selfContainedTemplateRadio.is(':checked') ) {
$("input[name='selfContainedTemplate']").val($("input[name='customTemplate']").val());
}
},
//If any content is defined, keep the selContained radio button hidden
checkSelfContainedRadio:function() {
if ( pageManagementUtils.savedContentDivs.html().length == 0 ) {
$('div#selfContainedDiv').show();
}
} }
} }

View file

@ -17,7 +17,7 @@
<#--HTML Portion--> <#--HTML Portion-->
<section id="browseClassGroup" style="background-color:#f9f9f9;padding-left:6px;padding-top:2px;border-width:1px;border-style:solid;border-color:#ccc;"> <section id="browseClassGroup" class="contentSectionContainer">
<section id="selectContentType" name="selectContentType" ${selectClassGroupStyle} role="region"> <section id="selectContentType" name="selectContentType" ${selectClassGroupStyle} role="region">

View file

@ -1,7 +1,7 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> <#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#--This contains the template for the fixed HTML content type that is to be cloned and used in page management--> <#--This contains the template for the fixed HTML content type that is to be cloned and used in page management-->
<section id="fixedHtml" class="sparqlHtmlContent"> <section id="fixedHtml" class="contentSectionContainer">
<label id="fixedHTMLVariableLabel" for="fixedHTMLVariable">Variable Name<span class="requiredHint"> *</span></label> <label id="fixedHTMLVariableLabel" for="fixedHTMLVariable">Variable Name<span class="requiredHint"> *</span></label>
<input type="text" name="saveToVar" size="20" value="" id="fixedHTMLSaveToVar" role="input" /> <input type="text" name="saveToVar" size="20" value="" id="fixedHTMLSaveToVar" role="input" />
<label id="fixedHTMLValueLabel" for="fixedHTMLValue">Enter fixed HTML here<span id="fixedHTMLValueSpan"></span><span class="requiredHint"> *</span></label> <label id="fixedHTMLValueLabel" for="fixedHTMLValue">Enter fixed HTML here<span id="fixedHTMLValueSpan"></span><span class="requiredHint"> *</span></label>

View file

@ -1,6 +1,6 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> <#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#--This contains the template for the Sparql Query content type that is to be cloned and used in page management--> <#--This contains the template for the Sparql Query content type that is to be cloned and used in page management-->
<section id="sparqlQuery" class="sparqlHtmlContent"> <section id="sparqlQuery" class="contentSectionContainer">
<label id="variableLabel" for="variable">Variable Name<span class="requiredHint"> *</span></label> <label id="variableLabel" for="variable">Variable Name<span class="requiredHint"> *</span></label>
<input type="text" name="saveToVar" size="20" value="" id="saveToVar" role="input" /> <input type="text" name="saveToVar" size="20" value="" id="saveToVar" role="input" />
<#--Hiding query model for now--> <#--Hiding query model for now-->

View file

@ -25,10 +25,15 @@
<#assign menuItem = lvf.getFormFieldValue(editSubmission, editConfiguration, "menuItem")/> <#assign menuItem = lvf.getFormFieldValue(editSubmission, editConfiguration, "menuItem")/>
<#assign menuLinkText = lvf.getFormFieldValue(editSubmission, editConfiguration, "menuLinkText")/> <#assign menuLinkText = lvf.getFormFieldValue(editSubmission, editConfiguration, "menuLinkText")/>
<#assign customTemplate = lvf.getFormFieldValue(editSubmission, editConfiguration, "customTemplate")/> <#assign customTemplate = lvf.getFormFieldValue(editSubmission, editConfiguration, "customTemplate")/>
<#assign selfContainedTemplate = lvf.getFormFieldValue(editSubmission, editConfiguration, "selfContainedTemplate")/>
<#assign pageHeading = "Edit Page" /> <#assign pageHeading = "Edit Page" />
<#if customTemplate?has_content> <#if customTemplate?has_content>
<#if selfContainedTemplate?has_content>
<#assign selectedTemplateType = "selfContained" />
<#else>
<#assign selectedTemplateType = "custom" /> <#assign selectedTemplateType = "custom" />
</#if> </#if>
</#if>
<#assign editMenuPosition = lvf.getFormFieldValue(editSubmission, editConfiguration, "menuPosition")/> <#assign editMenuPosition = lvf.getFormFieldValue(editSubmission, editConfiguration, "menuPosition")/>
<#--if menu position exists for a menu item, then use that, otherwise use the highest available menu position number from page data--> <#--if menu position exists for a menu item, then use that, otherwise use the highest available menu position number from page data-->
<#if editMenuPosition?has_content && editMenuPosition != ""> <#if editMenuPosition?has_content && editMenuPosition != "">
@ -64,13 +69,13 @@
<section id="floatRight"> <section id="floatRight">
<div id="rightSide"> <div id="rightSide">
<section id="addPageOne" role="region" > <section id="addPageOne" role="region" >
<label for="last-name">Content Type<span class="requiredHint"> *</span></label> <label for="contentType">Content Type<span class="requiredHint"> *</span></label>
<select id="typeSelect" name="typeSelect" > <select id="typeSelect" name="typeSelect" >
<option value="" selected="selected">Select one</option> <option value="" selected="selected">Select a type</option>
<option value="browseClassGroup">Browse Class Group</option> <option value="browseClassGroup">Browse Class Group</option>
<option value="fixedHtml">Fixed HTML</option> <option value="fixedHtml">Fixed HTML</option>
<option value="sparqlQuery">SPARQL Query Results</option> <option value="sparqlQuery">SPARQL Query Results</option>
</select>&nbsp;<span class="note">Add one or more content types</span> </select>&nbsp;<span class="note">Add one or more types</span>
</section> </section>
<section id="contentDivs"></section> <section id="contentDivs"></section>
<section id="headerBar" > <section id="headerBar" >
@ -95,11 +100,15 @@
<label class="inline" for="default"> Default</label> <label class="inline" for="default"> Default</label>
<br /> <br />
<input type="radio" name="selectedTemplate" class="custom-template" value="custom" <#if selectedTemplateType = "custom">checked="checked"</#if> role="input" /> <input type="radio" name="selectedTemplate" class="custom-template" value="custom" <#if selectedTemplateType = "custom">checked="checked"</#if> role="input" />
<label class="inline" for="custom"> Custom template</label> <label class="inline" for="custom"> Custom template requiring content</label>
<br /><div id="selfContainedDiv">
<input type="radio" name="selectedTemplate" class="selfContained-template" value="selfContained" <#if selectedTemplateType = "selfContained">checked="checked"</#if> role="input" />
<label class="inline" for="selfContained"> Custom template containing all content</label></div>
<section id="custom-template" <#if selectedTemplateType != 'custom'>class="hidden" </#if>role="region"> <section id="custom-template" <#if selectedTemplateType != 'custom'>class="hidden" </#if>role="region">
<input type="text" name="customTemplate" value="${customTemplate!''}" size="33" role="input" /><span class="requiredHint"> *</span> <input type="text" name="customTemplate" value="${customTemplate!''}" size="33" role="input" /><span class="requiredHint"> *</span>
<input type="hidden" name="selfContainedTemplate" value="${selfContainedTemplate!''}"/>
</section> </section>
<p id="checkboxPTag"><input id="menuCheckbox" type="checkbox" name="menuCheckbox" <p id="menuCheckboxPTag"><input id="menuCheckbox" type="checkbox" name="menuCheckbox"
<#if (menuAction="Edit" && menuItem?has_content) || (menuAction="Add" && addMenuItem = "true")>checked="checked"</#if> <#if (menuAction="Edit" && menuItem?has_content) || (menuAction="Add" && addMenuItem = "true")>checked="checked"</#if>
> This is a menu page</p> > This is a menu page</p>
<section id="menu" role="region" <section id="menu" role="region"