Maintenance - Mise à jour mensuelle Lundi 6 Avril 2020 entre 7h00 et 9h00

Commit 68e66f2b authored by Penom Nom's avatar Penom Nom

add comments support for project, run and analyses

parent 8520b0d6
......@@ -1009,6 +1009,61 @@ CREATE TABLE IF NOT EXISTS `tx_nG6_sample` (
KEY `parent` (`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `tx_nG6_comment` (
`uid` int(11) NOT NULL AUTO_INCREMENT,
`pid` int(11) NOT NULL DEFAULT '0',
`tstamp` int(11) NOT NULL DEFAULT '0',
`crdate` int(11) NOT NULL DEFAULT '0',
`cruser_id` int(11) NOT NULL DEFAULT '0',
`deleted` tinyint(4) NOT NULL DEFAULT '0',
`hidden` tinyint(4) NOT NULL DEFAULT '0',
`comment` text NOT NULL DEFAULT '',
PRIMARY KEY (`uid`),
KEY `parent` (`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `tx_nG6_project_comment` (
`uid` int(11) NOT NULL AUTO_INCREMENT,
`pid` int(11) NOT NULL DEFAULT '0',
`tstamp` int(11) NOT NULL DEFAULT '0',
`crdate` int(11) NOT NULL DEFAULT '0',
`cruser_id` int(11) NOT NULL DEFAULT '0',
`deleted` tinyint(4) NOT NULL DEFAULT '0',
`hidden` tinyint(4) NOT NULL DEFAULT '0',
`project_id` int(11) NOT NULL DEFAULT '0',
`comment_id` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`uid`),
KEY `parent` (`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `tx_nG6_run_comment` (
`uid` int(11) NOT NULL AUTO_INCREMENT,
`pid` int(11) NOT NULL DEFAULT '0',
`tstamp` int(11) NOT NULL DEFAULT '0',
`crdate` int(11) NOT NULL DEFAULT '0',
`cruser_id` int(11) NOT NULL DEFAULT '0',
`deleted` tinyint(4) NOT NULL DEFAULT '0',
`hidden` tinyint(4) NOT NULL DEFAULT '0',
`run_id` int(11) NOT NULL DEFAULT '0',
`comment_id` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`uid`),
KEY `parent` (`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `tx_nG6_analyze_comment` (
`uid` int(11) NOT NULL AUTO_INCREMENT,
`pid` int(11) NOT NULL DEFAULT '0',
`tstamp` int(11) NOT NULL DEFAULT '0',
`crdate` int(11) NOT NULL DEFAULT '0',
`cruser_id` int(11) NOT NULL DEFAULT '0',
`deleted` tinyint(4) NOT NULL DEFAULT '0',
`hidden` tinyint(4) NOT NULL DEFAULT '0',
`analyze_id` int(11) NOT NULL DEFAULT '0',
`comment_id` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`uid`),
KEY `parent` (`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `tx_rsaauth_keys` (
`uid` int(11) NOT NULL AUTO_INCREMENT,
`pid` int(11) NOT NULL DEFAULT '0',
......
......@@ -265,6 +265,55 @@ class tx_nG6_eid {
tx_nG6_db::update_field($table, $id, $field, $value);
}
print $value;
}
// add comment
else if ($type == 'add_comment') {
$view = trim(t3lib_div::_GP('view'));
$view_id = trim(t3lib_div::_GP('view_id')); // project_id or run_id or analyze_id
$new_comment = trim(t3lib_div::_GP('new_comment'));
$cruser_id = trim(t3lib_div::_GP('cruser_id'));
$res = 0 ;
if ($new_comment){
if($view == 'project'){
$res = tx_nG6_db::add_project_comment($view_id, $cruser_id, $new_comment) ;
}
elseif ($view == 'run') {
$res = tx_nG6_db::add_run_comment($view_id, $cruser_id, $new_comment) ;
}
elseif ($view == 'analyze') {
$res = tx_nG6_db::add_analyze_comment($view_id, $cruser_id, $new_comment) ;
}
}
print $res;
}
//delete comment
else if ($type == 'delete_comment') {
$view = trim(t3lib_div::_GP('view'));
$view_id = trim(t3lib_div::_GP('view_id')); // project_id or run_id or analyze_id
$comment_id = trim(t3lib_div::_GP('comment_id'));
$res = 0 ;
if($view == 'project'){
$res = tx_nG6_db::delete_project_comment($view_id, $comment_id);
}
elseif ($view == 'run') {
$res = tx_nG6_db::delete_run_comment($view_id, $comment_id);
}
elseif ($view == 'analyze') {
$res = tx_nG6_db::delete_analyze_comment($view_id, $comment_id);
}
print $res;
}
//update comment
else if ($type == 'update_comment') {
$comment_id = trim(t3lib_div::_GP('comment_id'));
$new_comment = trim(t3lib_div::_GP('new_comment'));
$res = 0;
$new_comment = urldecode($new_comment);
$res = tx_nG6_db::update_comment($comment_id, $new_comment);
print $res;
// If asked the krona page
} else if ($type == 'get_krona') {
......
......@@ -335,10 +335,140 @@ class tx_nG6_db {
return $final_results;
}
/**
* Add a comment to the comment table
* @param unknown $table_name
* @param unknown $id_label
* @param unknown $element_id
* @param unknown $cruser_id
* @param unknown $new_comment
*/
function add_comment($table_name, $id_label, $id, $cruser_id, $new_comment){
$new_comment = htmlentities($new_comment, ENT_QUOTES | ENT_COMPAT | ENT_HTML5);
$comment_data = array(
'cruser_id' => $cruser_id,
'comment' => $new_comment,
'tstamp' => time(),
'crdate' => time()
);
$GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_nG6_comment', $comment_data);
$comment_id = $GLOBALS['TYPO3_DB']->sql_insert_id();
$comment_link_data = array(
'cruser_id' => $cruser_id,
$id_label => $id,
'comment_id' => $comment_id,
'tstamp' => time(),
'crdate' => time()
);
$GLOBALS['TYPO3_DB']->exec_INSERTquery($table_name, $comment_link_data);
return $GLOBALS['TYPO3_DB']->sql_insert_id();
}
/**
* Retrieve all comments from a given project, run or analysis
* @param unknown $table_name
* @param unknown $id_label
* @param unknown $uid
* @return multitype:multitype:unknown
*/
function get_all_comments($table_name, $id_label, $id){
$comments = array();
$temp = array();
$queryParts = array(
'SELECT' => 'tx_nG6_comment.uid AS comment_id, '.
'tx_nG6_comment.comment AS comment, '.
'tx_nG6_comment.cruser_id AS cruser_id, '.
'tx_nG6_comment.crdate AS comment_crdate ',
'FROM' => $table_name .' INNER JOIN tx_nG6_comment ON '. $table_name . '.comment_id=tx_nG6_comment.uid',
'WHERE' => $table_name . '.' . $id_label . '=' . $id,
'ORDERBY' => 'comment_id',
);
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$comment_id = $row['comment_id'];
if (!isset ($temp['comment_'.$comment_id])) {
$temp['comment_'.$comment_id] = '';
$user_info = tx_nG6_db::get_user_informations($row['cruser_id']);
$comments[] = array(
'id' => $comment_id,
'comment' => html_entity_decode($row['comment'], ENT_QUOTES | ENT_COMPAT | ENT_HTML5),
'date' => date( 'd.M.Y-H:i' ,$row['comment_crdate']),
'cruser_info' => $user_info,
);
}
}
return $comments;
}
/**
* Delete a given commentary from the database
* @param unknown $table_name
* @param unknown $id_label
* @param unknown $id
* @param unknown $comment_id
*/
function delete_comment($table_name, $id_label, $id, $comment_id){
$res = 0 ;
//from association table
$where = $table_name.'.'.$id_label.'='.$id . ' AND tx_nG6_comment.comment_id='.$comment_id ;
$res = $GLOBALS['TYPO3_DB']-> exec_DELETEquery ($table_name, $where);
if($res == 0){
//from comment table
$where = 'tx_nG6_comment.uid='.$comment_id ;
$res = $GLOBALS['TYPO3_DB']-> exec_DELETEquery ('tx_nG6_comment', $where);
if ($res != 1) {
$res = 1 ;
}
}
return $res ;
}
/**
* Update an existing comment
* @param unknown $comment_id
* @param unknown $new_comment
*/
function update_comment($comment_id, $new_comment){
return $GLOBALS['TYPO3_DB']-> exec_UPDATEquery ('tx_nG6_comment', 'uid='.$comment_id, array('comment' => $new_comment));
}
/*
* Project functions
*------------------------------------------------------------*/
/**
* Add a comment to the project described by project_id
* @param unknown $project_id
* @param unknown $cruser_id
* @param unknown $new_comment
*/
function add_project_comment($project_id, $cruser_id, $new_comment){
return tx_nG6_db::add_comment('tx_nG6_project_comment', 'project_id', $project_id, $cruser_id, $new_comment);
}
/**
* Retrieve all comments from a given project
* @param unknown $project_id
*/
function get_all_project_comments($project_id){
return tx_nG6_db::get_all_comments('tx_nG6_project_comment', 'project_id', $project_id);
}
/**
* Delete a given project comment
* @param unknown $project_id
* @param unknown $comment_id
*/
function delete_project_comment($project_id, $comment_id){
return tx_nG6_db::delete_comment('tx_nG6_project_comment', 'project_id', $project_id, $comment_id);
}
/**
* Select all project for the current user
*
......@@ -859,6 +989,32 @@ class tx_nG6_db {
* Run functions
*------------------------------------------------------------*/
/**
* Add a comment to the run described by run_id
* @param unknown $run_id
* @param unknown $cruser_id
* @param unknown $new_comment
*/
function add_run_comment($run_id, $cruser_id, $new_comment){
return tx_nG6_db::add_comment('tx_nG6_run_comment', 'run_id', $run_id, $cruser_id, $new_comment);
}
/**
* Retrieve all comments from a given run
* @param unknown $run_id
*/
function get_all_run_comments($run_id){
return tx_nG6_db::get_all_comments('tx_nG6_run_comment', 'run_id', $run_id);
}
/**
* Delete a given run comment
* @param unknown $run_id
* @param unknown $comment_id
*/
function delete_run_comment($run_id, $comment_id){
return tx_nG6_db::delete_comment('tx_nG6_run_comment', 'run_id', $run_id, $comment_id);
}
/**
* Select all run for the specified user
......@@ -1303,6 +1459,35 @@ class tx_nG6_db {
* Analysis functions
*------------------------------------------------------------*/
/**
* Add a comment to the analysis described by $analyze_id
* @param unknown $analyze_id
* @param unknown $cruser_id
* @param unknown $new_comment
*/
function add_analyze_comment($analyze_id, $cruser_id, $new_comment){
return tx_nG6_db::add_comment('tx_nG6_analyze_comment', 'analyze_id', $analyze_id, $cruser_id, $new_comment);
}
/**
* Retrieve all comments from a given analysis
* @param unknown $run_id
*/
function get_all_analyze_comments($analyze_id){
return tx_nG6_db::get_all_comments('tx_nG6_analyze_comment', 'analyze_id', $analyze_id);
}
/**
* Delete a given analyze comment
* @param unknown $run_id
* @param unknown $comment_id
*/
function delete_analyze_comment($analyze_id, $comment_id){
return tx_nG6_db::delete_comment('tx_nG6_analyze_comment', 'analyze_id', $analyze_id, $comment_id);
}
/**
* Select all information on an analyse
*
......
......@@ -141,6 +141,8 @@ class tx_nG6_upgrade {
// finaly update storage fields
tx_nG6_upgrade::set_storage_size($data_storage);
// add comment support
tx_nG6_upgrade::add_comment_support();
}
function set_storage_size($data_storage) {
......@@ -188,6 +190,84 @@ class tx_nG6_upgrade {
return $full_size;
}
function add_comment_support(){
// Create comment table
$queryCreatecomment = "
CREATE TABLE IF NOT EXISTS `tx_nG6_comment` (
`uid` int(11) NOT NULL AUTO_INCREMENT,
`pid` int(11) NOT NULL DEFAULT '0',
`tstamp` int(11) NOT NULL DEFAULT '0',
`crdate` int(11) NOT NULL DEFAULT '0',
`cruser_id` int(11) NOT NULL DEFAULT '0',
`deleted` tinyint(4) NOT NULL DEFAULT '0',
`hidden` tinyint(4) NOT NULL DEFAULT '0',
`comment` text NOT NULL DEFAULT '',
PRIMARY KEY (`uid`),
KEY `parent` (`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
";
// Create project_comment table
$queryCreateProjectcomment = "
CREATE TABLE IF NOT EXISTS `tx_nG6_project_comment` (
`uid` int(11) NOT NULL AUTO_INCREMENT,
`pid` int(11) NOT NULL DEFAULT '0',
`tstamp` int(11) NOT NULL DEFAULT '0',
`crdate` int(11) NOT NULL DEFAULT '0',
`cruser_id` int(11) NOT NULL DEFAULT '0',
`deleted` tinyint(4) NOT NULL DEFAULT '0',
`hidden` tinyint(4) NOT NULL DEFAULT '0',
`project_id` int(11) NOT NULL DEFAULT '0',
`comment_id` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`uid`),
KEY `parent` (`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
";
// Create run_comment table
$queryCreateRuncomment = "
CREATE TABLE IF NOT EXISTS `tx_nG6_run_comment` (
`uid` int(11) NOT NULL AUTO_INCREMENT,
`pid` int(11) NOT NULL DEFAULT '0',
`tstamp` int(11) NOT NULL DEFAULT '0',
`crdate` int(11) NOT NULL DEFAULT '0',
`cruser_id` int(11) NOT NULL DEFAULT '0',
`deleted` tinyint(4) NOT NULL DEFAULT '0',
`hidden` tinyint(4) NOT NULL DEFAULT '0',
`run_id` int(11) NOT NULL DEFAULT '0',
`comment_id` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`uid`),
KEY `parent` (`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
";
// Create analyze_comment table
$queryCreateAnalyzecomment = "
CREATE TABLE IF NOT EXISTS `tx_nG6_analyze_comment` (
`uid` int(11) NOT NULL AUTO_INCREMENT,
`pid` int(11) NOT NULL DEFAULT '0',
`tstamp` int(11) NOT NULL DEFAULT '0',
`crdate` int(11) NOT NULL DEFAULT '0',
`cruser_id` int(11) NOT NULL DEFAULT '0',
`deleted` tinyint(4) NOT NULL DEFAULT '0',
`hidden` tinyint(4) NOT NULL DEFAULT '0',
`analyze_id` int(11) NOT NULL DEFAULT '0',
`comment_id` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`uid`),
KEY `parent` (`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
";
/*
* Execute all queries
*/
$GLOBALS['TYPO3_DB']->sql_query($queryCreatecomment);
$GLOBALS['TYPO3_DB']->sql_query($queryCreateProjectcomment);
$GLOBALS['TYPO3_DB']->sql_query($queryCreateRuncomment);
$GLOBALS['TYPO3_DB']->sql_query($queryCreateAnalyzecomment);
}
/*
* version 1.2
*------------------------------------------------------------*/
......
......@@ -16,8 +16,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*}
<input type="hidden" id="analyse_name" value="{$analyse.name}"/>
<input type="hidden" id="view" value="analyze" />
<input type="hidden" id="ids" value="{$analyze_id}" />
<input type="hidden" id="server_url" value="{$server_url}" />
<input type="hidden" id="user_login" value="{$user_login}" />
<input type="hidden" id="user_id" value="{$user_id}" />
<div class="sub-content sc-top">
{block name=description}
......@@ -54,6 +57,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<li><a href="#downloads" data-toggle="tab">{block name=downloads_title} Downloads {/block}</a></li>
{/block}
{assign var="comment_tab" value="analysis_comments"}
<li><a href="#{$comment_tab}" data-toggle="tab">Comments</a></li>
{block name=nav_menu_update}{/block}
</ul>
......@@ -125,6 +131,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</div>
{/block}
{include file='../comments.tpl' comments=$comments tab_id=$comment_tab add_new_comment=$is_project_admin user_id=$user_id}
{block name=tab_content_update}{/block}
</div>
{/block}
......
......@@ -66,7 +66,9 @@ class tx_nG6_pi1 extends tslib_pibase {
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/bootstrap.min.js"></script>
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/bootstrap-editable.min.js"></script>
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/bootstrap-datepicker.js"></script>
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/bootstrap-typeahead.js"></script>
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/bootstrap-typeahead.js"></script>
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/wysihtml5-0.3.0.min.js"></script>
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/bootstrap-wysihtml5-0.0.2.min.js"></script>
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/DT_bootstrap.js"></script>
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/jquery.validate.js"></script>
......@@ -81,6 +83,7 @@ class tx_nG6_pi1 extends tslib_pibase {
<link type="text/css" rel="stylesheet" media="screen" href="'.t3lib_extMgm::siteRelPath($this->extKey).'res/css/jflow.css"/>
<link type="text/css" rel="stylesheet" media="screen" href="'.t3lib_extMgm::siteRelPath($this->extKey).'res/css/bootstrap.min.css"/>
<link type="text/css" rel="stylesheet" media="screen" href="'.t3lib_extMgm::siteRelPath($this->extKey).'res/css/bootstrap-responsive.min.css"/>
<link type="text/css" rel="stylesheet" media="screen" href="'.t3lib_extMgm::siteRelPath($this->extKey).'res/css/bootstrap-wysihtml5-0.0.2.css"/>
<link type="text/css" rel="stylesheet" media="screen" href="'.t3lib_extMgm::siteRelPath($this->extKey).'res/css/DT_bootstrap.css"/>
<link type="text/css" rel="stylesheet" media="screen" href="'.t3lib_extMgm::siteRelPath($this->extKey).'res/css/bootstrap-editable.css"/>
<link type="text/css" rel="stylesheet" media="screen" href="'.t3lib_extMgm::siteRelPath($this->extKey).'res/css/datepicker.css"/>
......@@ -192,7 +195,11 @@ class tx_nG6_pi1 extends tslib_pibase {
// If it's a single project, add runs and analysis information
if ($single_project_display) {
//comments on the project
$comments = tx_nG6_db::get_all_project_comments($projects[key($projects)]['id']);
$smarty->assign('comments', $comments);
// Get all users on project
$project_users = tx_nG6_db::get_all_users_on_project($projects[key($projects)]['id']);
$smarty->assign('project_users', $project_users);
......@@ -277,6 +284,11 @@ class tx_nG6_pi1 extends tslib_pibase {
// If it's a single run, add analysis information
if ($single_run_display) {
//comments on the run
$comments = tx_nG6_db::get_all_run_comments($runs[key($runs)]['id']);
$smarty->assign('comments', $comments);
$run_analysis = tx_nG6_db::get_run_analysis($runs[key($runs)]['id']);
// Add some information to the table
foreach($run_analysis as $analysis_id => $analysis_values) {
......@@ -341,11 +353,16 @@ class tx_nG6_pi1 extends tslib_pibase {
$smarty->assign('analyze_id', $this->piVars['analyze_id']);
$smarty->assign('server_url', $this->conf['server_url']);
$smarty->assign('user_login', $GLOBALS['TSFE']->fe_user->user['username']);
$smarty->assign('user_id', $GLOBALS['TSFE']->fe_user->user['uid']);
// Then select analyse results
$results = tx_nG6_db::select_analyse_results($this->piVars['analyze_id']);
$smarty->assign('analyse_results', $results);
//comments on the analysis
$comments = tx_nG6_db::get_all_analyze_comments($this->piVars['analyze_id']);
$smarty->assign('comments', $comments);
// Select the run file description
if ($analyse['run_id'] != 'None') {
$descriptions = tx_nG6_db::select_mid_descriptions($analyse['run_id']);
......
{*
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 class="tab-pane fade comment-tab" id="{$tab_id}">
{if $comments}
{foreach from=$comments key=comm_id item=cdata}
<div class="comment-block" id="comment_id_{$cdata.id}">
<div class='comment-block-header'>
<i class="icon-user"></i>{$cdata.cruser_info.username}
{$cdata.date}
{if $cdata.cruser_info.uid == $user_id}
<small ><a class="comment-edit" href="" >edit</a> <a class="comment-delete" href="">delete</a></small>
{/if}
</div>
<div class="comment-block-body">{$cdata.comment}</div>
</div>
{/foreach}
{else}
No comments have been added yet
{/if}
{if $add_new_comment}
<div class="new-comment-block">
New comment
<textarea class="wysihtml5-textarea" ></textarea>
<div style="text-align : right;"><button id="post-comment" type="button" class="btn btn-small btn-primary">Post comment</button></div>
</div>
{/if}
</div>
......@@ -62,6 +62,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{if $login_user}
<li><a href="#users" data-toggle="tab">Users</a></li>
{/if}
{assign var="comment_tab" value="project_comments"}
<li><a href="#{$comment_tab}" data-toggle="tab">Comments</a></li>
</ul>
<div id="myTabContent" class="tab-content">
......@@ -223,6 +225,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</table>
</div>
{/if}
{include file='comments.tpl' comments=$comments tab_id=$comment_tab add_new_comment=$projects[key($projects)].is_admin user_id=$user_id }
</div>
</div>
......
......@@ -80,6 +80,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<ul id="myTab" class="nav nav-tabs">
<li class="active"><a href="#analyses" data-toggle="tab">Analyses</a></li>
<li><a href="#downloads" data-toggle="tab">Raw data</a></li>
{assign var="comment_tab" value="run_comments"}
<li><a href="#{$comment_tab}" data-toggle="tab">Comments</a></li>
</ul>
<div id="myTabContent" class="tab-content">
......@@ -115,6 +117,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</div>
{/if}
</div>
{include file='comments.tpl' comments=$comments tab_id=$comment_tab add_new_comment=$runs[key($runs)].is_admin user_id=$user_id }
</div>
</div>
......@@ -183,4 +188,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<button id="refresh_workflow" class="btn"><i class="icon-refresh"></i> Refresh</button>
<button id="rerun_workflow" class="btn btn-primary"><i class="icon-cog icon-white"></i> ReRun</button>
</div>
</div>
\ No newline at end of file
</div>
ul.wysihtml5-toolbar {
margin: 0;
padding: 0;
display: block;
}
ul.wysihtml5-toolbar::after {
clear: both;
display: table;
content: "";
}
ul.wysihtml5-toolbar > li {
float: left;
display: list-item;
list-style: none;
margin: 0 5px 10px 0;
}
ul.wysihtml5-toolbar a[data-wysihtml5-command=bold] {
font-weight: bold;
}
ul.wysihtml5-toolbar a[data-wysihtml5-command=italic] {
font-style: italic;
}
ul.wysihtml5-toolbar a[data-wysihtml5-command=underline] {
text-decoration: underline;
}
ul.wysihtml5-toolbar a.btn.wysihtml5-command-active {
background-image: none;
-webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);
background-color: #E6E6E6;
background-color: #D9D9D9;
outline: 0;
}
ul.wysihtml5-commands-disabled .dropdown-menu {
display: none !important;
}
ul.wysihtml5-toolbar div.wysihtml5-colors {
display:block;
width: 50px;
height: 20px;
margin-top: 2px;
margin-left: 5px;
position: absolute;
pointer-events: none;
}
ul.wysihtml5-toolbar a.wysihtml5-colors-title {
padding-left: 70px;
}
ul.wysihtml5-toolbar div[data-wysihtml5-command-value="black"] {
background: black !important;
}
ul.wysihtml5-toolbar div[data-wysihtml5-command-value="silver"] {
background: silver !important;
}
ul.wysihtml5-toolbar div[data-wysihtml5-command-value="gray"] {
background: gray !important;
}
ul.wysihtml5-toolbar div[data-wysihtml5-command-value="maroon"] {
background: maroon !important;
}
ul.wysihtml5-toolbar div[data-wysihtml5-command-value="red"] {
background: red !important;
}
ul.wysihtml5-toolbar div[data-wysihtml5-command-value="purple"] {
background: purple !important;
}
ul.wysihtml5-toolbar div[data-wysihtml5-command-value="green"] {
background: green !important;
}
ul.wysihtml5-toolbar div[data-wysihtml5-command-value="olive"] {
background: olive !important;
}
ul.wysihtml5-toolbar div[data-wysihtml5-command-value="navy"] {
background: navy !important;
}
ul.wysihtml5-toolbar div[data-wysihtml5-command-value="blue"] {
background: blue !important;
}
ul.wysihtml5-toolbar div[data-wysihtml5-command-value="orange"] {
background: orange !important;
}
......@@ -260,6 +260,56 @@ td.editable:hover {
background-color: #f0f2f2 !important;
}
/* Comment block*/
div.comment-tab{
margin : 0 5px 5px 5px;
}
div.comment-block{
/*padding : 5px 15px 0 15px;*/