4 * Copyright (c) 2003-2008 John Willinsky
5 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
9 * $Id: components.tpl,v 1.11 2009/08/13 00:38:49 tylerl Exp $
12 <script type="text/javascript">
14 // Move component author up/down
15 function moveComponentAuthor(dir, authorIndex, componentIndex) {
16 var form = document.submit;
17 form.moveComponentAuthor.value = 1;
18 form.moveComponentAuthorDir.value = dir;
19 form.moveComponentAuthorIndex.value = authorIndex;
20 form.moveComponentAuthorComponentIndex.value = componentIndex;
23 // Move component up/down
24 function moveComponent(dir, componentIndex) {
25 var form = document.submit;
26 form.moveComponent.value = 1;
27 form.moveComponentDir.value = dir;
28 form.moveComponentIndex.value = componentIndex;
35 <input type="hidden" name="moveComponentAuthor" value="0" />
36 <input type="hidden" name="moveComponentAuthorDir" value="" />
37 <input type="hidden" name="moveComponentAuthorIndex" value="" />
38 <input type="hidden" name="moveComponentAuthorComponentIndex" value="0" />
39 <input type="hidden" name="moveComponent" value="0" />
40 <input type="hidden" name="moveComponentDir" value="" />
41 <input type="hidden" name="moveComponentIndex" value="" />
43 <input type="hidden" name="deletedComponents" value="{$deletedComponents|escape}" />
46 <h3>{translate key="inserts.monographComponents.heading.prep"}</h3>
48 {translate key="inserts.monographComponents.description"}
51 <table width="100%" class="listing">
53 <td class="headseparator" colspan="2"> </td>
56 <tr class="heading" valign="bottom">
57 <td width="50%">{translate key="inserts.monographComponents.heading.info"}</td><td width="50%">{translate key="common.action"}</td>
60 <td class="headseparator" colspan="2"> </td>
62 {assign var="componentIndex" value=0}
63 {foreach name=components from=$components item=component}
66 <input type="hidden" name="components[{$componentIndex}][componentId]" value="{$component.componentId|escape}" />
67 <input type="hidden" name="components[{$componentIndex}][title][{$formLocale|escape}]" value="{$component.title.$formLocale}" />
68 <h4>{$component.title.$formLocale}</h4>
71 {if $componentIndex > 0}<a href="javascript:moveComponent('u', '{$componentIndex|escape}')" class="action">↑</a>{else}↑{/if} {if $componentIndex < count($components)-1}<a href="javascript:moveComponent('d', '{$componentIndex|escape}')" class="action">↓</a>{else}↓{/if}
73 | <input type="submit" name="deleteComponent[{$componentIndex}]" value="{translate key="inserts.monographComponents.button.deleteComponent"}" class="button" />
76 {assign var="componentAuthorIndex" value=0}
77 {foreach name=componentAuthors from=$component.authors item=componentAuthor}
80 <div class="{if $componentAuthorIndex % 2}evenSideIndicator{else}oddSideIndicator{/if}">
81 {assign var="pivotId" value=$componentAuthor.pivotId}
82 <input type="hidden" name="components[{$componentIndex}][authors][{$pivotId}]" value="{$pivotId|escape}" />
83 <input type="hidden" name="components[{$componentIndex}][authors][{$pivotId}][pivotId]" value="{$pivotId|escape}" />
84 <strong>{$contributors[$pivotId].firstName} {$contributors[$pivotId].lastName}</strong>
86 {$contributors[$pivotId].email}
88 <input type="radio" name="components[{$componentIndex}][primaryContact]" value="{$pivotId|escape}"{if $component.primaryContact == $pivotId} checked="checked"{/if} /> <label for="components[{$componentIndex|escape}][primaryContact]">{translate key="author.submit.selectPrincipalContact"}</label>
90 <input type="submit" name="removeComponentAuthor[{$componentIndex}][{$pivotId|escape}]" value="{translate key="inserts.monographComponents.button.removeAuthor"}" class="button" />
94 <a href="javascript:moveComponentAuthor('u', '{$componentAuthorIndex|escape}','{$componentIndex|escape}')" class="action">↑</a> <a href="javascript:moveComponentAuthor('d', '{$componentAuthorIndex|escape}','{$componentIndex|escape}')" class="action">↓</a>
97 {assign var="componentAuthorIndex" value=$componentAuthorIndex+1}
100 <td class="separator" colspan="2"> </td>
102 {assign var="componentIndex" value=$componentIndex+1}
104 <tr><td class="nodata" colspan="2">{translate key="common.none"}</em></td></tr>
106 <td class="separator" colspan="2"> </td>
112 {if $scrollToComponents}
114 <script type="text/javascript">
115 var components = document.getElementById('components');
116 components.scrollIntoView();
123 <div class="newItemContainer">
124 <h3>{translate key="inserts.monographComponents.heading.newComponent"}</h3>
125 <p>{translate key="inserts.monographComponents.newComponent.description"}</p>
126 <table width="100%" class="data">
128 <td width="20%" class="label">{translate key="common.title"}</td>
129 <td width="80%" class="value"><input type="text" class="textField" name="newComponent[title][{$formLocale|escape}]" size="30" maxlength="255" /></td>
131 {if $workType == WORK_TYPE_EDITED_VOLUME}
133 <td width="20%" class="label">{translate key="user.role.authors"}</td>
135 <select name="newComponent[authors][]" multiple="multiple" class="selectMenu" size="7" style="width:20em">
136 {foreach from=$contributors item=author}
137 <option value="{$author.pivotId}">{$author.firstName} {$author.lastName} ({$author.email})</option>
144 <td width="20%"></td>
145 <td width="80%"><input type="submit" class="button" name="addComponent" value="{translate key="inserts.monographComponents.button.addComponent"}" /></td>