Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
lektor
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Kubat
lektor
Validations
2a7d8b33
Vérifiée
Valider
2a7d8b33
rédigé
1 year ago
par
Kubat
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
AMADEUS: Show more informations about playlists
parent
69fdd2f4
Aucune branche associée trouvée
Branches contenant la validation
Aucune étiquette associée trouvée
1 requête de fusion
!197
Draft: Refactor the whole code.
Modifications
1
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
1 fichier modifié
amadeus/src/components/mainpanel/playlists.rs
+43
-3
43 ajouts, 3 suppressions
amadeus/src/components/mainpanel/playlists.rs
avec
43 ajouts
et
3 suppressions
amadeus/src/components/mainpanel/playlists.rs
+
43
−
3
Voir le fichier @
2a7d8b33
use
crate
::
components
::{
self
,
icon
,
karalist
,
tip
};
use
crate
::{
components
::{
self
,
icon
,
karalist
,
tip
},
style_sheet
::
sizes
::
SIZE_FONT_MOAR
,
};
use
chrono
::
TimeZone
;
use
hashbrown
::
HashMap
;
use
hashbrown
::
HashMap
;
use
iced
::{
widget
::
row
,
Command
,
Element
};
use
iced
::{
widget
::{
column
,
horizontal_rule
,
row
,
text
,
vertical_space
},
Command
,
Element
,
};
use
lektor_payloads
::{
KId
,
Kara
,
PlaylistInfo
};
use
lektor_payloads
::{
KId
,
Kara
,
PlaylistInfo
};
use
lektor_utils
::
log
;
use
lektor_utils
::
log
;
use
std
::
sync
::
Arc
;
use
std
::
sync
::
Arc
;
...
@@ -169,7 +176,40 @@ impl State {
...
@@ -169,7 +176,40 @@ impl State {
pub
fn
view
(
&
self
,
plt
:
&
Arc
<
str
>
)
->
Element
<
'_
,
Request
>
{
pub
fn
view
(
&
self
,
plt
:
&
Arc
<
str
>
)
->
Element
<
'_
,
Request
>
{
self
.get
(
plt
)
self
.get
(
plt
)
.map
(|(
plt
,
_
,
content
)|
content
.view
()
.map
(|
req
|
Request
::
Inner
(
plt
.clone
(),
req
)))
.map
(|(
plt
,
infos
,
content
)|
{
infos
.map
(|
infos
|
{
let
PlaylistInfo
{
user
,
..
}
=
infos
;
let
mut
column
=
user
.as_ref
()
.map
(|
user
|
{
column!
[
text
(
format!
(
"Created by: {user}"
))
.size
(
SIZE_FONT_MOAR
)]
})
.unwrap_or_default
();
if
let
Some
(
time
)
=
chrono
::
Local
.timestamp_opt
(
infos
.created_at
,
0
)
.latest
()
{
let
time
=
time
.format
(
"%Y-%m-%d %H:%M:%S"
);
column
=
column
.push
(
vertical_space
(
4
))
.push
(
text
(
format!
(
"Created at: {time}"
)));
};
if
let
Some
(
time
)
=
chrono
::
Local
.timestamp_opt
(
infos
.updated_at
,
0
)
.latest
()
{
let
time
=
time
.format
(
"%Y-%m-%d %H:%M:%S"
);
column
=
column
.push
(
vertical_space
(
4
))
.push
(
text
(
format!
(
"Updated at: {time}"
)));
};
column
.push
(
vertical_space
(
10
))
.push
(
horizontal_rule
(
4
))
})
.unwrap_or_default
()
.push
(
content
.view
()
.map
(|
req
|
Request
::
Inner
(
plt
.clone
(),
req
)))
.into
()
})
.unwrap_or
(
components
::
loading
())
.unwrap_or
(
components
::
loading
())
}
}
}
}
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter