diff options
Diffstat (limited to 'templates/add_structure_content.tpl')
| -rw-r--r-- | templates/add_structure_content.tpl | 56 |
1 files changed, 31 insertions, 25 deletions
diff --git a/templates/add_structure_content.tpl b/templates/add_structure_content.tpl index db90560..1d047f7 100644 --- a/templates/add_structure_content.tpl +++ b/templates/add_structure_content.tpl @@ -1,10 +1,7 @@ {literal} -<script type="text/javascript">/* <![CDATA[ */ -function submitStructure(pForm,pContentId,pMode) { - var req = getXMLHttpRequest(); - req.open("POST", {/literal}'{$smarty.const.LIBERTY_PKG_URL}add_structure_content.php'{literal}, true); - var data = queryString(pForm)+"&content[]="+pContentId+"&ajax_xml=1"; - +<script type="text/javascript"> +function addStructure(pContentId) { + var data = $("#structureaddform").serialize()+"&content[]="+pContentId+"&ajax_xml=1&action=add"; var ajax = new BitBase.SimpleAjax(); var donefn = function (r) { var responseHash = BitBase.evalJSON( r.responseText ); @@ -15,13 +12,11 @@ function submitStructure(pForm,pContentId,pMode) { BitBase.showById( responseHash.content_id+"remove" ); BitBase.fade( responseHash.content_id+"add" ); }; - ajax.connect( "{/literal}{$smarty.const.LIBERTY_PKG_URL}add_structure_content.php{literal}", data, donefn, "GET" ); - return false; } -/* ]]> */</script> +</script> {/literal} {strip} @@ -31,18 +26,20 @@ function submitStructure(pForm,pContentId,pMode) { <div class="edit structurecontent"> <div class="header"> - <h1>{tr}Structure Content{/tr}</h1> + <h1>{$gContent->getTitle()|escape} {tr}Table of Contents{/tr}</h1> </div> {form legend="Add Content" id="structureaddform"} <input type="hidden" name="structure_id" value="{$structureInfo.structure_id}" /> <input type="hidden" name="tab" value="content" /> + <div class="row"> + <div class="col-sm-4"> {if $subtree} <div class="form-group"> {formlabel label="After page" for="after_ref_id"} {forminput} - <select name="after_ref_id" id="after_ref_id"> + <select class="form-control" name="after_ref_id" id="after_ref_id"> {section name=iy loop=$subtree} <option value="{$subtree[iy].structure_id}" {if $insert_after eq $subtree[iy].structure_id}selected="selected"{/if}>{$subtree[iy].pos} - {$subtree[iy].title|escape}</option> {/section} @@ -51,31 +48,40 @@ function submitStructure(pForm,pContentId,pMode) { {/forminput} </div> {/if} - + </div> + <div class="col-sm-3"> {minifind} {* disable until it can be sorted } <div class="form-group"> {formlabel label="Search" for="lib-content"} {forminput} - <input autocomplete="off" id="contact_name" name="contact[name]" size="30" type="text" value="" /> + <input class="form-control" autocomplete="off" id="contact_name" name="contact[name]" type="text" value="" /> <div class="auto_complete" id="contact_name_auto_complete"></div> <script type="text/javascript">new Ajax.Autocompleter('contact_name', 'contact_name_auto_complete', '/presentations/foo.php', {ldelim}{rdelim})</script> {formhelp note=""} {/forminput} </div> { *} + </div> + <div class="col-sm-3"> + <div class="form-group"> + {formlabel label="Content Type" for="content_type_guid"} + {forminput} + {html_options class="form-control" onchange="submit();" options=$contentTypes name=content_type_guid selected=$contentSelect} + {/forminput} - <div class="form-group"> - {formlabel label="Content type" for="content_type_guid"} - {forminput} - {html_options onchange="submit();" options=$contentTypes name=content_type_guid selected=$contentSelect} - {/forminput} - - {* forminput} - {html_options multiple="multiple" id="lib-content" size="12" name="content[]" values=$contentList options=$contentList} - {/forminput *} + {* forminput} + {html_options class="form-control" multiple="multiple" id="lib-content" size="12" name="content[]" values=$contentList options=$contentList} + {/forminput *} + </div> + </div> + <div class="col-sm-1"> + <a class="btn btn-primary" href="{$smarty.const.BIT_ROOT_URL}index.php?structure_id={$gStructure->mStructureId}">Done</a> + </div> + </div> + <div class="form-group"> {forminput} <table class="table data"> <thead> @@ -91,12 +97,12 @@ function submitStructure(pForm,pContentId,pMode) { <tr class="item {cycle values="even,odd"}" id="{$contentListHash[cx].content_id}li"> <td> - {assign var=inStructure value=$gStructure->isInStructure($contentListHash[cx].content_id)} - <div class="icon" {if empty($inStructure)}style="display:none"{/if} id="{$contentListHash[cx].content_id}remove" onclick="submitStructure(document.getElementById('structureaddform'),{$contentListHash[cx].content_id},'remove')"> + {assign var=inStructureId value=$gStructure->isInStructure($contentListHash[cx].content_id)} + <div class="icon" {if empty($inStructureId)}style="display:none"{/if} id="{$contentListHash[cx].content_id}remove" onclick="removeStructure({$inStructureId})"> {booticon iname="icon-minus-sign" ipackage="icons" iexplain="Remove"} </div> - <div class="icon" {if $inStructure}style="display:none"{/if} id="{$contentListHash[cx].content_id}add" onclick="submitStructure(document.getElementById('structureaddform'),{$contentListHash[cx].content_id},'add')"> + <div class="icon" {if $inStructureId}style="display:none"{/if} id="{$contentListHash[cx].content_id}add" onclick="addStructure({$contentListHash[cx].content_id})"> {booticon iname="icon-plus-sign" ipackage="icons" iexplain="Add to structure"} </div> |
