Commit 5b6dadb1 authored by oughdi's avatar oughdi
Browse files

Add RBAC persmissions for site ressource

parent 962c102e
......@@ -124,6 +124,17 @@ public final class ClusterHome
return listCluster;
}
/**
* Load the data of all the cluster objects without sites and returns them as a list
*
* @return the list which contains the data of all the cluster objects
*/
public static List<Cluster> getClustersListWithoutSites( )
{
return _dao.selectClustersList( _plugin );
}
/**
* Load the id of all the cluster objects and returns them as a list
*
......
......@@ -37,17 +37,25 @@ import javax.validation.constraints.*;
import org.apache.commons.lang.StringUtils;
import org.hibernate.validator.constraints.*;
import fr.paris.lutece.portal.service.rbac.RBACResource;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
// TODO: Auto-generated Javadoc
/**
* This is the business class for the object Site.
*/
public class Site extends AbstractReleaserResource implements Serializable
public class Site extends AbstractReleaserResource implements RBACResource, Serializable
{
// RBAC management
public static final String RESOURCE_TYPE = "site";
private HashMap<String, Boolean> permissions;
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;
......@@ -510,5 +518,35 @@ public class Site extends AbstractReleaserResource implements Serializable
// TODO Auto-generated method stub
return getNextReleaseVersion( );
}
/**
* RBAC resource implementation
* @return The resource type code
*/
public String getResourceTypeCode( )
{
return RESOURCE_TYPE;
}
/**
* RBAC resource implementation
* @return The resourceId
*/
public String getResourceId( )
{
return String.valueOf( _nId );
}
public HashMap<String, Boolean> getPermissions() {
return permissions;
}
public void setPermissions(HashMap<String, Boolean> permissions) {
if ( this.permissions == null) this.permissions = new HashMap<String, Boolean>( );
else this.permissions.clear();
this.permissions.putAll( permissions );
}
}
......@@ -3,6 +3,13 @@ plugin.provider=City of Paris
plugin.description=Releaser components, sites and clusters
#RBAC Resources
rbac.site.resourceType=site
rbac.site.permission.create=Add sites
rbac.site.permission.view=View sites
rbac.site.permission.modify=Modify sites
rbac.site.permission.delete=Delete sites
# Admin features keys
adminFeature.ManageSites.name=ManageSites
......
......@@ -9,6 +9,13 @@ adminFeature.ManageReleaser.name=Mont\u00e9e de version des composants Lut\u00e8
adminFeature.ManageReleaser.description=Mont\u00e9e de version des composants Lut\u00e8ce
#RBAC Resources
rbac.site.resourceType=sites
rbac.site.permission.create=Ajouter des sites
rbac.site.permission.view=Visualiser les sites
rbac.site.permission.modify=Modifier des sites
rbac.site.permission.delete=Supprimer des sites
# Business classes keys
......
package fr.paris.lutece.plugins.releaser.service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import fr.paris.lutece.plugins.releaser.business.Cluster;
import fr.paris.lutece.plugins.releaser.business.ClusterHome;
import fr.paris.lutece.plugins.releaser.business.Site;
import fr.paris.lutece.plugins.releaser.business.SiteHome;
import fr.paris.lutece.portal.business.user.AdminUser;
import fr.paris.lutece.portal.service.rbac.RBACService;
/**
* ClusterService.
*/
public class ClusterService
{
// Permissions
private static final String PERMISSION_ADD_SITE = "addSitePermission";
private static final String PERMISSION_VIEW_SITE = "viewSitePermission";
private static final String PERMISSION_MODIFY_SITE = "modifySitePermission";
private static final String PERMISSION_DELETE_SITE = "deleteSitePermission";
/**
* Load the liste of sites into each cluster object and returns the list of clusters
*
* @return the list which contains the data of all the cluster objects
*/
public static List<Cluster> getClustersListWithSites( AdminUser adminUser)
{
List<Cluster> listCluster = ClusterHome.getClustersList( );
for ( Cluster cluster : listCluster )
{
List<Site> listSite = SiteHome.findByCluster( cluster.getId( ) );
for ( Site site : listSite )
{
cluster.getSites().add( site );
}
}
return listCluster;
}
/**
* Load the liste of sites into each cluster object and returns the list of clusters
*
* @return the list which contains the data of all the cluster objects
*/
public static List<Cluster> getClustersListWithAuthorizedSites( AdminUser adminUser)
{
List<Cluster> listCluster = ClusterHome.getClustersList( );
List<Cluster> listClusterWithAuthorizedSites = new ArrayList<Cluster>( );
HashMap<String, Boolean> sitePermissions = new HashMap<String, Boolean>( );
for ( Cluster cluster : listCluster )
{
Cluster clusterWithAuthorizedList = cluster;
List<Site> listAuthorizedSites = new ArrayList<Site>( );
List<Site> listSite = SiteHome.findByCluster( cluster.getId( ) );
for ( Site site : listSite )
{
if ( RBACService.isAuthorized( Site.RESOURCE_TYPE, site.getResourceId(),
SiteResourceIdService.PERMISSION_VIEW, adminUser ) )
{
sitePermissions.clear();
// Add site's permissions
sitePermissions.put(PERMISSION_VIEW_SITE, true);
if (RBACService.isAuthorized( Site.RESOURCE_TYPE, site.getResourceId(),
SiteResourceIdService.PERMISSION_ADD, adminUser ))
{
sitePermissions.put(PERMISSION_ADD_SITE, true);
}
else
{
sitePermissions.put(PERMISSION_ADD_SITE, false);
}
if (RBACService.isAuthorized( Site.RESOURCE_TYPE, site.getResourceId(),
SiteResourceIdService.PERMISSION_MODIFY, adminUser ))
{
sitePermissions.put(PERMISSION_MODIFY_SITE, true);
}
else
{
sitePermissions.put(PERMISSION_MODIFY_SITE, false);
}
if (RBACService.isAuthorized( Site.RESOURCE_TYPE, site.getResourceId(),
SiteResourceIdService.PERMISSION_DELETE, adminUser ))
{
sitePermissions.put(PERMISSION_DELETE_SITE, true);
}
else
{
sitePermissions.put(PERMISSION_DELETE_SITE, false);
}
// Add permissions to the site
site.setPermissions( sitePermissions );
// Add the site to list of Authorized sites
listAuthorizedSites.add( site );
}
}
if ( listAuthorizedSites != null && !listAuthorizedSites.isEmpty( ) )
{
clusterWithAuthorizedList.setSites( listAuthorizedSites );
listClusterWithAuthorizedSites.add( clusterWithAuthorizedList );
}
}
return listClusterWithAuthorizedSites;
}
}
package fr.paris.lutece.plugins.releaser.service;
import java.util.List;
import java.util.Locale;
import fr.paris.lutece.plugins.releaser.business.Site;
import fr.paris.lutece.plugins.releaser.business.SiteHome;
import fr.paris.lutece.portal.service.rbac.Permission;
import fr.paris.lutece.portal.service.rbac.ResourceIdService;
import fr.paris.lutece.portal.service.rbac.ResourceType;
import fr.paris.lutece.portal.service.rbac.ResourceTypeManager;
import fr.paris.lutece.portal.service.util.AppLogService;
import fr.paris.lutece.util.ReferenceList;
/**
*
* class SiteResourceIdService
*
*/
public final class SiteResourceIdService extends ResourceIdService
{
private static final String PROPERTY_LABEL_RESOURCE_TYPE = "releaser.rbac.site.resourceType";
private static final String PROPERTY_LABEL_CREATE = "releaser.rbac.site.permission.create";
private static final String PROPERTY_LABEL_VIEW = "releaser.rbac.site.permission.view";
private static final String PROPERTY_LABEL_MODIFY = "releaser.rbac.site.permission.modify";
private static final String PROPERTY_LABEL_DELETE = "releaser.rbac.site.permission.delete";
private static final String PLUGIN_NAME = "releaser";
/** Permission for creating site */
public static final String PERMISSION_ADD = "ADD";
/** Permission for viewing site */
public static final String PERMISSION_VIEW = "VIEW";
/** Permission for deleting site */
public static final String PERMISSION_DELETE = "DELETE";
/** Permission for modifying site */
public static final String PERMISSION_MODIFY = "MODIFY";
/** Creates a new instance of SuggestTypeResourceIdService */
public SiteResourceIdService( )
{
setPluginName( PLUGIN_NAME );
}
@Override
public void register() {
ResourceType rt = new ResourceType( );
rt.setResourceIdServiceClass( SiteResourceIdService.class.getName( ) );
rt.setPluginName( PLUGIN_NAME );
rt.setResourceTypeKey( Site.RESOURCE_TYPE );
rt.setResourceTypeLabelKey( PROPERTY_LABEL_RESOURCE_TYPE );
Permission p = new Permission( );
p.setPermissionKey( PERMISSION_ADD );
p.setPermissionTitleKey( PROPERTY_LABEL_CREATE );
rt.registerPermission( p );
p = new Permission( );
p.setPermissionKey( PERMISSION_VIEW );
p.setPermissionTitleKey( PROPERTY_LABEL_VIEW );
rt.registerPermission( p );
p = new Permission( );
p.setPermissionKey( PERMISSION_MODIFY );
p.setPermissionTitleKey( PROPERTY_LABEL_MODIFY );
rt.registerPermission( p );
p = new Permission( );
p.setPermissionKey( PERMISSION_DELETE );
p.setPermissionTitleKey( PROPERTY_LABEL_DELETE );
rt.registerPermission( p );
ResourceTypeManager.registerResourceType( rt );
}
@Override
public ReferenceList getResourceIdList(Locale local) {
ReferenceList referenceListSite = new ReferenceList( );
List<Site> listSites = SiteHome.getSitesList();
for ( Site site : listSites )
{
referenceListSite.addItem( site.getId(), site.getName() );
}
return referenceListSite;
}
@Override
public String getTitle( String strId, Locale locale )
{
int nIdSite = -1;
try
{
nIdSite = Integer.parseInt( strId );
}
catch ( NumberFormatException ne )
{
AppLogService.error( ne );
}
Site site = SiteHome.findByPrimaryKey( nIdSite );
return site.getName();
}
}
......@@ -52,6 +52,7 @@ import java.util.concurrent.Future;
import javax.servlet.http.HttpServletRequest;
import javax.xml.bind.JAXBException;
import fr.paris.lutece.plugins.releaser.business.Cluster;
import fr.paris.lutece.plugins.releaser.business.Component;
import fr.paris.lutece.plugins.releaser.business.Dependency;
import fr.paris.lutece.plugins.releaser.business.ReleaserUser;
......@@ -727,5 +728,6 @@ public class SiteService
}
}
}
......@@ -39,16 +39,23 @@ import fr.paris.lutece.plugins.releaser.business.ReleaserUser;
import fr.paris.lutece.plugins.releaser.business.RepositoryType;
import fr.paris.lutece.plugins.releaser.business.Site;
import fr.paris.lutece.plugins.releaser.business.SiteHome;
import fr.paris.lutece.plugins.releaser.service.ClusterService;
import fr.paris.lutece.plugins.releaser.service.SiteResourceIdService;
import fr.paris.lutece.plugins.releaser.service.SiteService;
import fr.paris.lutece.plugins.releaser.util.ConstanteUtils;
import fr.paris.lutece.plugins.releaser.util.ReleaserUtils;
import fr.paris.lutece.portal.business.user.AdminUser;
import fr.paris.lutece.portal.service.admin.AdminUserService;
import fr.paris.lutece.portal.service.message.AdminMessage;
import fr.paris.lutece.portal.service.message.AdminMessageService;
import fr.paris.lutece.portal.service.rbac.RBACResource;
import fr.paris.lutece.portal.service.rbac.RBACService;
import fr.paris.lutece.portal.util.mvc.admin.annotations.Controller;
import fr.paris.lutece.portal.util.mvc.commons.annotations.Action;
import fr.paris.lutece.portal.util.mvc.commons.annotations.View;
import fr.paris.lutece.util.url.UrlItem;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
......@@ -136,7 +143,7 @@ public class ClusterJspBean extends ManageSitesJspBean
// Session variable to store working values
private Cluster _cluster;
private Site _site;
private Site _site;
/**
* Build the Manage View
......@@ -150,8 +157,11 @@ public class ClusterJspBean extends ManageSitesJspBean
{
_cluster = null;
_site = null;
List<Cluster> listClusters = ClusterHome.getClustersList( );
List<Cluster> listClusters = ClusterService.getClustersListWithAuthorizedSites(AdminUserService.getAdminUser(request));
Map<String, Object> model = getPaginatedListModel( request, MARK_CLUSTER_LIST, listClusters, JSP_MANAGE_CLUSTERS );
model.put( ConstanteUtils.MARK_USER, ReleaserUtils.getReleaserUser( request, getLocale( ) ) );
model.put( MARK_IS_APPLICATION_ACCOUNT, ReleaserUtils.isApplicationAccountEnable( ) );
model.put( ConstanteUtils.MARK_REPO_TYPE_GITHUB, RepositoryType.GITHUB );
......@@ -162,13 +172,12 @@ public class ClusterJspBean extends ManageSitesJspBean
// Load information site after authentication error
int nId = Integer.parseInt( request.getParameter( PARAMETER_ID_SITE_ERROR ) );
model.put( MARK_SITE, SiteHome.findByPrimaryKey( nId ) );
}
return getPage( PROPERTY_PAGE_TITLE_MANAGE_CLUSTERS, TEMPLATE_MANAGE_CLUSTERS, model );
}
/**
/**
* Returns the form to create a cluster
*
* @param request
......@@ -232,7 +241,6 @@ public class ClusterJspBean extends ManageSitesJspBean
// Check constraints
if ( !validateBean( user, VALIDATION_ATTRIBUTES_USER_PREFIX ) )
{
redirectView( request, VIEW_MANAGE_CLUSTERS );
}
......@@ -481,5 +489,4 @@ public class ClusterJspBean extends ManageSitesJspBean
return redirectView( request, VIEW_MANAGE_SITES );
}
}
......@@ -40,6 +40,15 @@
</admin-feature>
</admin-features>
<!-- RBAC Resources -->
<rbac-resource-types>
<rbac-resource-type>
<rbac-resource-type-class>
fr.paris.lutece.plugins.releaser.service.SiteResourceIdService
</rbac-resource-type-class>
</rbac-resource-type>
</rbac-resource-types>
<!-- Admin css -->
<admin-css-stylesheets>
<admin-css-stylesheet>css/admin/AdminLTEv2.css</admin-css-stylesheet>
......
<#include "releaser_util.html" /> <@tform class='form-inline pull-right' name='manage_cluster' action='jsp/admin/plugins/releaser/ManageClusters.jsp'> <button class="floating-button" name="view_createCluster" type="submit" title="#i18n{releaser.manage_clusters.buttonAdd}"> <i class="fa fa-plus"></i> </button></@tform><#if !is_application_account> <button class="floating-button btn-release-site btn-release-site-bg" title="Releaser un composant" data-toggle="modal" data-target="#modalReleaseComponentGITHUB"> <i class="fa fa-cog" aria-hidden="true"></i> <span class="hidden hidden-xs">Releaser un composant</span> </button><#else> <a class="floating-button btn-release-site btn-release-site-bg" href="jsp/admin/plugins/releaser/ManageComponent.jsp" title="Modifier"> <i class="fa fa-cog" aria-hidden="true"></i> <span class="hidden hidden-xs">Releaser un composant</span> </a></#if><div class="app-wrapper app-cluster"><@messages infos=infos /><@messages errors=errors /><#if errors?? && site??> <#list errors as error> <#if error.message == "AUTHENTICATION_ERROR"> <script> $( function(){ var pathElem="#modalRelease${site.getRepoType().name()!} .release-id"; $(pathElem).val(${site.id}); $("#modalRelease${site.getRepoType().name()!}").modal(); }); </script> </#if> </#list></#if><#list cluster_list as cluster> <a name="cluster${cluster.id}" ></a> <!-- widget-app --> <div class="box box-widget widget-app collapsed-box"> <div class="info-box" > <span class="info-box-icon bg-green"><i class="fa fa-cubes"></i></span> <div class="info-box-content"> <div class="col-xs-12 col-sm-11 col-md-11" > <span class="hidden"></span> <h4>${cluster.name} <span class="info-box-number hidden-xs"><#if cluster.sites?size &gt; 0 >${cluster.sites?size} sites <#else> <span class="text-warning"><i class="fa fa-warning"></i> Aucun site ajout&eacute;</span> </#if></span> <@tform class='form-inline' name='manage_site' action='jsp/admin/plugins/releaser/ManageClusters.jsp'> <input type="hidden" name="id" value="${cluster.id}"> <a class="btn btn-danger btn-xs" href="jsp/admin/plugins/releaser/ManageClusters.jsp?action=confirmRemoveCluster&amp;id=${cluster.id}" title="Supprimer"> <i class="fa fa-trash fa-fw" aria-hidden="true"></i> <span class="sr-only">Supprimer</span> </a> <a class="btn btn-primary btn-xs" href="jsp/admin/plugins/releaser/ManageClusters.jsp?view=modifyCluster&amp;id=${cluster.id}" title="Modifier"> <i class="fa fa-pencil fa-fw" aria-hidden="true"></i> <span class="sr-only">Modifier</span> </a> <button type="submit" class="btn btn-success btn-xs" name="view_createSite" title="#i18n{releaser.manage_sites.buttonAdd}"> <i class="fa fa-plus fa-fw"></i> <span class="sr-only">#i18n{releaser.manage_sites.buttonAdd}</span> </button> </@tform> </h4> </div> <div class="hidden-xs"> <#if cluster.sites?size &gt; 0 > <button type="button" class="btn btn-default collaspe pull-right" data-widget="collapse"> <i class="fa fa-plus"></i> </button> </#if> </div> </div> </div> <div class="box-body"> <h2 class="hidden"> <strong>${cluster.description}</strong> <small>Liste des sites du cluster</small></h2> <ul class="nav nav-stacked clearfix"> <#if cluster.sites?size &gt; 0> <#list cluster.sites as site> <li class="info-padding"> <div class="row"> <div class="col-xs-8 col-sm-8"> <h4 title="repository : ${site.scmUrl}"> ${site.name} <span class="label label-info label-app pull-right hidden-xs" title="Artifact ID : ${site.artifactId}"> <i class="fa fa-cube fa-fw"></i> ${site.artifactId} </span> </h4> <small><span class="hidden-xs">${site.description}</span> [<a href="${site.scmUrl}">${site.scmUrl}</a>] </small> </div> <div class="col-xs-4 col-sm-4"> <#if !is_application_account> <button class="button border-green btn-release-site" data-id-site="${site.id}" data-repo-type="${site.getRepoType().name()!}" title="Releaser" data-toggle="modal" data-target="#modalRelease${site.getRepoType().name()!}"> <i class="fa fa-cog" aria-hidden="true"></i> <span class="hidden-xs"><#if !site.theme>Releaser<#else>Releaser le theme</#if></span> </button> <#else> <a class="button border-blue" href="jsp/admin/plugins/releaser/ManageSiteRelease.jsp?id_site=${site.id}" title="Modifier"> <i class="fa fa-cog" aria-hidden="true"></i> <span class="hidden-xs"><#if !site.theme>Releaser<#else>Releaser le theme</#if></span> </a> </#if> <a class="button border-blue" href="jsp/admin/plugins/releaser/ManageClusters.jsp?view=modifySite&amp;id=${site.id}" title="Modifier"> <i class="fa fa-pencil" aria-hidden="true"></i> <span class="sr-only">Modifier</span> </a> <a class="button border-red" href="jsp/admin/plugins/releaser/ManageClusters.jsp?action=confirmRemoveSite&amp;id=${site.id}" title="Supprimer"> <i class="fa fa-trash" aria-hidden="true"></i> <span class="sr-only">Supprimer</span> </a> </div> </div> </li> </#list> <#else> <p><span class="text-warning"><i class="fa fa-warning"></i> Aucun site ajout&eacute;</span></p> </#if> </ul> </div> </div> </#list></div> <@modalAuth modId="modalReleaseSVN" type=repo_type_svn formActionUrl="jsp/admin/plugins/releaser/ManageClusters.jsp" formSubmitName="action_releaseSite" /><@modalAuth modId="modalReleaseGITLAB" type=repo_type_gitlab formActionUrl="jsp/admin/plugins/releaser/ManageClusters.jsp" formSubmitName="action_releaseSite" /><@modalAuth modId="modalReleaseGITHUB" type=repo_type_github formActionUrl="jsp/admin/plugins/releaser/ManageClusters.jsp" formSubmitName="action_releaseComponent"/> <@modalAuth modId="modalReleaseComponentGITHUB" type=repo_type_github formActionUrl="jsp/admin/plugins/releaser/ManageComponent.jsp" formSubmitName="view_manageComponent" /> <@paginationAdmin paginator=paginator combo=1 /><script>$(function() { $(".btn-release-site").click( function(e){ var pathElem="#modalRelease" +$(this).data('repo-type')+" .release-id"; $(pathElem).val($(this).data('id-site')); }); $(".btn").tooltip(); $(".button").tooltip(); $(".floating-button").tooltip(); });</script>
\ No newline at end of file
<#include "releaser_util.html" /> <@tform class='form-inline pull-right' name='manage_cluster' action='jsp/admin/plugins/releaser/ManageClusters.jsp'> <button class="floating-button" name="view_createCluster" type="submit" title="#i18n{releaser.manage_clusters.buttonAdd}"> <i class="fa fa-plus"></i> </button></@tform><#if !is_application_account> <button class="floating-button btn-release-site btn-release-site-bg" title="Releaser un composant" data-toggle="modal" data-target="#modalReleaseComponentGITHUB"> <i class="fa fa-cog" aria-hidden="true"></i> <span class="hidden hidden-xs">Releaser un composant</span> </button><#else> <a class="floating-button btn-release-site btn-release-site-bg" href="jsp/admin/plugins/releaser/ManageComponent.jsp" title="Modifier"> <i class="fa fa-cog" aria-hidden="true"></i> <span class="hidden hidden-xs">Releaser un composant</span> </a></#if><div class="app-wrapper app-cluster"><@messages infos=infos /><@messages errors=errors /><#if errors?? && site??> <#list errors as error> <#if error.message == "AUTHENTICATION_ERROR"> <script> $( function(){ var pathElem="#modalRelease${site.getRepoType().name()!} .release-id"; $(pathElem).val(${site.id}); $("#modalRelease${site.getRepoType().name()!}").modal(); }); </script> </#if> </#list></#if><#list cluster_list as cluster> <a name="cluster${cluster.id}" ></a> <!-- widget-app --> <div class="box box-widget widget-app collapsed-box"> <div class="info-box" > <span class="info-box-icon bg-green"><i class="fa fa-cubes"></i></span> <div class="info-box-content"> <div class="col-xs-12 col-sm-11 col-md-11" > <span class="hidden"></span> <h4>${cluster.name} <span class="info-box-number hidden-xs"><#if cluster.sites?size &gt; 0 >${cluster.sites?size} sites <#else> <span class="text-warning"><i class="fa fa-warning"></i> Aucun site ajout&eacute;</span> </#if></span> <@tform class='form-inline' name='manage_site' action='jsp/admin/plugins/releaser/ManageClusters.jsp'> <input type="hidden" name="id" value="${cluster.id}"> <a class="btn btn-danger btn-xs" href="jsp/admin/plugins/releaser/ManageClusters.jsp?action=confirmRemoveCluster&amp;id=${cluster.id}" title="Supprimer"> <i class="fa fa-trash fa-fw" aria-hidden="true"></i> <span class="sr-only">Supprimer</span> </a> <a class="btn btn-primary btn-xs" href="jsp/admin/plugins/releaser/ManageClusters.jsp?view=modifyCluster&amp;id=${cluster.id}" title="Modifier"> <i class="fa fa-pencil fa-fw" aria-hidden="true"></i> <span class="sr-only">Modifier</span> </a> <button type="submit" class="btn btn-success btn-xs" name="view_createSite" title="#i18n{releaser.manage_sites.buttonAdd}"> <i class="fa fa-plus fa-fw"></i> <span class="sr-only">#i18n{releaser.manage_sites.buttonAdd}</span> </button> </@tform> </h4> </div> <div class="hidden-xs"> <#if cluster.sites?size &gt; 0 > <button type="button" class="btn btn-default collaspe pull-right" data-widget="collapse"> <i class="fa fa-plus"></i> </button> </#if> </div> </div> </div> <div class="box-body"> <h2 class="hidden"> <strong>${cluster.description}</strong> <small>Liste des sites du cluster</small></h2> <ul class="nav nav-stacked clearfix"> <#if cluster.sites?size &gt; 0> <#list cluster.sites as site> <li class="info-padding"> <div class="row"> <div class="col-xs-8 col-sm-8"> <h4 title="repository : ${site.scmUrl}"> ${site.name} <span class="label label-info label-app pull-right hidden-xs" title="Artifact ID : ${site.artifactId}"> <i class="fa fa-cube fa-fw"></i> ${site.artifactId} </span> </h4> <small><span class="hidden-xs">${site.description}</span> [<a href="${site.scmUrl}">${site.scmUrl}</a>] </small> </div> <div class="col-xs-4 col-sm-4"> <#if !is_application_account> <button class="button border-green btn-release-site" data-id-site="${site.id}" data-repo-type="${site.getRepoType().name()!}" title="Releaser" data-toggle="modal" data-target="#modalRelease${site.getRepoType().name()!}"> <i class="fa fa-cog" aria-hidden="true"></i> <span class="hidden-xs"><#if !site.theme>Releaser<#else>Releaser le theme</#if></span> </button> <#else> <a class="button border-blue" href="jsp/admin/plugins/releaser/ManageSiteRelease.jsp?id_site=${site.id}" title="Modifier"> <i class="fa fa-cog" aria-hidden="true"></i> <span class="hidden-xs"><#if !site.theme>Releaser<#else>Releaser le theme</#if></span> </a> </#if> <#if site.permissions.modifySitePermission> <a class="button border-blue" href="jsp/admin/plugins/releaser/ManageClusters.jsp?view=modifySite&amp;id=${site.id}" title="Modifier"> <i class="fa fa-pencil" aria-hidden="true"></i> <span class="sr-only">Modifier</span> </a> </#if> <#if site.permissions.deleteSitePermission> <a class="button border-red" href="jsp/admin/plugins/releaser/ManageClusters.jsp?action=confirmRemoveSite&amp;id=${site.id}" title="Supprimer"> <i class="fa fa-trash" aria-hidden="true"></i> <span class="sr-only">Supprimer</span> </a> </#if> </div> </div> </li> </#list> <#else> <p><span class="text-warning"><i class="fa fa-warning"></i> Aucun site ajout&eacute;</span></p> </#if> </ul> </div> </div> </#list></div> <@modalAuth modId="modalReleaseSVN" type=repo_type_svn formActionUrl="jsp/admin/plugins/releaser/ManageClusters.jsp" formSubmitName="action_releaseSite" /><@modalAuth modId="modalReleaseGITLAB" type=repo_type_gitlab formActionUrl="jsp/admin/plugins/releaser/ManageClusters.jsp" formSubmitName="action_releaseSite" /><@modalAuth modId="modalReleaseGITHUB" type=repo_type_github formActionUrl="jsp/admin/plugins/releaser/ManageClusters.jsp" formSubmitName="action_releaseComponent"/> <@modalAuth modId="modalReleaseComponentGITHUB" type=repo_type_github formActionUrl="jsp/admin/plugins/releaser/ManageComponent.jsp" formSubmitName="view_manageComponent" /> <@paginationAdmin paginator=paginator combo=1 /><script>$(function() { $(".btn-release-site").click( function(e){ var pathElem="#modalRelease" +$(this).data('repo-type')+" .release-id"; $(pathElem).val($(this).data('id-site')); }); $(".btn").tooltip(); $(".button").tooltip(); $(".floating-button").tooltip(); });</script>
\ No newline at end of file
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment