-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…ds-io/MIPs#120 This change will allow to define pages layout using sections, cells and columns.
- Loading branch information
Showing
37 changed files
with
1,043 additions
and
1,431 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
component/api/src/main/java/org/exoplatform/portal/config/model/Cell.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/** | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2020 - 2024 Meeds Association contact@meeds.io | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package org.exoplatform.portal.config.model; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Setter | ||
@Getter | ||
public class Cell extends Container { | ||
|
||
private int colSpan = 1; | ||
|
||
private int rowSpan = 1; | ||
|
||
private ModelStyle style; | ||
|
||
@Override | ||
public String getCssClass() { | ||
StringBuilder cssClasses = new StringBuilder(); | ||
if (cssClass != null) { | ||
cssClasses.append(cssClass); | ||
} | ||
cssClasses.append(" grid-cell"); | ||
cssClasses.append(" grid-cell-colspan-md-").append(colSpan); | ||
cssClasses.append(" grid-cell-colspan-lg-").append(colSpan); | ||
cssClasses.append(" grid-cell-colspan-xl-").append(colSpan); | ||
cssClasses.append(" grid-cell-rowspan-md-").append(rowSpan); | ||
cssClasses.append(" grid-cell-rowspan-lg-").append(rowSpan); | ||
cssClasses.append(" grid-cell-rowspan-xl-").append(rowSpan); | ||
if (style != null) { | ||
cssClasses.append(" "); | ||
cssClasses.append(style.getCssClass()); | ||
} | ||
return cssClasses.toString(); | ||
} | ||
|
||
@Override | ||
public String getBorderColor() { | ||
if (style != null && style.getBorderColor() != null) { | ||
return style.getBorderColor(); | ||
} else { | ||
return super.getBorderColor(); | ||
} | ||
} | ||
|
||
@Override | ||
public String getTemplate() { | ||
return "CellContainer"; | ||
} | ||
|
||
} |
51 changes: 51 additions & 0 deletions
51
component/api/src/main/java/org/exoplatform/portal/config/model/Column.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2020 - 2024 Meeds Association contact@meeds.io | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package org.exoplatform.portal.config.model; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Setter | ||
@Getter | ||
public class Column extends Container { | ||
|
||
private int colSpan = 1; | ||
|
||
@Override | ||
public String getCssClass() { | ||
StringBuilder cssClasses = new StringBuilder(); | ||
if (cssClass != null) { | ||
cssClasses.append(cssClass); | ||
} | ||
cssClasses.append(" flex-cell"); | ||
cssClasses.append(" grid-cell-colspan-md-").append(colSpan); | ||
cssClasses.append(" grid-cell-colspan-lg-").append(colSpan); | ||
cssClasses.append(" grid-cell-colspan-xl-").append(colSpan); | ||
cssClasses.append(" grid-cell-rowspan-md-1"); | ||
cssClasses.append(" grid-cell-rowspan-lg-1"); | ||
cssClasses.append(" grid-cell-rowspan-xl-1"); | ||
return cssClasses.toString(); | ||
} | ||
|
||
@Override | ||
public String getTemplate() { | ||
return "CellContainer"; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.