baseline
[omp.pkp.sfu.ca.git] / templates / inserts / monographComponents / components.tpl
blob94bd02c80896151bc69ffbc2c200e03a20ff2849
1 {**
2  * components.tpl
3  *
4  * Copyright (c) 2003-2008 John Willinsky
5  * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
6  *
7  * Component listing.
8  *
9  * $Id: components.tpl,v 1.11 2009/08/13 00:38:49 tylerl Exp $
10  *}
11 {literal}
12 <script type="text/javascript">
13 <!--
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;
21         form.submit();
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;
29         form.submit();
31 // -->
32 </script>
33 {/literal}
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}" />
45 <div id="components">
46 <h3>{translate key="inserts.monographComponents.heading.prep"}</h3>
47 <br />
48 {translate key="inserts.monographComponents.description"}
49 <br /><br />
51 <table width="100%" class="listing">
52         <tr>
53                 <td class="headseparator" colspan="2">&nbsp;</td>
54         </tr>
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>
58 </tr>
59         <tr>
60                 <td class="headseparator" colspan="2">&nbsp;</td>
61         </tr>
62 {assign var="componentIndex" value=0} 
63 {foreach name=components from=$components item=component}
64 <tr>
65 <td>
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>
69 </td>
70 <td>
71         {if $componentIndex > 0}<a href="javascript:moveComponent('u', '{$componentIndex|escape}')" class="action">&uarr;</a>{else}&uarr;{/if} {if $componentIndex < count($components)-1}<a href="javascript:moveComponent('d', '{$componentIndex|escape}')" class="action">&darr;</a>{else}&darr;{/if}
72         
73         | <input type="submit" name="deleteComponent[{$componentIndex}]" value="{translate key="inserts.monographComponents.button.deleteComponent"}" class="button" />
74 </td>
75 </tr>
76 {assign var="componentAuthorIndex" value=0}
77 {foreach name=componentAuthors from=$component.authors item=componentAuthor}
78 <tr>
79 <td>
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                 &nbsp;<strong>{$contributors[$pivotId].firstName}&nbsp;{$contributors[$pivotId].lastName}</strong>
85                 <br />
86                 &nbsp;{$contributors[$pivotId].email}
87                 <br />
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>
89                 <br />
90                 &nbsp;<input type="submit" name="removeComponentAuthor[{$componentIndex}][{$pivotId|escape}]" value="{translate key="inserts.monographComponents.button.removeAuthor"}" class="button" />
91         </div>
92 </td>
93 <td>
94         <a href="javascript:moveComponentAuthor('u', '{$componentAuthorIndex|escape}','{$componentIndex|escape}')" class="action">&uarr;</a> <a href="javascript:moveComponentAuthor('d', '{$componentAuthorIndex|escape}','{$componentIndex|escape}')" class="action">&darr;</a>
95 </td>
96 </tr>
97 {assign var="componentAuthorIndex" value=$componentAuthorIndex+1}
98 {/foreach}
99 <tr>
100         <td class="separator" colspan="2">&nbsp;</td>
101 </tr>
102 {assign var="componentIndex" value=$componentIndex+1}
103 {foreachelse}
104         <tr><td class="nodata" colspan="2">{translate key="common.none"}</em></td></tr>
105 <tr>
106         <td class="separator" colspan="2">&nbsp;</td>
107 </tr>
108 {/foreach}
109 </table>
110 </div>
112 {if $scrollToComponents}
113 {literal}
114 <script type="text/javascript">
115 var components = document.getElementById('components');
116 components.scrollIntoView();
117 </script>
118 {/literal}
119 {/if}
121 <br />
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">
127 <tr valign="top">
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>
130 </tr>
131 {if $workType == WORK_TYPE_EDITED_VOLUME}
132 <tr valign="top">
133         <td width="20%" class="label">{translate key="user.role.authors"}</td>
134         <td width="80%">
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>
138                         {/foreach}
139                 </select>
140         </td>
141 </tr>
142 {/if}
143 <tr valign="top">
144         <td width="20%"></td>
145         <td width="80%"><input type="submit" class="button" name="addComponent" value="{translate key="inserts.monographComponents.button.addComponent"}" /></td>
146 </tr>
147 </table>
148 </div>