Skip to content

Commit

Permalink
Adding support for button links with entity Link: true
Browse files Browse the repository at this point in the history
  • Loading branch information
computate committed Oct 9, 2024
1 parent 39b3a25 commit f290b26
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/main/java/org/computate/frFR/java/EcrireGenClasse.java
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,7 @@ public class EcrireGenClasse extends EcrireClasse {
Boolean entiteStocke;

Boolean entiteVarTitre;
Boolean entiteLien;

Boolean entiteVarH1;

Expand Down
33 changes: 30 additions & 3 deletions src/main/java/org/computate/frFR/java/EcrirePageClasse.java
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ else if("Boolean".equals(entiteNomSimple)) {
tl(11, "class=\"label-on-left {{", langueConfig.getString(I18n.var_classeApiMethodeMethode), "}}_", entiteVar, " class", classeNomSimple, " input", classeNomSimple, "{{", classeModele ? classeVarClePrimaire : classeVarCleUnique, "}}", entiteVarCapitalise, " \"");
tl(11, "name=\"set", entiteVarCapitalise, "\"");
tl(11, "data-", classeModele ? classeVarClePrimaire : classeVarCleUnique, "=\"{{ ", classeModele ? classeVarClePrimaire : classeVarCleUnique, " }}\"");
tl(11, "data-val=\"{{ ", uncapitalizeClasseNomSimple, "_.", entiteVar, " }}\"");
tl(11, "data-val=\"{{ ", uncapitalizeClasseNomSimple, "_.", entiteVar, " | e }}\"");
t(11, ">");
if(entiteNomAffichage != null) {
sx(entiteNomAffichage);
Expand Down Expand Up @@ -593,6 +593,30 @@ else if(BooleanUtils.isTrue(entiteSignature)) {

}
else {
//STUFF1
if(entiteLien) {
tl(1, "{%- if 'Page' == ", langueConfig.getString(I18n.var_classeApiMethodeMethode), " %}");
tl(9, "<sl-button");
tl(11, "id=\"{{", langueConfig.getString(I18n.var_classeApiMethodeMethode), "}}_", entiteVar, "\"");

if(entiteNomAffichage != null) {
tl(11, "placeholder=\"", entiteDefaut == null ? entiteNomAffichage : entiteDefaut, "\"");
tl(11, "label=\"", entiteDefaut == null ? entiteNomAffichage : entiteDefaut, "\"");
}
if(entiteDescription != null) {
t(11, "help-text=\"").sx(entiteDescription).l("\"");
}

tl(11, "class=\"label-on-left {{", langueConfig.getString(I18n.var_classeApiMethodeMethode), "}}_", entiteVar, " class", classeNomSimple, " input", classeNomSimple, "{{", classeModele ? classeVarClePrimaire : classeVarCleUnique, "}}", entiteVarCapitalise, " \"");
tl(11, "name=\"set", entiteVarCapitalise, "\"");
tl(11, "href=\"{{ ", uncapitalizeClasseNomSimple, "_.", entiteVar, " | e }}\"");
t(11, ">");
if(entiteNomAffichage != null) {
sx(entiteNomAffichage);
}
l("</sl-button>");
tl(1, "{%- else %}");
}
if(entiteMultiligne)
tl(9, "<sl-textarea resize=\"auto\"");
else {
Expand Down Expand Up @@ -655,6 +679,9 @@ else if(BooleanUtils.isTrue(entiteSignature)) {
tl(11, "></sl-input>");

l();
if(entiteLien) {
tl(1, "{%- endif %}");
}
}

tl(1, "{%- if 'Page' == ", langueConfig.getString(I18n.var_classeApiMethodeMethode), " %}");
Expand Down Expand Up @@ -1038,6 +1065,7 @@ public void pageCodeClasseJava(String langueNom, JsonObject langueConfig) throws
entiteIndexe = (Boolean)entiteDocumentSolr.get("entiteIndexe_stored_boolean");
entiteStocke = (Boolean)entiteDocumentSolr.get("entiteStocke_stored_boolean");
entiteVarTitre = (Boolean)entiteDocumentSolr.get("entiteVarTitre_stored_boolean");
entiteLien = BooleanUtils.isTrue((Boolean)entiteDocumentSolr.get("entiteLien_stored_boolean"));
entiteVarH1 = (Boolean)entiteDocumentSolr.get("entiteVarH1_stored_boolean");
entiteVarH2 = (Boolean)entiteDocumentSolr.get("entiteVarH2_stored_boolean");
entiteVarH3 = (Boolean)entiteDocumentSolr.get("entiteVarH3_stored_boolean");
Expand Down Expand Up @@ -1108,7 +1136,6 @@ public void pageCodeClasseJava(String langueNom, JsonObject langueConfig) throws
} else {
wJsModuleInit.l();
wJsModuleInit.tl(5, "// PATCH ", entiteVar);
//STUFF0
if(!entiteTexte && !entiteSuggere && entiteIndexe
&& entiteFacetsTrouves
&& !langueConfig.getString(I18n.var_sessionId).equals(entiteVar)
Expand Down Expand Up @@ -2207,6 +2234,7 @@ public void pageCodeClasseJinja(String langueNom, JsonObject i18nPage) throws Ex
Boolean entiteMultiligne = BooleanUtils.isTrue((Boolean)entiteDocumentSolr.get("entiteMultiligne_stored_boolean"));
Boolean entiteHighlighting = BooleanUtils.isTrue((Boolean)entiteDocumentSolr.get("entiteHighlighting_stored_boolean"));
Boolean entiteVarTitre = BooleanUtils.isTrue((Boolean)entiteDocumentSolr.get("entiteVarTitre_stored_boolean"));
Boolean entiteLien = BooleanUtils.isTrue((Boolean)entiteDocumentSolr.get("entiteLien_stored_boolean"));
Boolean entiteFacetsTrouves = Optional.ofNullable((Boolean)entiteDocumentSolr.get("entiteFacetsTrouves_stored_boolean")).orElse(false);
List<String> entiteFacets = Optional.ofNullable((List<String>)entiteDocumentSolr.get("entiteFacets_stored_strings")).orElse(Arrays.asList());
if(entiteHtml) {
Expand Down Expand Up @@ -4276,7 +4304,6 @@ else if(classeApiMethode.contains(i18nPage.getString(I18n.var_PUTCopie)))
t(8, "<sl-checkbox");
s(" name=\"pageFacetPivot\"");
s(" class=\"pageFacetPivot \"");
//STUFF0
s(" id=\"pageFacetPivot", classeNomSimple, "_{{ key }}\"");
s(" value=\"{{ value.var }}\"");
s("{% if ", i18nPage.getString(I18n.var_pivot), " is defined %} checked=\"checked\"{% endif %}");
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/computate/frFR/java/I18n.java
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ public class I18n {
public static final String var_LeNomAdjectif = "var_LeNomAdjectif";
public static final String var_LeNom = "var_LeNom";
public static final String var_LesNoms = "var_LesNoms";
public static final String var_Lien = "var_Lien";
public static final String var_Ligne = "var_Ligne";
public static final String var_lignes = "var_lignes";
public static final String var_Lignes = "var_Lignes";
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/computate/frFR/java/IndexerClasse.java
Original file line number Diff line number Diff line change
Expand Up @@ -3352,6 +3352,7 @@ else if("LocalTime".equals(entiteMapCleType) && NumberUtils.isCreatable(entiteMa
indexerStockerSolr(classeLangueNom, entiteDoc, "entiteEnumVar", regexLangue(classeLangueNom, "^EnumVar", methodeCommentaire));
indexerStockerSolr(classeLangueNom, entiteDoc, "entiteEnumVarDescription", regexLangue(classeLangueNom, "^" + i18nGlobale.getString(I18n.var_EnumVarDescription), methodeCommentaire));
indexerStockerSolr(classeLangueNom, entiteDoc, "entiteImageBase64Url", regexLangue(classeLangueNom, "^ImageBase64Url", methodeCommentaire));
indexerStockerSolr(entiteDoc, "entiteLien", regexTrouve("^" + i18nGlobale.getString(I18n.var_Lien) + ":\\s*(true)$", methodeCommentaire));
Boolean entiteCouleur = indexerStockerSolr(entiteDoc, "entiteCouleur", regexTrouve("^" + i18nGlobale.getString(I18n.var_Couleur) + ":\\s*(true)$", methodeCommentaire));
if(entiteCouleur)
indexerStockerSolr(classeDoc, "classeEntiteCouleur", entiteVar);
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/org/computate/i18n/i18n_enUS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ var_Largeur: "Width"
var_LeNomAdjectif: "TheNameAdjective"
var_LeNom: "TheName"
var_LesNoms: "ThePluralName"
var_Lien: "Link"
var_Ligne: "Line"
var_lignes: "rows"
var_Lignes: "Rows"
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/org/computate/i18n/i18n_frFR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ var_Largeur: "Largeur"
var_LeNomAdjectif: "LeNomAdjectif"
var_LeNom: "LeNom"
var_LesNoms: "LesNom"
var_Lien: "Lien"
var_Ligne: "Ligne"
var_lignes: "lignes"
var_Lignes: "Lignes"
Expand Down

0 comments on commit f290b26

Please sign in to comment.