condensed view

This commit is contained in:
afornerot 2024-02-16 16:40:41 +01:00
parent 1714bd9a70
commit 1666811787
9 changed files with 124 additions and 74 deletions

View File

@ -370,6 +370,7 @@ class ScrumController extends AbstractController
}
// Préférences utilisateur
$viewcondensed = $em->getRepository("App:User")->getUserpreference($this->getUser(),"viewcondensed",$id);
$filtermilestones = $em->getRepository("App:User")->getUserpreference($this->getUser(),"filtermilestones",$id);
$filtersprints = $em->getRepository("App:User")->getUserpreference($this->getUser(),"filtersprints",$id);
$filterteams = $em->getRepository("App:User")->getUserpreference($this->getUser(),"filterteams",$id);
@ -392,6 +393,7 @@ class ScrumController extends AbstractController
'giteaprioritys' => $giteaprioritys,
'giteatypes' => $giteatypes,
'gitealabels' => $gitealabels,
'viewcondensed' => $viewcondensed,
'filtermilestones' => $filtermilestones,
'filtersprints' => $filtersprints,
'filterteams' => $filterteams,

View File

@ -35,7 +35,7 @@ class ScrumcolumnController extends AbstractController
// Récupérer les repos de gitea
$gitealabels=$this->giteaservice->getLabels($scrum->getGiteajson()["owner"]["login"],$scrum->getGiteajson()["name"]);
if(!is_array($gitealabels)) die("Probleme de connexion avec gitea veuillez vous <a href='/ninegitea/logout'>reconnecter</a>");
if(!is_array($gitealabels)) die("Probleme de connexion avec gitea veuillez vous <a href='/logout'>reconnecter</a>");
// Création du formulaire
$form = $this->createForm(Form::class,$data,array("mode"=>"submit","gitealabels"=>$gitealabels));

View File

@ -182,7 +182,7 @@ class ScrumissueController extends AbstractController
$lastupdate=$scrum->getUpdatedate();
$giteaissues=$this->giteaservice->getIssues($scrum->getGiteajson()["owner"]["login"],$scrum->getGiteajson()["name"]);
if(!is_array($giteaissues)) die("Probleme de connexion avec gitea veuillez vous <a href='/ninegitea/logout'>reconnecter</a>");
if(!is_array($giteaissues)) die("Probleme de connexion avec gitea veuillez vous <a href='/logout'>reconnecter</a>");
foreach($giteaissues as $giteaissue) {
// On ne prend pas les pull request

View File

@ -35,7 +35,7 @@ class ScrumpriorityController extends AbstractController
// Récupérer les repos de gitea
$gitealabels=$this->giteaservice->getLabels($scrum->getGiteajson()["owner"]["login"],$scrum->getGiteajson()["name"]);
if(!is_array($gitealabels)) die("Probleme de connexion avec gitea veuillez vous <a href='/ninegitea/logout'>reconnecter</a>");
if(!is_array($gitealabels)) die("Probleme de connexion avec gitea veuillez vous <a href='/logout'>reconnecter</a>");
// Création du formulaire
$form = $this->createForm(Form::class,$data,array("mode"=>"submit","gitealabels"=>$gitealabels));

View File

@ -35,7 +35,7 @@ class ScrumsprintController extends AbstractController
// Récupérer les repos de gitea
$giteamilestones=$this->giteaservice->getmilestones($scrum->getGiteajson()["owner"]["login"],$scrum->getGiteajson()["name"]);
if(!is_array($giteamilestones)) die("Probleme de connexion avec gitea veuillez vous <a href='".$this->getParameters("appAlias")."/logout'>reconnecter</a>");
if(!is_array($giteamilestones)) die("Probleme de connexion avec gitea veuillez vous <a href='/logout'>reconnecter</a>");
// Création du formulaire
$form = $this->createForm(Form::class,$data,array("mode"=>"submit","giteamilestones"=>$giteamilestones));

View File

@ -35,7 +35,7 @@ class ScrumteamController extends AbstractController
// Récupérer les repos de gitea
$gitealabels=$this->giteaservice->getLabels($scrum->getGiteajson()["owner"]["login"],$scrum->getGiteajson()["name"]);
if(!is_array($gitealabels)) die("Probleme de connexion avec gitea veuillez vous <a href='/ninegitea/logout'>reconnecter</a>");
if(!is_array($gitealabels)) die("Probleme de connexion avec gitea veuillez vous <a href='/logout'>reconnecter</a>");
// Création du formulaire
$form = $this->createForm(Form::class,$data,array("mode"=>"submit","gitealabels"=>$gitealabels));

View File

@ -35,7 +35,7 @@ class ScrumtypeController extends AbstractController
// Récupérer les repos de gitea
$gitealabels=$this->giteaservice->getLabels($scrum->getGiteajson()["owner"]["login"],$scrum->getGiteajson()["name"]);
if(!is_array($gitealabels)) die("Probleme de connexion avec gitea veuillez vous <a href='/ninegitea/logout'>reconnecter</a>");
if(!is_array($gitealabels)) die("Probleme de connexion avec gitea veuillez vous <a href='/logout'>reconnecter</a>");
// Création du formulaire
$form = $this->createForm(Form::class,$data,array("mode"=>"submit","gitealabels"=>$gitealabels));

View File

@ -41,7 +41,7 @@ class ScrumRepository extends ServiceEntityRepository
// Récupérer les labels de gitea
$gitealabels=$this->giteaservice->getLabels($scrum->getGiteajson()["owner"]["login"],$scrum->getGiteajson()["name"]);
if(!is_array($gitealabels)) die("Probleme de connexion avec gitea veuillez vous <a href='/ninegitea/logout'>reconnecter</a>");
if(!is_array($gitealabels)) die("Probleme de connexion avec gitea veuillez vous <a href='/logout'>reconnecter</a>");
// S'assurer que nos colonnes existes toujours
$scrumcolumns=$scrum->getScrumcolumns();
@ -149,7 +149,7 @@ class ScrumRepository extends ServiceEntityRepository
}
}
$giteacollaborators=$this->giteaservice->getCollaborators($scrum->getGiteajson()["owner"]["login"],$scrum->getGiteajson()["name"]);
if(!is_array($giteacollaborators)) die("Probleme de connexion avec gitea veuillez vous <a href='/ninegitea/logout'>reconnecter</a>");
if(!is_array($giteacollaborators)) die("Probleme de connexion avec gitea veuillez vous <a href='/logout'>reconnecter</a>");
foreach($giteacollaborators as $giteacollaborator) {
if(!in_array($giteacollaborator,$giteaassignees))
array_push($giteaassignees,$giteacollaborator);
@ -157,7 +157,7 @@ class ScrumRepository extends ServiceEntityRepository
// Récupérer les milestones de gitea
$giteamilestones=$this->giteaservice->getMilestones($scrum->getGiteajson()["owner"]["login"],$scrum->getGiteajson()["name"],"?state=".($viewclosed=="true"?"all":"open"));
if(!is_array($giteamilestones)) die("Probleme de connexion avec gitea veuillez vous <a href='/ninegitea/logout'>reconnecter</a>");
if(!is_array($giteamilestones)) die("Probleme de connexion avec gitea veuillez vous <a href='/logout'>reconnecter</a>");
$keysort = array_column($giteamilestones, 'title');
array_multisort($keysort, SORT_DESC, $giteamilestones);
@ -172,7 +172,7 @@ class ScrumRepository extends ServiceEntityRepository
// Récupérer les issues de gitea
$giteaissues=$this->giteaservice->getIssues($scrum->getGiteajson()["owner"]["login"],$scrum->getGiteajson()["name"],"?state=".($viewclosed=="true"?"all":"open"));
if(!is_array($giteaissues)) die("Probleme de connexion avec gitea veuillez vous <a href='/ninegitea/logout'>reconnecter</a>");
if(!is_array($giteaissues)) die("Probleme de connexion avec gitea veuillez vous <a href='/logout'>reconnecter</a>");
// Génération des issues
$tbgiteaissues=[];

View File

@ -43,6 +43,8 @@
.state-closed {
background-color: #cdcdcd !important;
}
.text-small { font-size:80%}
{% endblock %}
{% block body %}
@ -125,9 +127,15 @@
</select>
</div>
<div style="width:100%" class="mt-3">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="viewcondensed">
<label class="custom-control-label" for="viewcondensed" style="color:var(--colorfttitledark);">Vue condensée</label>
</div>
</div>
<div style="color:var(--colorftbodydark);zoom:75%;" class="mt-5">
<table>
<table style="width:100%">
{% for jalon in tbestim %}
<tr>
<td>{{jalon.nmjal}}</td>
@ -159,8 +167,11 @@
{% for sprint in jalon.sprints %}
<div class="card mb-3" data-column="{{column.gicol}}" data-milestone="{{jalon.gijal}}" data-sprint="{{sprint.idspr}}" data-millestonesprint="{{jalon.gijal~"-"~sprint.idspr}}">
<div class="card-header p-1" style="font-size:16px">
JALON = {{jalon.nmjal}}<br>
JALON = {{jalon.nmjal}}
{% if sprint.idspr!=-100 %}
<br>
SPRINT = {{sprint.nmspr}}
{% endif %}
</div>
<div class="card-body p-1">
@ -203,70 +214,79 @@
{% endfor %}
<div id="issu{{ issue.id }}" data-id="{{ issue.id }}" data-issue="{{ issue.id }}" data-column="{{column.gicol}}" data-milestone="{{jalon.gijal}}" data-sprint="{{sprint.idspr}}" class="card mb-1 issue issue-{{issue.id}} {{datateams}} {{datatypes}} {{dataprioritys}} {{datalabels}} {{dataassignees}} state-{{issue.giteastate}}">
<div class="card-footer p-1" style="line-height:10px; border-top:none;">
<div class="float-left btn btn-link p-0 m-0 fas fa-arrows-alt" style="cursor:move"></div>
<a target="_blank" class="modcolumn btn btn-link float-right fa fa-file p-0 m-0" href="{{issue.giteajson.html_url}}"></a>
<div class="card-footer p-1 d-flex align-items-center" style="line-height:16px; border-top:none;">
<div class="flex-grow-1 d-flex align-items-center">
<div class="pr-2 issu-id" style="cursor:move">#{{issue.giteanumber}} </div>
<div class="text-small" style="word-break: break-word;">{{ issue.giteatitle }}</div>
</div>
<a target="_blank" class="modcolumn btn btn-link float-right fa fa-file p-0 m-0 pl-1" href="{{issue.giteajson.html_url}}"></a>
</div>
<div class="card-body p-1" style="line-height:10px;">
<div class="card-body p-1 issu-detail">
<div>
<small>
{{issue.giteanumber}} - {{ issue.giteatitle }}<br><br>
<small>Crée le {{issue.giteajson.created_at|date("d/m/y")}}</small><small style ="float:right">Modifié le {{issue.giteajson.updated_at|date("d/m/y")}}</small>
{% if issue.giteastate=="closed" %}
<br><small>Clos le {{issue.giteajson.closed_at|date("d/m/y")}}</small>
{% endif %}
<br><br>
{% for label in issue.giteajson.labels %}
{% if label.id not in giteacolumns and label.id in giteaprioritys %}
<span class="btn-link tag" style="background-color:#{{label.color}}">
<i class="fas fa-tag"></i>
{{ label.name }}
</span>
{% endif %}
{% endfor %}
<br>
{% for label in issue.giteajson.labels %}
{% if label.id not in giteacolumns and label.id in giteatypes %}
<span class="btn-link tag" style="background-color:#{{label.color}}">
<i class="fas fa-tag"></i>
{{ label.name }}
</span>
{% endif %}
{% endfor %}
<br>
{% for label in issue.giteajson.labels %}
{% if label.id not in giteacolumns and label.id in giteateams %}
<span class="btn-link tag" style="background-color:#{{label.color}}">
<i class="fas fa-tag"></i>
{{ label.name }}
</span>
{% endif %}
{% endfor %}
<br>
{% for label in issue.giteajson.labels %}
{% if label.id not in giteacolumns and label.id not in giteateams and label.id not in giteaprioritys and label.id not in giteatypes %}
<span class="btn-link tag" style="background-color:#{{label.color}}">
<i class="fas fa-tag"></i>
{{ label.name }}
</span>
{% endif %}
{% endfor %}
<div>
{% for assignee in issue.giteajson.assignees %}
<img src="{{assignee.avatar_url}}" class="assignee" title="{{assignee.username}}">
{% endfor %}
</div>
<div id="modissu{{ issue.id }}" data-issue="{{ issue.id }}" data-giteaid="{{issue.giteanumber}}" data-giteatitle="{{ issue.giteatitle }}" type="button" class="modissu btn btn-link float-right">
<i class="fas fa-weight-hanging"></i> = <span id="issue{{issue.id}}-weight">{{ issue.weight }}</span>
</div>
</small>
{% for label in issue.giteajson.labels %}
{% if label.id not in giteacolumns and label.id in giteaprioritys %}
<span class="btn-link tag" style="background-color:#{{label.color}}">
<i class="fas fa-tag"></i>
{{ label.name }}
</span>
{% endif %}
{% endfor %}
</div>
<div>
{% for label in issue.giteajson.labels %}
{% if label.id not in giteacolumns and label.id in giteatypes %}
<span class="btn-link tag" style="background-color:#{{label.color}}">
<i class="fas fa-tag"></i>
{{ label.name }}
</span>
{% endif %}
{% endfor %}
</div>
<div>
{% for label in issue.giteajson.labels %}
{% if label.id not in giteacolumns and label.id in giteateams %}
<span class="btn-link tag" style="background-color:#{{label.color}}">
<i class="fas fa-tag"></i>
{{ label.name }}
</span>
{% endif %}
{% endfor %}
</div>
<div>
{% for label in issue.giteajson.labels %}
{% if label.id not in giteacolumns and label.id not in giteateams and label.id not in giteaprioritys and label.id not in giteatypes %}
<span class="btn-link tag" style="background-color:#{{label.color}}">
<i class="fas fa-tag"></i>
{{ label.name }}
</span>
{% endif %}
{% endfor %}
</div>
<div>
{% for assignee in issue.giteajson.assignees %}
<img src="{{assignee.avatar_url}}" class="assignee" title="{{assignee.username}}">
{% endfor %}
</div>
<div id="modissu{{ issue.id }}" class="modissu btn btn-link d-flex justify-content-end align-items-center" data-issue="{{ issue.id }}" data-giteaid="{{issue.giteanumber}}" data-giteatitle="{{ issue.giteatitle }}" type="button">
<i class="fas fa-weight-hanging"></i> = <span id="issue{{issue.id}}-weight">{{ issue.weight }}</span>
</div>
<div class="d-flex">
<div class="text-small">Crée le {{issue.giteajson.created_at|date("d/m/y")}}</div>
<div class="text-small text-right ml-auto">Modifié le {{issue.giteajson.updated_at|date("d/m/y")}}</div>
</div>
{% if issue.giteastate=="closed" %}
<div class="text-small">Clos le {{issue.giteajson.closed_at|date("d/m/y")}}</div>
{% endif %}
</div>
</div>
{% endif %}
@ -334,7 +354,14 @@
$(document).ready(function() {
// Apply Filter
function showhide() {
// Vue condensée
if($("#viewcondensed").is(':checked')) {
$(".issu-detail").hide();
}
else {
$(".issu-detail").show();
}
// Afficher masquer les jalons
if($("#filtermilestones").val().length !== 0 && $("#filtersprints").val().length === 0) {
$("[data-milestone]").hide();
@ -482,6 +509,7 @@
});
}
$("#textfilters").html(textfilters);
}
@ -766,6 +794,26 @@
filterexcludes();
});
// View condensed
{% if viewcondensed %}
$("#viewcondensed").prop( "checked", {{ viewcondensed }} )
{% endif %}
$('#viewcondensed').change(function() {
$.ajax({
method: "POST",
url: "{{ path('app_user_preference') }}",
data: {
key:'viewcondensed',
id:{{scrum.id}},
value: this.checked
}
}).done(function( data ) {
showhide();
});
});
// Resume filtre
{% if not showfilters %}
$("#filters").addClass("d-none");
@ -781,7 +829,7 @@
// Sort columns
$( ".scrumcolumn" ).sortable({
handle: ".fa-arrows-alt",
handle: ".issu-id",
connectWith: ".scrumcolumn",
cursor: "move",
update: function( event, ui ) {