Commit d16c5cf1 authored by Celine Noirot's avatar Celine Noirot
Browse files

Merge branch 'master' into 'dev'

Merge branch Master with dev

See merge request !105
parents 88acab04 384a7de2
...@@ -53,8 +53,8 @@ ...@@ -53,8 +53,8 @@
<!-- ###LOGIN_FORM### --> <!-- ###LOGIN_FORM### -->
<form action="###ACTION_URI###" target="_top" method="post" onsubmit="###ON_SUBMIT###" class="form-horizontal"> <form action="###ACTION_URI###" target="_top" method="post" onsubmit="###ON_SUBMIT###" class="form-horizontal">
<fieldset> <fieldset>
<legend>###LEGEND###</legend> <legend>###LEGEND###</legend>
<p>###STATUS_MESSAGE###</p>
<div class="form-group"> <div class="form-group">
<label class="col-sm-offset-1 col-sm-4 control-label" for="user">###USERNAME_LABEL###</label> <label class="col-sm-offset-1 col-sm-4 control-label" for="user">###USERNAME_LABEL###</label>
<div class="col-sm-6"> <div class="col-sm-6">
......
{* {*
Copyright (C) 2009 INRA Copyright (C) 2009 INRA
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
...@@ -40,30 +40,26 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -40,30 +40,26 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{elseif $single_project_display} {elseif $single_project_display}
<div class="sub-content sc-top"> <div class="sub-content sc-top">
<input type="hidden" id="is_project_admin" value="{$projects[key($projects)].is_admin}" /> <input type="hidden" id="is_project_admin" value="{$projects[key($projects)].is_admin}" />
<div class="ng6-content-header-left project"> <div class="ng6-content-header-left project">
<h2>Projet <small>{$projects[key($projects)].name}</small></h2> <h2>Projet <small>{$projects[key($projects)].name}</small></h2>
<div><p>Current space: <b><span id="current_space_id">{$projects[key($projects)].space_id}</span></b></p></div> <div><p>Current space: <b><span id="current_space_id">{$projects[key($projects)].space_id}</span></b></p></div>
<div><p>{$space_purge_msg}</p></div> <div><p>{$space_purge_msg}</p></div>
{if $projects[key($projects)].is_admin} {if $projects[key($projects)].is_admin}
<div id="change_space_id_warning"><p><i>Warning, migrating a project from one space to another will update both the files location and the retention limits.</i></p></div> <div id="migration_form"></div>
<div id="change_space_id_form"></div>
<div id="wf_id"></div>
<div id="change_space_id_status"></div>
<div id="change_space_id_footer" align="right"></div>
{/if} {/if}
</div> </div>
<div class="ng6-content-header-right"> <div class="ng6-content-header-right">
{assign var="manag_values" value="{$managment_purged_data[$projects[key($projects)].id]}"} {assign var="manag_values" value="{$managment_purged_data[$projects[key($projects)].id]}"}
{$projects[key($projects)].description} <br /> <br /> {$projects[key($projects)].description} <br /> <br />
<strong>{$manag_values.nb_runs}</strong> run(s) and <strong>{$manag_values.nb_runs}</strong> run(s) and
<strong>{$manag_values.nb_analyses}</strong> analyse(s) have been done on the project {$projects[key($projects)].name}. <strong>{$manag_values.nb_analyses}</strong> analyse(s) have been done on the project {$projects[key($projects)].name}.
<br /> <br />
{assign var="project_size" value="<span id='size' class='tx-nG6-mini-wait'></span>"} {assign var="project_size" value="<span id='size' class='tx-nG6-mini-wait'></span>"}
Raw data and analysis results use <strong>{$project_size}</strong> on the hard drive for the whole project.<br /> Raw data and analysis results use <strong>{$project_size}</strong> on the hard drive for the whole project.<br />
<!-- New data added to this project will be kept<b>{$retention_policy}</b>. <br /> --> <!-- New data added to this project will be kept<b>{$retention_policy}</b>. <br /> -->
<br><label>Data overview</label><br> <br><label>Data overview</label><br>
<table class="table table-striped table-bordered dataTable" id="manag_purged_data_table"> <table class="table table-striped table-bordered dataTable" id="manag_purged_data_table">
<thead> <thead>
<tr> <tr>
...@@ -92,7 +88,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -92,7 +88,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</tbody> </tbody>
</table> </table>
</div> </div>
<div style="clear:both"></div> <div style="clear:both"></div>
</div> </div>
...@@ -107,7 +103,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -107,7 +103,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{assign var="comment_tab" value="project_comments"} {assign var="comment_tab" value="project_comments"}
<li><a href="#{$comment_tab}" data-toggle="tab">Comments</a></li> <li><a href="#{$comment_tab}" data-toggle="tab">Comments</a></li>
</ul> </ul>
<div id="myTabContent" class="tab-content"> <div id="myTabContent" class="tab-content">
<div class="tab-pane fade in active" id="runs"> <div class="tab-pane fade in active" id="runs">
{* Find out if the current user is super user of a run *} {* Find out if the current user is super user of a run *}
...@@ -122,7 +118,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -122,7 +118,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{assign var="is_project_admin" value=$projects[key($projects)].is_admin} {assign var="is_project_admin" value=$projects[key($projects)].is_admin}
{include file='run_table.tpl'} {include file='run_table.tpl'}
</div> </div>
<div class="tab-pane fade" id="analyses"> <div class="tab-pane fade" id="analyses">
{* Find out if an analysis table should be displayed *} {* Find out if an analysis table should be displayed *}
{assign var="display_analysis_result" value=false} {assign var="display_analysis_result" value=false}
...@@ -136,7 +132,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -136,7 +132,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{assign var="is_admin" value=$projects[key($projects)].is_admin} {assign var="is_admin" value=$projects[key($projects)].is_admin}
{include file='analysis_table.tpl'} {include file='analysis_table.tpl'}
</div> </div>
{if $login_user} {if $login_user}
<div class="tab-pane fade" id="users"> <div class="tab-pane fade" id="users">
<input type="hidden" id="current_project_id" value="{$projects[key($projects)].id}" /> <input type="hidden" id="current_project_id" value="{$projects[key($projects)].id}" />
...@@ -164,22 +160,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -164,22 +160,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</tr> </tr>
</thead> </thead>
{assign var=current_user_values value=""} {assign var=current_user_values value=""}
<tbody> <tbody>
{foreach from=$project_users key=c_user_id item=user_values} {foreach from=$project_users key=c_user_id item=user_values}
{* highlight user personnal line *} {* highlight user personnal line *}
{assign var="emphasis" value=""} {assign var="emphasis" value=""}
{if $user_values.id==$user_id} {if $user_values.id==$user_id}
{assign var=current_user_values value=$user_values} {assign var=current_user_values value=$user_values}
{assign var="emphasis" value="tx-nG6-pi1-line-emphasis"} {assign var="emphasis" value="tx-nG6-pi1-line-emphasis"}
{/if} {/if}
<tr id="tr_user_{$user_values.id}" class="{$emphasis}"> <tr id="tr_user_{$user_values.id}" class="{$emphasis}">
{if ($user_values.cruser_id==$user_id) {if ($user_values.cruser_id==$user_id)
|| $projects[key($projects)].is_admin || $projects[key($projects)].is_admin
|| $projects[key($projects)].is_manager || $projects[key($projects)].is_manager
|| ($user_values.id == $user_id ) || ($user_values.id == $user_id )
|| $is_ng6_admin } || $is_ng6_admin }
<td><center><input type="checkbox" id="chk_user_{$user_values.id}" value="user_{$user_values.id}" /></center> <td><center><input type="checkbox" id="chk_user_{$user_values.id}" value="user_{$user_values.id}" /></center>
{* If the current user is superadmin, it is allowed to update anyone's password. *} {* If the current user is superadmin, it is allowed to update anyone's password. *}
...@@ -193,19 +189,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -193,19 +189,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{else} {else}
<td></td> <td></td>
{/if} {/if}
<td>{$user_values.username}</td> <td>{$user_values.username}</td>
<td>{$user_values.lastlogin}</td> <td>{$user_values.lastlogin}</td>
<td>{$user_values.cruser_name}</td> <td>{$user_values.cruser_name}</td>
{if $user_values.id==$user_id || $user_values.cruser_id==$user_id } {if $user_values.id==$user_id || $user_values.cruser_id==$user_id }
<td class="editable"> <td class="editable">
<span class="editable" data-type="text" data-pk="{$user_id}" data-url="index.php?eID=tx_nG6&type=update_db_field&table=fe_users&field=last_name" data-original-title="Last name">{$user_values.last_name}</span> <span class="editable" data-type="text" data-pk="{$user_id}" data-url="index.php?eID=tx_nG6&type=update_db_field&table=fe_users&field=last_name" data-original-title="Last name">{$user_values.last_name}</span>
</td> </td>
<td class="editable"> <td class="editable">
<span class="editable" data-type="text" data-pk="{$user_id}" data-url="index.php?eID=tx_nG6&type=update_db_field&table=fe_users&field=first_name" data-original-title="First name">{$user_values.first_name}</span> <span class="editable" data-type="text" data-pk="{$user_id}" data-url="index.php?eID=tx_nG6&type=update_db_field&table=fe_users&field=first_name" data-original-title="First name">{$user_values.first_name}</span>
</td> </td>
<td class="editable"> <td class="editable">
<span class="editable" data-type="text" data-pk="{$user_id}" data-url="index.php?eID=tx_nG6&type=update_db_field&table=fe_users&field=email" data-original-title="Email">{$user_values.email}</span> <span class="editable" data-type="text" data-pk="{$user_id}" data-url="index.php?eID=tx_nG6&type=update_db_field&table=fe_users&field=email" data-original-title="Email">{$user_values.email}</span>
</td> </td>
{else} {else}
...@@ -213,14 +209,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -213,14 +209,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<td>{$user_values.first_name}</td> <td>{$user_values.first_name}</td>
<td>{$user_values.email}</td> <td>{$user_values.email}</td>
{/if} {/if}
<td> <td>
{if $user_values.right_id=='2' && !$projects[key($projects)].is_admin} {if $user_values.right_id=='2' && !$projects[key($projects)].is_admin}
<select class="form-control" id="cbb_right_level_{$user_values.id}" name="right_level" disabled> <select class="form-control" id="cbb_right_level_{$user_values.id}" name="right_level" disabled>
<option value="2" selected="selected">Administrator</option> <option value="2" selected="selected">Administrator</option>
</select> </select>
{else} {else}
{if ($projects[key($projects)].is_admin && $user_values.id!=$user_id) {if ($projects[key($projects)].is_admin && $user_values.id!=$user_id)
|| ($projects[key($projects)].is_manager && $user_values.id!=$user_id && $user_values.right_id!='2')} || ($projects[key($projects)].is_manager && $user_values.id!=$user_id && $user_values.right_id!='2')}
{assign var="disabled" value=""} {assign var="disabled" value=""}
{else} {else}
...@@ -230,23 +226,23 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -230,23 +226,23 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{if $projects[key($projects)].is_admin} {if $projects[key($projects)].is_admin}
<option value="2" selected="selected">Administrator</option> <option value="2" selected="selected">Administrator</option>
{/if} {/if}
{if $user_values.right_id=='1'} {if $user_values.right_id=='1'}
<option value="1" selected="selected">Manager</option> <option value="1" selected="selected">Manager</option>
{else} {else}
<option value="1">Manager</option> <option value="1">Manager</option>
{/if} {/if}
{if $user_values.right_id=='0'} {if $user_values.right_id=='0'}
<option value="0" selected="selected">Member</option> <option value="0" selected="selected">Member</option>
{else} {else}
<option value="0">Member</option> <option value="0">Member</option>
{/if} {/if}
</select> </select>
{/if} {/if}
</td> </td>
</tr> </tr>
{/foreach} {/foreach}
</tbody> </tbody>
{assign var="disabled" value=""} {assign var="disabled" value=""}
...@@ -256,17 +252,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -256,17 +252,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{elseif $current_user_values.id==$user_id} {elseif $current_user_values.id==$user_id}
{assign var="disabled" value="disabled"} {assign var="disabled" value="disabled"}
{if $current_user_values.right_id == '0'} {if $current_user_values.right_id == '0'}
{assign var="nou_selection_btn" value=""} {assign var="nou_selection_btn" value=""}
{/if} {/if}
{assign var="multipleu_selection_btn" value=""} {assign var="multipleu_selection_btn" value=""}
{/if} {/if}
<tfoot> <tfoot>
<tr> <tr>
<th align="left" colspan="8"> <th align="left" colspan="8">
With selection : With selection :
<div class="btn-group"> <div class="btn-group">
<button id="add_user" type="button" class="btn {$nou_selection_btn} btn-sm btn-default" {$disabled}><i class="glyphicon glyphicon-plus"></i> add user</button> <button id="add_user" type="button" class="btn {$nou_selection_btn} btn-sm btn-default" {$disabled}><i class="glyphicon glyphicon-plus"></i> add user</button>
<button id="del_user" type="button" class="btn {$multipleu_selection_btn} btn-sm btn-default" {$disabled}><i class="glyphicon glyphicon-minus"></i> delete user</button> <button id="del_user" type="button" class="btn {$multipleu_selection_btn} btn-sm btn-default" {$disabled}><i class="glyphicon glyphicon-minus"></i> delete user</button>
...@@ -278,12 +274,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -278,12 +274,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</table> </table>
</div> </div>
{/if} {/if}
{include file='comments.tpl' comments=$comments tab_id=$comment_tab add_new_comment=$projects[key($projects)].is_admin user_id=$user_id } {include file='comments.tpl' comments=$comments tab_id=$comment_tab add_new_comment=$projects[key($projects)].is_admin user_id=$user_id }
</div> </div>
</div> </div>
{* If multiple projects have to be displayed *} {* If multiple projects have to be displayed *}
{else} {else}
{* Find out if the current user is super user of a project *} {* Find out if the current user is super user of a project *}
...@@ -299,7 +295,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -299,7 +295,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<div class="sub-content sc-top"> <div class="sub-content sc-top">
<div class="ng6-content-header-left project"> <div class="ng6-content-header-left project">
<h2>Projects list <small> you can access </small></h2> <h2>Projects list <small> you can access </small></h2>
</div> </div>
<div class="ng6-content-header-right"> <div class="ng6-content-header-right">
{if $is_ng6_superadmin} {if $is_ng6_superadmin}
...@@ -319,4 +315,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -319,4 +315,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</div> </div>
{/if} {/if}
{include file='../template/modals.tpl'} {include file='../template/modals.tpl'}
This diff is collapsed.
...@@ -16,9 +16,8 @@ ...@@ -16,9 +16,8 @@
# #
from jflow.workflow import Workflow from jflow.workflow import Workflow
from ng6.project import Project from ng6.project import Project
from ng6.config_reader import NG6ConfigReader
from workflows.types import ng6adminlogin, uniqproject, ng6space from workflows.types import ng6adminlogin, uniqproject, ng6space
class AddProject (Workflow): class AddProject (Workflow):
...@@ -27,10 +26,13 @@ class AddProject (Workflow): ...@@ -27,10 +26,13 @@ class AddProject (Workflow):
return "Add a brand new project" return "Add a brand new project"
def define_parameters(self, function="process"): def define_parameters(self, function="process"):
ng6conf = NG6ConfigReader()
space_choices = ng6conf.get_available_spaces()
self.add_parameter("admin_login", "The login of a ng6 administrator", required = True, type = ng6adminlogin) self.add_parameter("admin_login", "The login of a ng6 administrator", required = True, type = ng6adminlogin)
self.add_parameter("project_name", "Give a name to your project (has to be unique)", flag = "--name", required = True, type = uniqproject) self.add_parameter("project_name", "Give a name to your project (has to be unique)", flag = "--name", required = True, type = uniqproject)
self.add_parameter("project_description", "Give a description to your project", flag = "--description", required = True) self.add_parameter("project_description", "Give a description to your project", flag = "--description", required = True)
self.add_parameter("space", "Where to store data", flag = "--space", default="default", type=ng6space) self.add_parameter("space", "Where to store data", flag = "--space", default="shortterm", type=ng6space, choices = space_choices)
def process(self): def process(self):
project = Project(self.project_name, self.project_description, self.admin_login, None, self.space) project = Project(self.project_name, self.project_description, self.admin_login, None, self.space)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment