Skip to content

Commit

Permalink
Merge pull request #82 from EiriniGeorgiaDimitriou/jupyter
Browse files Browse the repository at this point in the history
Fix: Added missing CSS file to resolve table view bug
  • Loading branch information
deligianp authored Sep 30, 2024
2 parents 7c1262d + e2e5994 commit fa44405
Show file tree
Hide file tree
Showing 10 changed files with 731 additions and 386 deletions.
3 changes: 1 addition & 2 deletions assets/AppAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ class AppAsset extends AssetBundle
public $css = [
'css/site.css',
];
public $js = [
];
public $js = [];
public $depends = [
'yii\web\YiiAsset',
// 'yii\bootstrap\BootstrapAsset',
Expand Down
1 change: 1 addition & 0 deletions components/EmailVerifiedFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public function beforeAction($action) {

// 2. Check whether the user is authenticated. If the current user is a guest, then move on
if (!$currentUser) return parent::beforeAction($action);

// 3. Check if the user has already a pending email verification request
$email_request=EmailVerificationRequest::find()->where(['user_id'=>$currentUser->id, 'status'=>0])->andwhere(['>', 'expiry', date('c')])->orderBy('created_at DESC')->one();
// if the user has no valid pending email verification request && his email is not set or confirmed
Expand Down
10 changes: 10 additions & 0 deletions controllers/ProjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ public function behaviors()
];
}

public function beforeAction($action)
{
if (!parent::beforeAction($action)) {
return false;
}

// Continue with the action
return true;
}

/**
* {@inheritdoc}
*/
Expand Down
Empty file added models/Announcement.php
Empty file.
2 changes: 1 addition & 1 deletion views/layouts/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
<div class="row footer-first-line">
<div class="col-md-3 text-center copyright">
<?=isset(Yii::$app->params['copyright']) && !empty(Yii::$app->params['copyright']) ? '&copy; ' . Yii::$app->params['copyright'] : '' ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Powered by <?=Html::a('CLIMA', 'https://github.com/athenarc/clima', ['target'=>'_blank'])?>
Powered By <?=Html::a('CLIMA', 'https://github.com/athenarc/clima', ['target'=>'_blank'])?>
</div>
<div class="col-md-offset-2 col-md-1 text-right logo-footer"><?= (isset(Yii::$app->params['logo-footer']) && !empty(Yii::$app->params['logo-footer'])) ? Html::img(Yii::$app->params['logo-footer'],['class'=>"navbar-logo"]) : ''?> </div>
<div class="col-md-offset-2 col-md-2 text-right privacy"><?=Html::a('Privacy & cookie policy',['site/privacy'])?></div>
Expand Down
221 changes: 112 additions & 109 deletions views/project/edit_jupyter.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,151 +10,154 @@
/* @var $this yii\web\View */
/* @var $model app\models\ServiceRequest */
/* @var $form ActiveForm */

echo Html::CssFile('@web/css/project/project-request.css');
$this->registerJsFile('@web/js/project/project-request.js', ['depends' => [\yii\web\JqueryAsset::className()]]);
$this->title="Edit on-demand notebooks project request";
$this->title = "Edit on-demand notebooks project request";
echo $interval;
$participating_label="Participating users <i class='fas fa-question-circle' title='Type 3 or more characters of the desired ELIXIR-AAI username to get suggestions'></i>";
$cancel_icon='<i class="fas fa-times"></i>';
$exclamation_icon='<i class="fas fa-exclamation-triangle" style="color:orange" title="The Vm belongs to an expired project"></i>';
$participating_label = "Participating users <i class='fas fa-question-circle' title='Type 3 or more characters of the desired ELIXIR-AAI username to get suggestions'></i>";
$cancel_icon = '<i class="fas fa-times"></i>';
$exclamation_icon = '<i class="fas fa-exclamation-triangle" style="color:orange" title="The Vm belongs to an expired project"></i>';


if($autoacceptlimits->ram==$upperlimits->ram)
{
$ram_label= "Maximum allowed memory per server (in GBs) * <span class=limits-label> [upper limits: $upperlimits->ram] </span>";
}
else
{
$ram_label= "Maximum allowed memory per server (in GBs) * <span class=limits-label> [upper limits: $autoacceptlimits->ram (automatically accepted), $upperlimits->ram (with review)] </span>";
if ($autoacceptlimits->ram == $upperlimits->ram) {
$ram_label = "Maximum allowed memory per server (in GBs) * <span class=limits-label> [upper limits: $upperlimits->ram] </span>";
} else {
$ram_label = "Maximum allowed memory per server (in GBs) * <span class=limits-label> [upper limits: $autoacceptlimits->ram (automatically accepted), $upperlimits->ram (with review)] </span>";
}


if($autoacceptlimits->cores==$upperlimits->cores)
{
$cores_label= "Available cores per server * <span class=limits-label> [upper limits: $autoacceptlimits->cores] </span>" ;
}
else
{
$cores_label= "Available cores per server * <span class=limits-label> [upper limits: $autoacceptlimits->cores (automatically accepted), $upperlimits->cores (with review)] </span>" ;
if ($autoacceptlimits->cores == $upperlimits->cores) {
$cores_label = "Available cores per server * <span class=limits-label> [upper limits: $autoacceptlimits->cores] </span>";
} else {
$cores_label = "Available cores per server * <span class=limits-label> [upper limits: $autoacceptlimits->cores (automatically accepted), $upperlimits->cores (with review)] </span>";
}

$participants_label= "Maximum number of users to participate in the project * <span class=limits-label> [upper limit: $upperlimits->participants] </span>" ;
$participants_label = "Maximum number of users to participate in the project * <span class=limits-label> [upper limit: $upperlimits->participants] </span>";





if (!empty($errors))
{
if (!empty($errors)) {
echo '<div class="alert alert-danger row" role="alert">';
echo $errors;
echo '</div>';

}
Headers::begin() ?>
<?php echo Headers::widget(
['title'=>'Edit on-demand notebooks project request',])
?>
<?Headers::end()?>
['title' => 'Edit on-demand notebooks project request',]
)
?>
<? Headers::end() ?>

<div class="row ">
<div class="col-md-13">
<div class="alert alert-warning width:960px;" role="alert">
<td class="col-md-2 align-middle"><?=$exclamation_icon ?></td>
Please keep in mind that:<br>
&#x2022; if you change the amount of RAM and/or CPU allocated to each server, that would lead to permanent deletion of all active servers of your project.<br>
&#x2022; if you remove any user from the project, their server will be permanently deleted.<br>
&#x2022; if you change the jupyter server type, all active server of your project will be permanently deleted.<br>
</div>
</div>

<div class="col-md-13">
<div class="alert alert-warning width:960px;" role="alert">
<td class="col-md-2 align-middle"><?= $exclamation_icon ?></td>
Please keep in mind that:<br>
&#x2022; if you change the amount of RAM and/or CPU allocated to each server, that would lead to permanent
deletion of all active servers of your project.<br>
&#x2022; if you remove any user from the project, their server will be permanently deleted.<br>
&#x2022; if you change the jupyter server type, all active server of your project will be permanently
deleted.<br>
</div>

</div>
</div>


<div class="jupyter_project">

<div class="row"><div class="col-md-12"> * All fields marked with asterisk are mandatory</div></div>
<div class="row">
<div class="col-md-12"> * All fields marked with asterisk are mandatory</div>
</div>

<?php $form = ActiveForm::begin($form_params); ?>
<?= $form->errorSummary($project) ?>
<?= $form->errorSummary($details) ?>
<div class="row box">
<div class="col-md-6">
<h3>Project details</h3>
<?= $form->errorSummary($project) ?>
<?= $form->errorSummary($details) ?>
<div class="row box">
<div class="col-md-6">
<h3>Project details</h3>


<?= $form->field($project, 'name')->textInput(['readonly' => true, 'value' =>$project['name']]) ?>
<div style="margin-bottom: 20px;">
<?php if($exceed_limits == 0){
echo '<label> Project end date * </label>';
echo DatePicker::widget([
'model' => $project,
'attribute' => 'end_date',
'options' => array('readonly' => 'readonly'),
'pluginOptions' => [
'endDate'=>"+".($upperlimits->duration-$interval)."D",
'readonly' => 'true',
'autoclose'=>true,
'format'=>'yyyy-m-d'
]
]);}?>
<?php if($exceed_limits == 1){
echo '<label> Project end date * </label>';
echo DatePicker::widget([
'model' => $project,
'attribute' => 'end_date',
'options' => array('readonly' => 'readonly'),
'pluginOptions' => [
'autoclose'=>true,
'format'=>'yyyy-m-d'
]
]);}?>
</div>
<?= $form->field($details, 'participants_number')->label($participants_label) ?>

<?= Html::label($participating_label, 'user_search_box', ['class'=>'blue-label']) ?>
<br/>
<?= MagicSearchBox::widget(
['min_char_to_start' => Yii::$app->params["minUsernameLength"] ?? 1,
'expansion' => 'right',
'suggestions_num' => 5,
'html_params' => [ 'id' => 'user_search_box',
'name'=>'participants',
'class'=>'form-control blue-rounded-textbox'],
'ajax_action' => Url::toRoute('project/auto-complete-names'),
'participating' => $participating,
]);
?>
<br />


<?= $form->field($project, 'name')->textInput(['readonly' => true, 'value' => $project['name']]) ?>
<div style="margin-bottom: 20px;">
<?php if ($exceed_limits == 0) {
echo '<label> Project end date * </label>';
echo DatePicker::widget([
'model' => $project,
'attribute' => 'end_date',
'options' => array('readonly' => 'readonly'),
'pluginOptions' => [
'endDate' => "+" . ($upperlimits->duration - $interval) . "D",
'readonly' => 'true',
'autoclose' => true,
'format' => 'yyyy-m-d'
]
]);
} ?>
<?php if ($exceed_limits == 1) {
echo '<label> Project end date * </label>';
echo DatePicker::widget([
'model' => $project,
'attribute' => 'end_date',
'options' => array('readonly' => 'readonly'),
'pluginOptions' => [
'autoclose' => true,
'format' => 'yyyy-m-d'
]
]);
} ?>
</div>

<?= $form->field($details, 'participants_number')->label($participants_label) ?>

<?= Html::label($participating_label, 'user_search_box', ['class' => 'blue-label']) ?>
<br />
<?= MagicSearchBox::widget(
[
'min_char_to_start' => Yii::$app->params["minUsernameLength"] ?? 1,
'expansion' => 'right',
'suggestions_num' => 5,
'html_params' => [
'id' => 'user_search_box',
'name' => 'participants',
'class' => 'form-control blue-rounded-textbox'
],
'ajax_action' => Url::toRoute('project/auto-complete-names'),
'participating' => $participating,
]
);
?>
<br />



</div>
<div class="col-md-6">
<h3>Analysis information details</h3>


<?= $form->field($details, 'description')->textarea(['rows'=>6]); ?>
<?= $form->field($details, 'image')->dropDownList($images) ?>

<div class="col-md-6">
<h3>Analysis information details</h3>
<?= $form->field($details, 'description')->textarea(['rows' => 6]); ?>
<?= $form->field($details, 'image')->dropDownList($images) ?>

</div>
</div>
</div>


<div class="row">
<div class="col-md-12">
<h3>Requested resources</h3>
</div>
</div>
<div class="row">&nbsp;</div>

<?= $form->field($details, 'cores')->label($cores_label) ?>
<?= $form->field($details, 'ram')->label($ram_label) ?>


<div class="form-group">
<?= Html::submitButton('<i class="fas fa-check"></i> Submit', ['class' => 'btn btn-primary']) ?>
<?= Html::a("$cancel_icon Cancel", ['/project/index'], ['class'=>'btn btn-default']) ?>
<div class="row">
<div class="col-md-12">
<h3>Requested resources</h3>
</div>
</div>
<div class="row">&nbsp;</div>

<?= $form->field($details, 'cores')->label($cores_label) ?>
<?= $form->field($details, 'ram')->label($ram_label) ?>


<div class="form-group">
<?= Html::submitButton('<i class="fas fa-check"></i> Submit', ['class' => 'btn btn-primary']) ?>
<?= Html::a("$cancel_icon Cancel", ['/project/index'], ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
Loading

0 comments on commit fa44405

Please sign in to comment.