page managemnet changes

This commit is contained in:
tworrall 2012-06-24 21:23:12 +00:00
parent 544839906e
commit 54941a201b
8 changed files with 82 additions and 38 deletions

View file

@ -1,12 +1,9 @@
/* $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$ */
.pageContent { .pageContent {
"background-color":"", padding-left:6px;
"padding-left":"", padding-top:2px;
"padding-top":"", }
"border-width":"",
"border-style":"",
"border-color":"#ccc"}
.pageContentContainer { .pageContentContainer {
background-color:#f5f5f5; background-color:#f5f5f5;
@ -18,6 +15,7 @@
.pageContentTypeLabel { .pageContentTypeLabel {
padding-left:6px; padding-left:6px;
color:#064D68;
} }
.pageContentWrapper { .pageContentWrapper {
@ -33,7 +31,14 @@
float:right; float:right;
padding-right:5px; padding-right:5px;
} }
.sparqlHtmlContent {
background-color:#f9f9f9;
padding-left:6px;
padding-top:2px;
border-width:1px;
border-style:solid;
border-color:#ccc;
}
.arrow { .arrow {
width:13px; width:13px;
height:9px; height:9px;
@ -51,6 +56,7 @@
.deleteButton { .deleteButton {
margin-bottom:5px; margin-bottom:5px;
} }
section#floatRight { section#floatRight {
margin-top:0px; margin-top:0px;
float:right; float:right;
@ -68,6 +74,7 @@ section#headerBar {
border-style:solid; border-style:solid;
border-bottom-width:0px; border-bottom-width:0px;
padding-left:6px; padding-left:6px;
color:#064D68;
} }
input#moreContent { input#moreContent {
margin-top:8px; margin-top:8px;
@ -90,4 +97,29 @@ section.hideMenuSection {
section.showMenuSection { section.showMenuSection {
margin-top:10px; margin-top:10px;
} }
input.doneWithContent {
display: inline;
padding: 5px 18px 7px;
color: #fff;
text-decoration: none;
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
position: relative;
cursor: pointer;
border: 0;
margin: 0;
background-color: #398aac;
color: #fff;
font-size: 14px;
font-weight: normal;
line-height: 1;
margin-right: .6em;
margin-bottom:8px;
margin-top:0px;
}
span.deleteLinkContainer {
float:left;
margin-left:100px;
margin-top:-36px;
}

View file

@ -111,7 +111,7 @@ var pageManagementUtils = {
this.displayInternalMessage = $('#internal-class label em'); this.displayInternalMessage = $('#internal-class label em');
this.pageContentSubmissionInputs = $("#pageContentSubmissionInputs"); this.pageContentSubmissionInputs = $("#pageContentSubmissionInputs");
this.headerBar = $("section#headerBar"); this.headerBar = $("section#headerBar");
this.moreContentButton = $("input#moreContent"); this.doneButton = $("input#doneWithContent");
this.isMenuCheckbox = $("input#menuCheckbox"); this.isMenuCheckbox = $("input#menuCheckbox");
this.menuSection = $("section#menu"); this.menuSection = $("section#menu");
this.submitButton = $("input#submit"); this.submitButton = $("input#submit");
@ -132,7 +132,7 @@ var pageManagementUtils = {
this.sparqlQuerySection.hide(); this.sparqlQuerySection.hide();
this.fixedHTMLSection.hide(); this.fixedHTMLSection.hide();
this.classesForClassGroup.addClass('hidden'); this.classesForClassGroup.addClass('hidden');
this.moreContentButton.hide(); // 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()) {
@ -169,7 +169,7 @@ var pageManagementUtils = {
//Collapses the current content and creates a new section of content //Collapses the current content and creates a new section of content
//Resets the content to be cloned to default settings //Resets the content to be cloned to default settings
this.moreContentButton.click( function() { this.doneButton.click( function() {
var selectedType = pageManagementUtils.contentTypeSelect.val(); var selectedType = pageManagementUtils.contentTypeSelect.val();
var selectedTypeText = $("#typeSelect option:selected").text(); var selectedTypeText = $("#typeSelect option:selected").text();
@ -179,7 +179,6 @@ var pageManagementUtils = {
pageManagementUtils.sparqlQuerySection.hide(); pageManagementUtils.sparqlQuerySection.hide();
//Reset main content type drop-down //Reset main content type drop-down
pageManagementUtils.contentTypeSelectOptions.eq(0).attr('selected', 'selected'); pageManagementUtils.contentTypeSelectOptions.eq(0).attr('selected', 'selected');
pageManagementUtils.moreContentButton.hide();
if ( pageManagementUtils.leftSideDiv.css("height") != undefined ) { if ( pageManagementUtils.leftSideDiv.css("height") != undefined ) {
pageManagementUtils.leftSideDiv.css("height",""); pageManagementUtils.leftSideDiv.css("height","");
if ( pageManagementUtils.leftSideDiv.height() < pageManagementUtils.rightSideDiv.height() ) { if ( pageManagementUtils.leftSideDiv.height() < pageManagementUtils.rightSideDiv.height() ) {
@ -238,7 +237,7 @@ var pageManagementUtils = {
pageManagementUtils.classGroupSection.show(); pageManagementUtils.classGroupSection.show();
pageManagementUtils.fixedHTMLSection.hide(); pageManagementUtils.fixedHTMLSection.hide();
pageManagementUtils.sparqlQuerySection.hide(); pageManagementUtils.sparqlQuerySection.hide();
pageManagementUtils.moreContentButton.hide(); // tlw72 pageManagementUtils.moreContentButton.hide();
pageManagementUtils.headerBar.text("Browse Class Group - "); pageManagementUtils.headerBar.text("Browse Class Group - ");
pageManagementUtils.headerBar.show(); pageManagementUtils.headerBar.show();
} }
@ -258,13 +257,13 @@ var pageManagementUtils = {
pageManagementUtils.headerBar.show(); pageManagementUtils.headerBar.show();
pageManagementUtils.classesForClassGroup.addClass('hidden'); pageManagementUtils.classesForClassGroup.addClass('hidden');
pageManagementUtils.moreContentButton.show(); // tlw72 pageManagementUtils.moreContentButton.show();
} }
if ( _this.contentTypeSelect.val() == "" ) { if ( _this.contentTypeSelect.val() == "" ) {
pageManagementUtils.classGroupSection.hide(); pageManagementUtils.classGroupSection.hide();
pageManagementUtils.fixedHTMLSection.hide(); pageManagementUtils.fixedHTMLSection.hide();
pageManagementUtils.sparqlQuerySection.hide(); pageManagementUtils.sparqlQuerySection.hide();
pageManagementUtils.moreContentButton.hide(); // tlw72 pageManagementUtils.moreContentButton.hide();
pageManagementUtils.classesForClassGroup.addClass('hidden'); pageManagementUtils.classesForClassGroup.addClass('hidden');
pageManagementUtils.headerBar.hide(); pageManagementUtils.headerBar.hide();
pageManagementUtils.headerBar.text(""); pageManagementUtils.headerBar.text("");
@ -291,8 +290,13 @@ 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(""); // $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("");
}
});
$el.find("textarea").val(""); $el.find("textarea").val("");
//resetting class group section as well so selection is reset if type changes //resetting class group section as well so selection is reset if type changes
$el.find("select option:eq(0)").attr("selected", "selected"); $el.find("select option:eq(0)").attr("selected", "selected");
@ -350,8 +354,8 @@ var pageManagementUtils = {
html: "<span class='pageContentTypeLabel'>" + contentTypeLabel + " - " + varOrClass html: "<span class='pageContentTypeLabel'>" + contentTypeLabel + " - " + varOrClass
+ "</span><span id='clickable" + counter + "</span><span id='clickable" + counter
+ "' class='pageContentExpand'><div class='arrow expandArrow'></div></span><div id='innerContainer" + counter + "' class='pageContentExpand'><div class='arrow expandArrow'></div></span><div id='innerContainer" + counter
+ "' class='pageContentWrapper'><input id='remove" + counter + "' class='pageContentWrapper'><span class='deleteLinkContainer'>&nbsp;or&nbsp;<a id='remove" + counter // changed button to a link
+ "' type='button' class='delete' value='Delete' class='deleteButton' /></div>" + "' href='' >delete</a></span></div>"
}); });
//Hide inner div //Hide inner div
var $innerDiv = $newDivContainer.children('div#innerContainer' + counter); var $innerDiv = $newDivContainer.children('div#innerContainer' + counter);
@ -366,6 +370,7 @@ var pageManagementUtils = {
bindClonedContentContainerEvents:function($newDivContainer, counter) { bindClonedContentContainerEvents:function($newDivContainer, counter) {
var $clickableSpan = $newDivContainer.children('span#clickable' + counter); var $clickableSpan = $newDivContainer.children('span#clickable' + counter);
var $innerDiv = $newDivContainer.children('div#innerContainer' + counter); var $innerDiv = $newDivContainer.children('div#innerContainer' + counter);
//Expand/collapse toggle //Expand/collapse toggle
$clickableSpan.click(function() { $clickableSpan.click(function() {
if ( $innerDiv.is(':visible') ) { if ( $innerDiv.is(':visible') ) {
@ -385,9 +390,9 @@ var pageManagementUtils = {
window.setTimeout('pageManagementUtils.adjustSaveButtonHeight()', 223); window.setTimeout('pageManagementUtils.adjustSaveButtonHeight()', 223);
}); });
//remove button //remove button
$newRemoveButton = $innerDiv.find('input#remove' + counter); $newRemoveLink = $innerDiv.find('a#remove' + counter); // tlw72 changed button to link
//remove the content entirely //remove the content entirely
$newRemoveButton.click(function() { $newRemoveLink.click(function() {
//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
//add browse classgroup back to set of options //add browse classgroup back to set of options
var contentType = $innerDiv.find("section.pageContent").attr("contentType"); var contentType = $innerDiv.find("section.pageContent").attr("contentType");
@ -462,12 +467,10 @@ var pageManagementUtils = {
if (pageManagementUtils.selectClassGroupDropdown.val() == "" ) { if (pageManagementUtils.selectClassGroupDropdown.val() == "" ) {
pageManagementUtils.classesForClassGroup.addClass('hidden'); pageManagementUtils.classesForClassGroup.addClass('hidden');
$("div#leftSide").css("height",""); $("div#leftSide").css("height","");
pageManagementUtils.moreContentButton.hide();
} }
else { else {
pageManagementUtils.classesForClassGroup.removeClass('hidden'); pageManagementUtils.classesForClassGroup.removeClass('hidden');
pageManagementUtils.moreContentButton.show();
if ( $("div#leftSide").height() < $("div#rightSide").height() ) { if ( $("div#leftSide").height() < $("div#rightSide").height() ) {
$("div#leftSide").css("height",$("div#rightSide").height() + "px"); $("div#leftSide").css("height",$("div#rightSide").height() + "px");
} }
@ -586,6 +589,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.addClass("pageContent"); $newContentObj.addClass("pageContent");
$newContentObj.attr("contentNumber", counter); $newContentObj.attr("contentNumber", counter);
//Save content type //Save content type
@ -716,7 +720,7 @@ var pageManagementUtils = {
return validationErrorMsg; return validationErrorMsg;
} }
}; }
$(document).ready(function() { $(document).ready(function() {
pageManagementUtils.onLoad(); pageManagementUtils.onLoad();

View file

@ -25,8 +25,14 @@
<#-- Link to add a new menu item --> <#-- Link to add a new menu item -->
<#if editable> <#if editable>
<#if addNewMenuItemUrl?has_content> <#if addNewMenuItemUrl?has_content>
<p><a class="add-hasElement green button" href="${addNewMenuItemUrl}" title="Add new menu item">Add menu item</a></p> <form id="pageListForm" action="${urls.base}/editRequestDispatch" method="get">
<input type="hidden" name="typeOfNew" value="http://vitro.mannlib.cornell.edu/ontologies/display/1.1#Page">
<input type="hidden" name="switchToDisplayModel" value="1">
<input type="hidden" name="editForm" value="edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.ManagePageGenerator" role="input">
<input id="submit" value="Add new menu page" role="button" type="submit" >
</form>
<br />
<p class="note">Refresh page after reordering menu items</p> <p class="note">Refresh page after reordering menu items</p>
</#if> </#if>
</#if> </#if>

View file

@ -44,7 +44,7 @@
</#if> </#if>
</td> </td>
<td> <td>
<a href="${urls.base}/individual?uri=${pagex.listedPageUri?url}&switchToDisplayModel=1"><img src="${urls.images!}/profile-page-icon.png" title="view the profile properties for this page" alt="profile page"></a> <a href="${urls.base}/individual?uri=${pagex.listedPageUri?url}&switchToDisplayModel=1"><img src="${urls.images!}/profile-page-icon.png" title="view the individual profile for this page" alt="profile page"></a>
&nbsp;&nbsp; &nbsp;&nbsp;
<#if !pagex.listedPageCannotDeletePage?has_content > <#if !pagex.listedPageCannotDeletePage?has_content >
<a cmd="deletePage" pageTitle=" ${pagex.listedPageTitle!}" href="${urls.base}/deletePageController?pageURI=${pagex.listedPageUri?url}"><img src="${urls.images!}/individual/deleteIcon.gif" title="delete this page" alt="delete"></a> <a cmd="deletePage" pageTitle=" ${pagex.listedPageTitle!}" href="${urls.base}/deletePageController?pageURI=${pagex.listedPageUri?url}"><img src="${urls.images!}/individual/deleteIcon.gif" title="delete this page" alt="delete"></a>

View file

@ -50,7 +50,8 @@
<span class="ui-icon-sortable"></span> <span class="ui-icon-sortable"></span>
</li> </li>
</#list> </#list>
</ul> </ul><br />
<input type="button" id="doneWithContent" class="doneWithContent" name="moreContent" value="Done" />
</section> </section>
</section> </section>
<#--Include JavaScript specific to the types of data getters related to this content--> <#--Include JavaScript specific to the types of data getters related to this content-->

View file

@ -1,10 +1,11 @@
<#-- $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" style="background-color:#f9f9f9;padding-left:6px;padding-top:2px;border-width:1px;border-style:solid;border-color:#ccc;"> <section id="fixedHtml" class="sparqlHtmlContent">
<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>
<textarea id="fixedHTMLValue" name="htmlValue" cols="70" rows="15" style="margin-bottom:7px"></textarea> <textarea id="fixedHTMLValue" name="htmlValue" cols="70" rows="15" style="margin-bottom:7px"></textarea><br />
<input type="button" id="doneWithContent" name="moreContent" value="Done" class="doneWithContent" />
</section> </section>
${scripts.add('<script type="text/javascript" src="${urls.base}/js/menupage/processFixedHTMLDataGetterContent.js"></script>')} ${scripts.add('<script type="text/javascript" src="${urls.base}/js/menupage/processFixedHTMLDataGetterContent.js"></script>')}

View file

@ -1,12 +1,13 @@
<#-- $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" style="background-color:#f9f9f9;padding-left:6px;padding-top:2px;border-width:1px;border-style:solid;border-color:#ccc;"> <section id="sparqlQuery" class="sparqlHtmlContent">
<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" />
<label id="queryModelLabel" for="queryModel">Query Model</label>
<#--Hiding query model for now--> <#--Hiding query model for now-->
<#-- <label id="queryModelLabel" for="queryModel">Query Model</label> -->
<input type="text" name="queryModel" size="20" value="" id="queryModel" role="input" style="display:none"/> <input type="text" name="queryModel" size="20" value="" id="queryModel" role="input" style="display:none"/>
<label id="queryLabel" for="queryLabel"><span id="querySpan">Enter SPARQL query here</span><span class="requiredHint"> *</span></label> <label id="queryLabel" for="queryLabel"><span id="querySpan">Enter SPARQL query here</span><span class="requiredHint"> *</span></label>
<textarea id="query" name="query" cols="70" rows="15" style="margin-bottom:7px"></textarea> <textarea id="query" name="query" cols="70" rows="15" style="margin-bottom:7px"></textarea><br />
<input type="button" id="doneWithContent" class="doneWithContent" name="moreContent" value="Done" />
</section> </section>
${scripts.add('<script type="text/javascript" src="${urls.base}/js/menupage/processSparqlDataGetterContent.js"></script>')} ${scripts.add('<script type="text/javascript" src="${urls.base}/js/menupage/processSparqlDataGetterContent.js"></script>')}

View file

@ -54,7 +54,7 @@
<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> </select>&nbsp;<span class="note">Add one or more content types</span>
</section> </section>
<section id="contentDivs"></section> <section id="contentDivs"></section>
<section id="headerBar" > <section id="headerBar" >
@ -64,7 +64,6 @@
<!--This content will be copied/shown for these particular content types, so any fields for n3 editing need to be included <!--This content will be copied/shown for these particular content types, so any fields for n3 editing need to be included
here that correspond to a specific content type. These are related to specific "data getters" on the server side. --> here that correspond to a specific content type. These are related to specific "data getters" on the server side. -->
<#include "pageManagement--contentTemplates.ftl"> <#include "pageManagement--contentTemplates.ftl">
<input type="button" id="moreContent" name="moreContent" value="Add More Content" class="delete" />
</div> </div>
</section> </section>
<!--Information for page or menu item level--> <!--Information for page or menu item level-->