Skip to content

Commit

Permalink
Fixed design style
Browse files Browse the repository at this point in the history
  • Loading branch information
maximeor committed Jan 6, 2022
1 parent 4942c15 commit 49cbd9a
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 22 deletions.
2 changes: 1 addition & 1 deletion orif/plafor/Views/acquisition_status/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<p class="bg-primary text-white"><?=lang('plafor_lang.field_linked_comments')?></p>
</div>
<?php if($_SESSION['user_access'] >= config('\User\Config\UserConfig')->access_lvl_trainer) { ?>
<a href="<?= base_url('plafor/apprentice/add_comment/'.$acquisition_status['id']); ?>" class="btn btn-primary"><?= lang('plafor_lang.title_comment_new'); ?></a>
<a style="margin-left: 15px" href="<?= base_url('plafor/apprentice/add_comment/'.$acquisition_status['id']); ?>" class="btn btn-primary"><?= lang('plafor_lang.title_comment_new'); ?></a>
<?php } ?>
<div class="col-md-12">
<table class="table table-hover">
Expand Down
2 changes: 1 addition & 1 deletion orif/plafor/Views/apprentice/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div style="display:flex;flex-direction:row;align-items:center;justify-content:space-between;flex-wrap: wrap">
<?php
echo form_open(base_url('plafor/apprentice/list_apprentice/'), ['method' => 'GET']);
echo form_dropdown('trainer_id', $trainers, strval($trainer_id), ['class' => 'form-control', 'style' => 'width:unset!important;display:unset!important;margin-left:-10px;']);
echo form_dropdown('trainer_id', $trainers, strval($trainer_id), ['class' => 'form-control', 'style' => 'width:unset!important;display:unset!important;']);
echo form_submit(null, lang('common_lang.btn_search'), ['class' => 'btn btn-primary', 'style' => 'vertical-align:unset!important;']); ?>
<?php
echo form_close();
Expand Down
12 changes: 6 additions & 6 deletions orif/plafor/Views/apprentice/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@
<table class="table table-hover table-borderless user-course-details-table">
<tbody>
<tr>
<td class="user-course-details-begin-date"><?=$userCourseMax['date_begin']?></td>
<td class="user-course-details-end-date"><?=$userCourseMax['date_end']?></td>
<td class="user-course-details-status"><?=$user_course_status[$userCourseMax['fk_status']]['name']?></td>
<td class="user-course-details-begin-date"><?=isset($userCourseMax)?$userCourseMax['date_begin']:null?></td>
<td class="user-course-details-end-date"><?=isset($userCourseMax)?$userCourseMax['date_end']:null?></td>
<td class="user-course-details-status"><?=isset($userCourseMax)?$user_course_status[$userCourseMax['fk_status']]['name']:null?></td>

</tr>
</tbody>
Expand All @@ -98,15 +98,15 @@
<div class="row mt-2">
<div class="col-md-12">
<p class="bg-primary text-white"><?=lang('plafor_lang.title_course_plan_status')?></p>
<p class="font-weight-bold user-course-details-course-plan-name"><?= $course_plans[$userCourseMax['fk_course_plan']]['official_name'] ?></p>
<div id="detailsArray" apprentice_id="<?= $apprentice['id'] ?>" course_plan_id="<?=$userCourseMax['fk_course_plan']?>"></div>
<p class="font-weight-bold user-course-details-course-plan-name"><?= isset($userCourseMax)?$course_plans[$userCourseMax['fk_course_plan']]['official_name']:null ?></p>
<div id="detailsArray" apprentice_id="<?= $apprentice['id'] ?>" course_plan_id="<?=isset($userCourseMax)?$userCourseMax['fk_course_plan']:null?>"></div>
</div>
</div>
</div>

<script type="text/babel">
$(document).ready(()=>{
$('#usercourseSelector').val(<?=$userCourseMax['id']?>);
$('#usercourseSelector').val(<?=isset($userCourseMax)?$userCourseMax['id']:null?>);
displayDetails(null,<?=json_encode($userCourseMax)?>,'integrated',"<?=base_url("plafor/apprentice/getcourseplanprogress")?>"+'/',"<?=base_url('plafor/apprentice/view_user_course')?>");
$('#usercourseSelector').change((event)=>{
let userCourses=<?= json_encode($user_courses)?>;
Expand Down
14 changes: 7 additions & 7 deletions orif/plafor/Views/course_plan/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
</div>
</div>
<div class="row" style="justify-content:space-between">
<div class="col-sm-3 text-left">
<div class="col-sm-3">
<a href="<?= base_url('plafor/courseplan/save_course_plan'); ?>" class="btn btn-primary">
<?= lang('common_lang.btn_new_m'); ?>
</a>
</div>
<div style="align-self:flex-end;">
<?=form_checkbox('toggle_deleted', '', $with_archived, [
'id' => 'toggle_deleted', 'class' => 'form-check-input'
]);?>
<?=form_label(lang('common_lang.btn_show_disabled'), 'toggle_deleted', ['class' => 'form-check-label']);?>
</div>
<div style="margin-left: 20px; width:100%; padding: 0 15px 0 15px">
<?=form_checkbox('toggle_deleted', '', $with_archived, [
'id' => 'toggle_deleted', 'class' => 'form-check-input'
]);?>
<?=form_label(lang('common_lang.btn_show_disabled'), 'toggle_deleted', ['class' => 'form-check-label']);?>
</div>
</div>
<div class="row mt-2">
<div class="col-sm-3 offset-6">
Expand Down
53 changes: 49 additions & 4 deletions orif/plafor/Views/operational_competence/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<?php if (service('session')->get('user_access')>=config('\User\Config\UserConfig')->access_lvl_admin): ?>
<a href="<?=base_url('plafor/courseplan/save_objective/0/'.$operational_competence['id']) ?>" class="btn btn-primary"><?= lang('common_lang.btn_new_m')?></a>
<?php endif;?>
<table class="table table-hover">
<table class="responsiveTable table table-hover">
<thead>
<tr>
<th><span class="font-weight-bold"><?=lang('plafor_lang.field_objectives_symbols')?></span></th>
Expand All @@ -81,8 +81,15 @@
if (isset($objectives)):
foreach ($objectives as $objective){
?><tr>
<td><a class="font-weight-bold" href="<?= base_url('plafor/courseplan/view_objective/'.$objective['id'])?>"><?=$objective['symbol']?></a></td>
<td><a href="<?= base_url('plafor/courseplan/view_objective/'.$objective['id'])?>"><?=$objective['taxonomy']?></a></td>
<td>
<a class="font-weight-bold" href="<?= base_url('plafor/courseplan/view_objective/'.$objective['id'])?>"><?=$objective['symbol']?></a>

</td>
<td>
<span class="font-weight-bold descTitle" style="display: none"><?=lang('plafor_lang.field_taxonomy')?></span>
<a href="<?= base_url('plafor/courseplan/view_objective/'.$objective['id'])?>"><?=$objective['taxonomy']?></a>

</td>
<td><a href="<?= base_url('plafor/courseplan/view_objective/'.$objective['id'])?>"><?=$objective['name']?></a></td>
<?php if(service('session')->get('user_access')>=config('\User\Config\UserConfig')->access_lvl_admin):?>
<td><a href="<?= base_url('plafor/courseplan/save_objective/'.$objective['id'].'/'.$operational_competence['id']); ?>"><?= lang('common_lang.btn_edit')?></a></td>
Expand All @@ -95,4 +102,42 @@
</table>
</div>
</div>
</div>
</div>
<script type="text/javascript" defer>
window.addEventListener('resize',()=>{

if (window.innerWidth<476){

if (document.querySelectorAll('.responsiveTable td:nth-child(2) .descTitle').item(0)!==null?window.getComputedStyle(document.querySelectorAll('.responsiveTable td:nth-child(2) .descTitle').item(0)).display!=="none":false)
document.querySelectorAll('.responsiveTable td:nth-child(2)').forEach((element)=>{
let tax=document.createElement('span');
tax.innerHTML=`<span class='taxonomyResponsive'>${element.innerHTML}<span>`

element.previousElementSibling.appendChild(tax);
element.remove();

})
}
else{
document.querySelectorAll('.responsiveTable td:nth-child(1) .taxonomyResponsive').forEach((element)=>{
let td=document.createElement('td');
td.innerHTML=element.innerHTML;
if (element.parentElement.parentElement.nextElementSibling.querySelector('.descTitle')==null)
element.parentElement.parentElement.after(td);
element.remove();
})
}

});
if (window.getComputedStyle(document.querySelectorAll('.responsiveTable td:nth-child(2) .descTitle').item(0)).display!=="none")
document.querySelectorAll('.responsiveTable td:nth-child(2)').forEach((element)=>{
let tax=document.createElement('span');
tax.innerHTML=`<span class='taxonomyResponsive'>${element.innerHTML}<span>`

element.previousElementSibling.appendChild(tax);
element.remove();

})


</script>
4 changes: 2 additions & 2 deletions orif/plafor/Views/user_course/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
|| ($_SESSION['user_access'] == config('\User\Config\UserConfig')->access_lvl_trainer && in_array($_SESSION['user_id'], $trainers_id))
|| ($_SESSION['user_access'] == config('\User\Config\UserConfig')->access_level_apprentice && $user_course['fk_user'] == $apprentice['id'])): ?>
<div class="row">
<p class="font-weight-bold"><?= lang('plafor_lang.field_user_course_objectives_status') ?></p>
<div class="col-md-12">
<p style="margin-left: 15px" class="font-weight-bold"><?= lang('plafor_lang.field_user_course_objectives_status') ?></p>
<div class="col-md-12" >
<table class="table table-hover" id="objectiveListContent">
<thead>
<tr>
Expand Down
24 changes: 23 additions & 1 deletion public/css/MY_styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,26 @@ p.bg-primary {
display: none;
}

}
}
@media all and (max-width: 475px){

.responsiveTable th{
display: none;
}
.responsiveTable td .descTitle{
display: block!important;
font-size: 0.8rem;
color: #665d40;
}
.responsiveTable tr{
display: flex;
}
.responsiveTable td{
display: flex;
flex-direction: column;
justify-content: space-between;
padding-bottom: 10px!important;
}
.responsiveTable td:nth-child(2){
}
}

0 comments on commit 49cbd9a

Please sign in to comment.