run_view.tpl 7.78 KB
Newer Older
Penom Nom's avatar
Penom Nom committed
1
2
{*
Copyright (C) 2009 INRA
3

Penom Nom's avatar
Penom Nom committed
4
5
6
7
8
9
10
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
11
12

ERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Penom Nom's avatar
Penom Nom committed
13
14
15
16
17
18
19
20
21
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/>.
*}

<div id="user_information_dialog" title=""></div>
<div id="error_dialog" title=""></div>

Jerome Mariette's avatar
Jerome Mariette committed
22
23
<input type="hidden" id="server_name" value="{$server_name}" />
<input type="hidden" id="user_id" value="{$user_id}" />
24
<input type="hidden" id="data_folder" value="{$data_folder}" />
Penom Nom's avatar
Penom Nom committed
25
26
<input type="hidden" id="view" value="run" />
<input type="hidden" id="ids" value="{$run_ids}" />
Jerome Mariette's avatar
Jerome Mariette committed
27
<input type="hidden" id="login_user" value="{$login_user}" />
Jerome Mariette's avatar
Jerome Mariette committed
28
<input type="hidden" id="user_login" value="{$user_login}" />
Jerome Mariette's avatar
Jerome Mariette committed
29
<input type="hidden" id="server_url" value="{$server_url}" />
Penom Nom's avatar
Penom Nom committed
30

Penom Nom's avatar
Penom Nom committed
31
32
33
34
35
36
37
38
39
40
{* Find out if the current user is super user of a run *}
{assign var="is_at_least_admin_of_1_run" value=false}
{foreach from=$runs key=run_id item=run_values}
	{if $run_values.is_admin && !$is_at_least_admin_of_1_run}
		{assign var="is_at_least_admin_of_1_run" value=true}
	{elseif !$is_at_least_admin_of_1_run}
		{assign var="is_at_least_admin_of_1_run" value=false}
	{/if}
{/foreach}

Penom Nom's avatar
Penom Nom committed
41
{* If no runs can be displayed *}
Jerome Mariette's avatar
Jerome Mariette committed
42
{if $runs|@count == 0 || ($runs|@count == 1 && $runs[key($runs)].hidden == 1 && !$runs[key($runs)].is_admin) }
Penom Nom's avatar
Penom Nom committed
43
44
45
46
47
48
49
50
    <div class="sub-content sc-top clearfix">
		<div class="ng6-content-header-left run">
			<h2>Run <small>--</small></h2>
		</div>
		<div class="ng6-content-header-right">
		    <div class="alert alert-warning" > <strong>Access denied !</strong>Sorry you don't have access to this run. Please select another run</div>
		</div>
    </div>
51

Penom Nom's avatar
Penom Nom committed
52
53
    <div class="sub-content sc-bottom">&nbsp;</div>

Penom Nom's avatar
Penom Nom committed
54
{* If a single run has to be displayed *}
55
{elseif $single_run_display}
philippe's avatar
philippe committed
56
57
	<div class="sub-content sc-top">
		<div class="ng6-content-header-left run">
philippe's avatar
philippe committed
58
59
			<h2>Run <small>{$runs[key($runs)].name}</small></h2>
		</div>
philippe's avatar
philippe committed
60
		<div class="ng6-content-header-right">
Jerome Mariette's avatar
Jerome Mariette committed
61
			{$runs[key($runs)].description} <br/><br/>
62

philippe's avatar
philippe committed
63
64
			<div style="float:left;margin-right:25px">
				<p class="bullet"><strong>Project name: </strong> {$runs[key($runs)].project_name}</p>
Penom Nom's avatar
Penom Nom committed
65
				<p class="bullet"><strong>Date: </strong> {$runs[key($runs)].date|date_format:"%d/%m/%y"}</p>
philippe's avatar
philippe committed
66
67
				<p class="bullet"><strong>Species: </strong> {$runs[key($runs)].species}</p>
				<p class="bullet"><strong>Type: </strong> {$runs[key($runs)].type}</p>
Penom Nom's avatar
Penom Nom committed
68
				{if $is_at_least_admin_of_1_run && $login_user}
Penom Nom's avatar
Penom Nom committed
69
					<p style="margin: 6px 0 0;padding-left: 20px;"><span id="wfstatus_run_id_{$run_ids}"></span></p>
Penom Nom's avatar
Penom Nom committed
70
				{/if}
philippe's avatar
philippe committed
71
72
73
74
75
76
77
			</div>
			<div style="float:left">
				<p class="bullet"><strong>Data nature: </strong> {$runs[key($runs)].data_nature}</p>
				<p class="bullet"><strong>Number of sequences: </strong> {$runs[key($runs)].nb_sequences|number_format:0:' ':' '}</p>
				<p class="bullet"><strong>Full sequences length: </strong> {$runs[key($runs)].full_seq_size|number_format:0:' ':' '}</p>
				<p class="bullet"><strong>Sequencer: </strong> {$runs[key($runs)].sequencer}</p>
			</div>
philippe's avatar
philippe committed
78
			<div style="clear:both"></div>
Jerome Mariette's avatar
Jerome Mariette committed
79
80
81
			{assign var="run_size" value="<span id='size' class='tx-nG6-mini-wait'></span>"}
			<br />
			Raw data and analysis results use <strong>{$run_size}</strong> on the hard drive.<br/>
82
			{if $run_analysis|@count > 0}
83
				<strong>{$run_analysis|@count}</strong> analysis have been done on this run.<br/>
Jerome Mariette's avatar
Jerome Mariette committed
84
			{else}
85
				<strong>{$run_analysis|@count}</strong> analysis has been done on this run.<br/>
Jerome Mariette's avatar
Jerome Mariette committed
86
			{/if}
87
88
			{if $run_data_state == 'stored'}
				The run data is <strong>stored</strong>. It will be kept until {$run_retention_date}.<br/>
Romain Therville's avatar
Romain Therville committed
89
90
91
92
			{elseif $run_data_state == 'purged'}
				The run data has been <strong>purged</strong> on {$run_purge_date}.<br/>
			{elseif $run_data_state == 'extended'}
				The run data retention has been <strong>extended</strong> to {$run_retention_date}.<br/>
93
94
95
			{/if}
			
			
96
97

			<br/>
Penom Nom's avatar
Penom Nom committed
98
			<div  style="float:right;">
99
				{if $runs[key($runs)].is_admin }
Penom Nom's avatar
Penom Nom committed
100
					<button id="add_file" type="button" class="btn btn-sm btn-primary"><i class="glyphicon glyphicon-plus"></i> add files</button>
101
102
				{/if}
			</div>
103

philippe's avatar
philippe committed
104
105
		</div>
		<div style="clear:both"></div>
Penom Nom's avatar
Penom Nom committed
106
	</div>
107

philippe's avatar
philippe committed
108
109
110
	<div class="sub-content sc-bottom">
		<ul id="myTab" class="nav nav-tabs">
			<li class="active"><a href="#analyses" data-toggle="tab">Analyses</a></li>
Penom Nom's avatar
Penom Nom committed
111
	 		<li><a href="#downloads" data-toggle="tab">Raw data</a></li>
112
113
	 		{assign var="comment_tab" value="run_comments"}
	 		<li><a href="#{$comment_tab}" data-toggle="tab">Comments</a></li>
philippe's avatar
philippe committed
114
		</ul>
115

philippe's avatar
philippe committed
116
117
118
119
		<div id="myTabContent" class="tab-content">
	 		<div class="tab-pane fade in active" id="analyses">
	 			{* Find out if an analysis table should be displayed *}
				{assign var="display_analysis_result" value=false}
120
				{foreach from=$h_analysis key=analysis_id item=analysis_values}
philippe's avatar
philippe committed
121
122
123
124
125
126
					{if $analysis_values.is_admin && $analysis_values.hidden == 1}
						{assign var="display_analysis_result" value=true}
					{elseif $analysis_values.hidden == 0}
						{assign var="display_analysis_result" value=true}
					{/if}
				{/foreach}
127
128
				{assign var="is_admin" value=$runs[key($runs)].is_admin}
				{include file='analysis_table.tpl'}
philippe's avatar
philippe committed
129
	 		</div>
130

philippe's avatar
philippe committed
131
	 		<div class="tab-pane fade" id="downloads">
132
	 			{$dir=$data_folder|cat:$runs[key($runs)].directory}
philippe's avatar
philippe committed
133
				{assign var="nb_files" value=0}
Romain Therville's avatar
Romain Therville committed
134
135
136
137
138
139
				{foreach $dir|scandir as $file}
					{if $file != "." and $file !="" and $file != ".." and ($file|substr:-strlen(".png")) != ".png"}
						{$nb_files = $nb_files + 1}
					{/if}
				{/foreach}
				
philippe's avatar
philippe committed
140
				<ul>
Romain Therville's avatar
Romain Therville committed
141
142
				{if $nb_files >= 1}
					<div class="alert alert-info" name="retention-info">
Romain Therville's avatar
Romain Therville committed
143
						Retention date is {$runs[key($runs)].retention_date|date_format}. After this deadline, these data will no longer be available. Only metadata and quality control results will remain in NG6.
Romain Therville's avatar
Romain Therville committed
144
145
146
					</div>
				{/if}
				{assign var="nb_files" value=0}
philippe's avatar
philippe committed
147
148
				{foreach $dir|scandir as $file}
					{if $file != "." and $file !="" and $file != ".." and ($file|substr:-strlen(".png")) != ".png"}
149
						{$link=(('fileadmin'|cat:$runs[key($runs)].directory)|cat:'/')|cat:$file}
philippe's avatar
philippe committed
150
151
152
153
154
						<li class="filelist"><a href="{$link}">{$file}</a> <br /></li>
						{$nb_files = $nb_files + 1}
					{/if}
				{/foreach}
				</ul>
155
				{if $nb_files == 0}
philippe's avatar
philippe committed
156
					<div class="alert alert-info">
157
158
159
160
161
162
						{if $runs[key($runs)].data_state=="purged"}
							The data have been purged.  (Retention limit : {$runs[key($runs)].retention_date|date_format})
						{else}
							Results folder not synchronized yet... 
						{/if}

philippe's avatar
philippe committed
163
	    			</div>
Jerome Mariette's avatar
Jerome Mariette committed
164
				{/if}
philippe's avatar
philippe committed
165
	 		</div>
166

167
	 		{include file='comments.tpl' comments=$comments  tab_id=$comment_tab  add_new_comment=$runs[key($runs)].is_admin  user_id=$user_id }
168

Jerome Mariette's avatar
Jerome Mariette committed
169
170
 		</div>
 	</div>
171

Penom Nom's avatar
Penom Nom committed
172
173
174
{* If multiple runs have to be displayed *}
{else}
	{* Then display the table *}
philippe's avatar
philippe committed
175
176
177
	<div class="sub-content sc-top">
		<div class="ng6-content-header-left run">
			<h2>Runs list <small> you can access </small></h2>
Jerome Mariette's avatar
Jerome Mariette committed
178
179
		</div>
		<div class="ng6-content-header-right">
philippe's avatar
philippe committed
180
181
182
183
184
185
			You have access to <strong>{$runs|@count}</strong> runs.
			<br />
			{assign var="run_size" value="<span id='size' class='tx-nG6-mini-wait'></span>"}
			Raw data and analysis results use <strong>{$run_size}</strong> on the hard drive.
		</div>
		<div style="clear:both"></div>
Penom Nom's avatar
Penom Nom committed
186
	</div>
187

philippe's avatar
philippe committed
188
189
	<div class="sub-content sc-bottom">
		{include file='run_table.tpl'}
190
	</div>
Jerome Mariette's avatar
Jerome Mariette committed
191
192
{/if}

193
{include file='../template/modals.tpl'}