project_table.tpl 4.66 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
{*
Copyright (C) 2009 INRA
 
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*}

<table class="table table-striped table-bordered dataTable" id="project_data_table">
	<thead>
		<tr>
Penom Nom's avatar
Penom Nom committed
21
		    {assign var="pcolspan" value=3}
22 23
			{if $is_at_least_admin_of_1_project && $login_user}
				<th><center><input type="checkbox" id="chk_all_project"></center></th>
Penom Nom's avatar
Penom Nom committed
24
				{assign var="pcolspan" value= $pcolspan + 1}
25 26 27 28 29 30 31 32 33 34
			{/if}
			<th>Project Name</th>
			<th>Date</th>
			<th>Description</th>
		</tr>
	</thead>
	<tbody>
		{foreach from=$projects key=project_id item=project_values}
			{assign var="classes" value=""}
			{if $login_user && $project_values.public == 0 && $project_values.is_admin}
Penom Nom's avatar
Penom Nom committed
35
				{$classes = $classes|cat:"<span class='label label-warning'><i class='glyphicon glyphicon-thumbs-up'></i></span> "}
36 37
			{/if}
			{if $project_values.hidden == 1}
Penom Nom's avatar
Penom Nom committed
38
				{$classes = $classes|cat:" <span class='label label-info'><i class='glyphicon glyphicon-eye-close'></i></span> "}
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
			{/if}
			{if ($project_values.hidden == 1 && $project_values.is_admin) || $project_values.hidden == 0}
				<tr id="tr_project_{$project_values.id}">
					{if $project_values.is_admin}
						<td><center><input type="checkbox" id="chk_project_{$project_values.id}" value="project_{$project_values.id}"></center></td>
					{elseif $is_at_least_admin_of_1_project}
						<td></td>
					{/if}
					{if $project_values.is_admin}
						<td class="editable"> 
							{$classes} <span class="editable" data-type="text" data-pk="{$project_values.id}" data-url="index.php?eID=tx_nG6&type=update_db_field&table=tx_nG6_project&field=name" data-original-title="Enter project name">{$project_values.href}</span>
						</td>
					{else}
						<td> 
							{$project_values.href}
						</td>
					{/if}
					{if $project_values.is_admin}
						<td class="editable"> 
							<span class="editable-date" data-type="date" data-pk="{$project_values.id}" data-url="index.php?eID=tx_nG6&type=update_db_field&table=tx_nG6_project&field=crdate" data-original-title="Select date">{$project_values.date|date_format:"%d/%m/%Y"}</span>
						</td>
					{else}
						<td>
							{$project_values.date|date_format:"%d/%m/%Y"}
						</td>
					{/if}
					{if $project_values.is_admin}
						<td class="editable"> 
							<span class="editable" data-type="textarea" data-pk="{$project_values.id}" data-url="index.php?eID=tx_nG6&type=update_db_field&table=tx_nG6_project&field=description" data-original-title="Enter description"> {$project_values.description}</span>
						</td>
					{else}
						<td> 
							{$project_values.description}
						</td>
					{/if}
				</tr>
			{/if}
		{/foreach}
	</tbody>
78
	{if ($is_at_least_admin_of_1_project && $login_user) || $is_ng6_admin }
79 80
	<tfoot>
		<tr>
Penom Nom's avatar
Penom Nom committed
81
			<th align="left" colspan="{$pcolspan}">
82 83
				With selection :
				<div  class="btn-group">
Penom Nom's avatar
Penom Nom committed
84 85
					<button id="hide_project" type="button" class="btn multiplep-selection-btn btn-sm btn-default"><i class="glyphicon glyphicon-eye-close"></i> hide</button>
					<button id="unhide_project" type="button" class="btn multiplep-selection-btn btn-sm btn-default"><i class="glyphicon glyphicon-eye-open"></i> unhide</button>
86 87
				</div>
				<div class="btn-group">
Penom Nom's avatar
Penom Nom committed
88 89
					<button id="publish_project" type="button" class="btn multiplep-selection-btn btn-sm btn-default"><i class="glyphicon glyphicon-thumbs-up"></i> publish</button>
					<button id="unpublish_project" type="button" class="btn multiplep-selection-btn btn-sm btn-default"><i class="glyphicon glyphicon-thumbs-down"></i> unpublish</button>
90
				</div>
91
				<div class="btn-group">
92
					{if $is_ng6_admin}
Penom Nom's avatar
Penom Nom committed
93
						<button id="add_project" type="button" class="btn nop-selection-btn btn-sm btn-default"><i class="glyphicon glyphicon-plus"></i> add</button>
94
					{else}
Penom Nom's avatar
Penom Nom committed
95
						<button id="add_project" type="button" class="btn btn-sm btn-default" disabled><i class="glyphicon glyphicon-plus"></i> add</button>
96
					{/if}	
Penom Nom's avatar
Penom Nom committed
97
					<button id="delete_project" type="button" class="btn multiplep-selection-btn btn-sm btn-default"><i class="glyphicon glyphicon-minus"></i> delete</button>
98
				</div>
99 100 101 102
			</th>
		</tr>
	</tfoot>
	{/if}
Penom Nom's avatar
Penom Nom committed
103
</table>