merging 9989 to the trunk
This commit is contained in:
parent
083678f5b2
commit
6a63de6144
6 changed files with 79 additions and 26 deletions
|
@ -31,7 +31,7 @@
|
|||
float:right;
|
||||
padding-right:5px;
|
||||
}
|
||||
.sparqlHtmlContent {
|
||||
.contentSectionContainer {
|
||||
background-color:#f9f9f9;
|
||||
padding-left:6px;
|
||||
padding-top:2px;
|
||||
|
@ -86,9 +86,9 @@ p#templatePTag {
|
|||
margin-top:8px;
|
||||
margin-bottom:2px;
|
||||
}
|
||||
p#checkboxPTag {
|
||||
margin-top:10px;
|
||||
margin-bottom:0px;
|
||||
p#menuCheckboxPTag {
|
||||
margin-top:15px;
|
||||
margin-bottom:3px;
|
||||
}
|
||||
section.hideMenuSection {
|
||||
margin-top:10px;
|
||||
|
@ -97,6 +97,10 @@ section.hideMenuSection {
|
|||
section.showMenuSection {
|
||||
margin-top:10px;
|
||||
}
|
||||
section#addPageOne {
|
||||
margin-bottom:-12px;
|
||||
margin-top:8px;
|
||||
}
|
||||
input.doneWithContent {
|
||||
display: inline;
|
||||
padding: 5px 18px 7px;
|
||||
|
@ -118,6 +122,12 @@ input.doneWithContent {
|
|||
margin-bottom:8px;
|
||||
margin-top:0px;
|
||||
}
|
||||
input#contentCheckbox {
|
||||
margin-left:30px;
|
||||
margin-top:5px;
|
||||
vertical-align:top;
|
||||
padding: 0;
|
||||
}
|
||||
span.deleteLinkContainer {
|
||||
float:left;
|
||||
margin-left:100px;
|
||||
|
|
|
@ -105,10 +105,11 @@ var pageManagementUtils = {
|
|||
//From original menu management edit
|
||||
this.defaultTemplateRadio = $('input.default-template');
|
||||
this.customTemplateRadio = $('input.custom-template');
|
||||
this.selfContainedTemplateRadio = $('input.selfContained-template');
|
||||
this.customTemplate = $('#custom-template');
|
||||
//In this version, these don't exist but we can consider this later
|
||||
// this.changeContentType = $('#changeContentType');
|
||||
this.selectContentType = $('#selectContentType');
|
||||
// this.selectContentType = $('#selectContentType');
|
||||
// this.existingContentType = $('#existingContentType');
|
||||
this.selectClassGroupDropdown = $('select#selectClassGroup');
|
||||
this.classesForClassGroup = $('section#classesInSelectedGroup');
|
||||
|
@ -141,7 +142,6 @@ var pageManagementUtils = {
|
|||
this.sparqlQuerySection.hide();
|
||||
this.fixedHTMLSection.hide();
|
||||
this.classesForClassGroup.addClass('hidden');
|
||||
// tlw72 this.moreContentButton.hide();
|
||||
//left side components
|
||||
//These depend on whether or not this is an existing item or not
|
||||
if(this.isAdd()) {
|
||||
|
@ -161,10 +161,20 @@ var pageManagementUtils = {
|
|||
pageManagementUtils.customTemplate.addClass('hidden');
|
||||
//Also clear custom template value so as not to submit it
|
||||
pageManagementUtils.clearInputs(pageManagementUtils.customTemplate);
|
||||
pageManagementUtils.rightSideDiv.show();
|
||||
pageManagementUtils.disablePageSave();
|
||||
});
|
||||
|
||||
this.customTemplateRadio.click( function() {
|
||||
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() {
|
||||
|
@ -190,6 +200,8 @@ var pageManagementUtils = {
|
|||
pageManagementUtils.sparqlQuerySection.hide();
|
||||
pageManagementUtils.contentTypeSelectOptions.eq(0).attr('selected', 'selected');
|
||||
pageManagementUtils.contentTypeSelect.focus();
|
||||
pageManagementUtils.adjustSaveButtonHeight();
|
||||
pageManagementUtils.checkSelfContainedRadio();
|
||||
});
|
||||
//replacing with menu management edit version which is extended with some of the logic below
|
||||
this.selectClassGroupDropdown.change(function() {
|
||||
|
@ -242,16 +254,19 @@ var pageManagementUtils = {
|
|||
//Form submission
|
||||
handleFormSubmission:function(event) {
|
||||
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();
|
||||
}
|
||||
if (validationError == "") {
|
||||
//Check if menu label needs to be page title
|
||||
pageManagementUtils.checkMenuTitleSubmission();
|
||||
//Create the appropriate json objects
|
||||
//Create the appropriate json objects if necessary
|
||||
pageManagementUtils.createPageContentForSubmission();
|
||||
pageManagementUtils.mapCustomTemplateName();
|
||||
return true;
|
||||
} else{
|
||||
|
||||
$('#error-alert').removeClass('hidden');
|
||||
$('#error-alert p').html(validationError);
|
||||
event.preventDefault();
|
||||
|
@ -278,6 +293,7 @@ var pageManagementUtils = {
|
|||
pageManagementUtils.sparqlQuerySection.hide();
|
||||
pageManagementUtils.headerBar.text("Browse Class Group - ");
|
||||
pageManagementUtils.headerBar.show();
|
||||
$('div#selfContainedDiv').hide();
|
||||
}
|
||||
if ( _this.contentTypeSelect.val() == "fixedHtml" || _this.contentTypeSelect.val() == "sparqlQuery" ) {
|
||||
pageManagementUtils.classGroupSection.hide();
|
||||
|
@ -295,6 +311,7 @@ var pageManagementUtils = {
|
|||
|
||||
pageManagementUtils.headerBar.show();
|
||||
pageManagementUtils.classesForClassGroup.addClass('hidden');
|
||||
$('div#selfContainedDiv').hide();
|
||||
}
|
||||
if ( _this.contentTypeSelect.val() == "" ) {
|
||||
pageManagementUtils.classGroupSection.hide();
|
||||
|
@ -303,6 +320,7 @@ var pageManagementUtils = {
|
|||
pageManagementUtils.classesForClassGroup.addClass('hidden');
|
||||
pageManagementUtils.headerBar.hide();
|
||||
pageManagementUtils.headerBar.text("");
|
||||
pageManagementUtils.checkSelfContainedRadio();
|
||||
}
|
||||
//Collapse any divs for existing content if it exists
|
||||
pageManagementUtils.collapseAllExistingContent();
|
||||
|
@ -337,7 +355,6 @@ var pageManagementUtils = {
|
|||
},
|
||||
clearInputs:function($el) {
|
||||
// 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() {
|
||||
if ( $(this).attr('id') != "doneWithContent" ) {
|
||||
$(this).val("");
|
||||
|
@ -445,7 +462,7 @@ var pageManagementUtils = {
|
|||
});
|
||||
|
||||
//remove button
|
||||
$newRemoveLink = $innerDiv.find('a#remove' + counter); // tlw72 changed button to link
|
||||
$newRemoveLink = $innerDiv.find('a#remove' + counter);
|
||||
//remove the content entirely
|
||||
$newRemoveLink.click(function(event) {
|
||||
//if content type of what is being deleted is browse class group, then
|
||||
|
@ -457,6 +474,7 @@ var pageManagementUtils = {
|
|||
//remove the section
|
||||
$innerDiv.parent("div").remove();
|
||||
pageManagementUtils.adjustSaveButtonHeight();
|
||||
pageManagementUtils.checkSelfContainedRadio();
|
||||
//Because this is now a link, have to prevent default action of navigating to link
|
||||
event.preventDefault();
|
||||
});
|
||||
|
@ -465,7 +483,7 @@ var pageManagementUtils = {
|
|||
createCloneObject:function(contentType, counter) {
|
||||
var originalObjectPath = 'section#' + contentType;
|
||||
var $newContentObj = $(originalObjectPath).clone();
|
||||
$newContentObj.removeClass("sparqlHtmlContent");
|
||||
$newContentObj.removeClass("contentSectionContainer");
|
||||
$newContentObj.addClass("pageContent");
|
||||
$newContentObj.attr("contentNumber", counter);
|
||||
//Save content type
|
||||
|
@ -794,6 +812,22 @@ var pageManagementUtils = {
|
|||
});
|
||||
}
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
|
||||
<#--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">
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<#-- $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-->
|
||||
|
||||
<section id="fixedHtml" class="sparqlHtmlContent">
|
||||
<section id="fixedHtml" class="contentSectionContainer">
|
||||
<label id="fixedHTMLVariableLabel" for="fixedHTMLVariable">Variable Name<span class="requiredHint"> *</span></label>
|
||||
<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>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<#-- $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-->
|
||||
<section id="sparqlQuery" class="sparqlHtmlContent">
|
||||
<section id="sparqlQuery" class="contentSectionContainer">
|
||||
<label id="variableLabel" for="variable">Variable Name<span class="requiredHint"> *</span></label>
|
||||
<input type="text" name="saveToVar" size="20" value="" id="saveToVar" role="input" />
|
||||
<#--Hiding query model for now-->
|
||||
|
|
|
@ -25,10 +25,15 @@
|
|||
<#assign menuItem = lvf.getFormFieldValue(editSubmission, editConfiguration, "menuItem")/>
|
||||
<#assign menuLinkText = lvf.getFormFieldValue(editSubmission, editConfiguration, "menuLinkText")/>
|
||||
<#assign customTemplate = lvf.getFormFieldValue(editSubmission, editConfiguration, "customTemplate")/>
|
||||
<#assign selfContainedTemplate = lvf.getFormFieldValue(editSubmission, editConfiguration, "selfContainedTemplate")/>
|
||||
<#assign pageHeading = "Edit Page" />
|
||||
<#if customTemplate?has_content>
|
||||
<#if selfContainedTemplate?has_content>
|
||||
<#assign selectedTemplateType = "selfContained" />
|
||||
<#else>
|
||||
<#assign selectedTemplateType = "custom" />
|
||||
</#if>
|
||||
</#if>
|
||||
<#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 editMenuPosition?has_content && editMenuPosition != "">
|
||||
|
@ -64,13 +69,13 @@
|
|||
<section id="floatRight">
|
||||
<div id="rightSide">
|
||||
<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" >
|
||||
<option value="" selected="selected">Select one</option>
|
||||
<option value="" selected="selected">Select a type</option>
|
||||
<option value="browseClassGroup">Browse Class Group</option>
|
||||
<option value="fixedHtml">Fixed HTML</option>
|
||||
<option value="sparqlQuery">SPARQL Query Results</option>
|
||||
</select> <span class="note">Add one or more content types</span>
|
||||
</select> <span class="note">Add one or more types</span>
|
||||
</section>
|
||||
<section id="contentDivs"></section>
|
||||
<section id="headerBar" >
|
||||
|
@ -95,11 +100,15 @@
|
|||
<label class="inline" for="default"> Default</label>
|
||||
<br />
|
||||
<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">
|
||||
<input type="text" name="customTemplate" value="${customTemplate!''}" size="33" role="input" /><span class="requiredHint"> *</span>
|
||||
<input type="hidden" name="selfContainedTemplate" value="${selfContainedTemplate!''}"/>
|
||||
</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>
|
||||
> This is a menu page</p>
|
||||
<section id="menu" role="region"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue