run_view.tpl 6.24 KB
Newer Older
Penom Nom's avatar
Penom Nom committed
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/>.
*}

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

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

{* If no runs can be displayed *}
Jerome Mariette's avatar
Jerome Mariette committed
31
{if $runs|@count == 0 || ($runs|@count == 1 && $runs[key($runs)].hidden == 1 && !$runs[key($runs)].is_admin) }
32
33
34
35
	<div class="sub-content">
		<br/>
		<div class="alert alert-info" >Sorry no results to display</div>
	</div>
Penom Nom's avatar
Penom Nom committed
36
37
	
{* If a single run has to be displayed *}
38
{elseif $single_run_display}
philippe's avatar
philippe committed
39
40
	<div class="sub-content sc-top">
		<div class="ng6-content-header-left run">
philippe's avatar
philippe committed
41
42
			<h2>Run <small>{$runs[key($runs)].name}</small></h2>
		</div>
philippe's avatar
philippe committed
43
		<div class="ng6-content-header-right">
Jerome Mariette's avatar
Jerome Mariette committed
44
45
			{$runs[key($runs)].description} <br/><br/>
			
philippe's avatar
philippe committed
46
47
			<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
48
				<p class="bullet"><strong>Date: </strong> {$runs[key($runs)].date|date_format:"%d/%m/%y"}</p>
philippe's avatar
philippe committed
49
50
51
52
53
54
55
56
57
				<p class="bullet"><strong>Species: </strong> {$runs[key($runs)].species}</p>
				<p class="bullet"><strong>Type: </strong> {$runs[key($runs)].type}</p>
			</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
58
			<div style="clear:both"></div>
Jerome Mariette's avatar
Jerome Mariette committed
59
60
61
62
63
64
65
66
			{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/>
			{if $run_analysis|@count > 0} 
				<strong>{$run_analysis|@count}</strong> analysis have been done on this run.
			{else}
				<strong>{$run_analysis|@count}</strong> analysis has been done on this run.
			{/if}
67
68

			<br/>
Penom Nom's avatar
Penom Nom committed
69
			<div  style="float:right;">
70
				{if $runs[key($runs)].is_admin }
Penom Nom's avatar
Penom Nom committed
71
					<button id="add_file" type="button" class="btn btn-sm btn-primary"><i class="glyphicon glyphicon-plus"></i> add files</button>
72
73
74
				{/if}
			</div>
			
philippe's avatar
philippe committed
75
76
		</div>
		<div style="clear:both"></div>
Penom Nom's avatar
Penom Nom committed
77
	</div>
Jerome Mariette's avatar
Jerome Mariette committed
78
	
philippe's avatar
philippe committed
79
80
81
	<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
82
	 		<li><a href="#downloads" data-toggle="tab">Raw data</a></li>
83
84
	 		{assign var="comment_tab" value="run_comments"}
	 		<li><a href="#{$comment_tab}" data-toggle="tab">Comments</a></li>
philippe's avatar
philippe committed
85
86
87
88
89
90
		</ul>
		
		<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}
91
				{foreach from=$h_analysis key=analysis_id item=analysis_values}
philippe's avatar
philippe committed
92
93
94
95
96
97
					{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}
98
99
				{assign var="is_admin" value=$runs[key($runs)].is_admin}
				{include file='analysis_table.tpl'}
philippe's avatar
philippe committed
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
	 		</div>
	 		
	 		<div class="tab-pane fade" id="downloads">
	 			{$dir=$data_folder|cat:$runs[key($runs)].directory}
				{assign var="nb_files" value=0}
				<ul>
				{foreach $dir|scandir as $file}
					{if $file != "." and $file !="" and $file != ".." and ($file|substr:-strlen(".png")) != ".png"}
						{$link=(('fileadmin'|cat:$runs[key($runs)].directory)|cat:'/')|cat:$file}
						<li class="filelist"><a href="{$link}">{$file}</a> <br /></li>
						{$nb_files = $nb_files + 1}
					{/if}
				{/foreach}
				</ul>
				{if $nb_files == 0} 
					<div class="alert alert-info">
						Results folder not synchronized yet...
	    			</div>
Jerome Mariette's avatar
Jerome Mariette committed
118
				{/if}
philippe's avatar
philippe committed
119
	 		</div>
120
121
122
	 		
	 		{include file='comments.tpl' comments=$comments  tab_id=$comment_tab  add_new_comment=$runs[key($runs)].is_admin  user_id=$user_id }
		    
Jerome Mariette's avatar
Jerome Mariette committed
123
124
 		</div>
 	</div>
Penom Nom's avatar
Penom Nom committed
125
126
127
128
	
{* If multiple runs have to be displayed *}
{else}
	{* Find out if the current user is super user of a run *}
Jerome Mariette's avatar
Jerome Mariette committed
129
	{assign var="is_at_least_admin_of_1_run" value=false}
Penom Nom's avatar
Penom Nom committed
130
	{foreach from=$runs key=run_id item=run_values}
Jerome Mariette's avatar
Jerome Mariette committed
131
132
133
134
		{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}
Penom Nom's avatar
Penom Nom committed
135
136
137
		{/if}
	{/foreach}
	{* Then display the table *}
philippe's avatar
philippe committed
138
139
140
	<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
141
142
		</div>
		<div class="ng6-content-header-right">
philippe's avatar
philippe committed
143
144
145
146
147
148
			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
149
150
	</div>
	
philippe's avatar
philippe committed
151
152
153
	<div class="sub-content sc-bottom">
		{include file='run_table.tpl'}
	</div>	
Jerome Mariette's avatar
Jerome Mariette committed
154
155
{/if}

Penom Nom's avatar
Penom Nom committed
156
{include file='./modals.tpl'}
Jerome Mariette's avatar
Jerome Mariette committed
157