Skip to content

Commit 67d5ae6

Browse files
TimotheeHrlseboo
authored andcommitted
LUT-19099 : in manage page, add a column for all the users who contributed to a document
1 parent 3ae6873 commit 67d5ae6

File tree

4 files changed

+22
-7
lines changed

4 files changed

+22
-7
lines changed

src/java/fr/paris/lutece/plugins/blog/resources/blog_messages.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ manage_blogs.labelBy=by
5353
manage_blogs.labelThe=the
5454
manage_blogs.columnCreator=Author
5555
manage_blogs.sortByUtilisateurButton=Only my post
56+
manage_blogs.labelContributors=Contributors
5657

5758
create_blog.pageTitle=Post
5859
create_blog.title=Create a Post

src/java/fr/paris/lutece/plugins/blog/resources/blog_messages_fr.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ manage_blog.labelExpand=Agrandir
5555
manage_blogs.sortByUserButton=Mes billets seulement
5656
manage_blogs.columnUserCreator=Auteur
5757
manage_blogs.columnUser=Dernier auteur
58+
manage_blogs.labelContributors=Contributeurs
5859

5960
create_blog.pageTitle=Cr\u00e9er un billet
6061
create_blog.title=Cr\u00e9er un billet
@@ -341,4 +342,4 @@ rbac.tag.resourceType=(blog) Gestion des tags des billets
341342
rbac.tag.permission.view=Voir un tag
342343
rbac.tag.permission.create=Cr\u00e9er un tag
343344
rbac.tag.permission.delete=Supprimer un tag
344-
rbac.tag.permission.modify=Modifier un tag
345+
rbac.tag.permission.modify=Modifier un tag

src/java/fr/paris/lutece/plugins/blog/web/BlogJspBean.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ public class BlogJspBean extends ManageBlogJspBean
249249
protected static final String MARK_DATE_UPDATE_BLOG_AFTER = "dateUpdateBlogAfter";
250250
protected static final String MARK_DATE_UPDATE_BLOG_BEFOR = "dateUpdateBlogBefor";
251251
protected static final String MARK_UNPUBLISHED = "unpublished";
252+
protected static final String MARK_LIST_BLOG_CONTRIBUTORS = "list_blog_contributors";
252253

253254
public static final String CONSTANT_DUPLICATE_BLOG_NAME = "Copie de ";
254255

@@ -371,20 +372,22 @@ public String getManageBlogs( HttpServletRequest request )
371372
AbstractPaginator.PARAMETER_PAGE_INDEX, _strCurrentPageIndex, getLocale( ) );
372373

373374
List<Blog> listDocuments = new ArrayList<>( );
374-
375+
HashMap<Integer, List<String>> mapContributors = new HashMap<>( );
375376
for ( Integer documentId : paginator.getPageItems( ) )
376377
{
377378
Blog document = BlogService.getInstance( ).findByPrimaryKeyWithoutBinaries( documentId );
378379

379380
if ( document != null )
380381
{
381-
if ( _mapLockBlog.containsKey( document.getId( ) )
382-
&& !_mapLockBlog.get( document.getId( ) ).getSessionId( ).equals( request.getSession( ).getId( ) ) )
382+
if ( _mapLockBlog.containsKey( document.getId( ) ) && !_mapLockBlog.get( document.getId( ) ).getSessionId( )
383+
.equals( request.getSession( ).getId( ) ) )
383384
{
384385

385386
document.setLocked( true );
386387
}
387388
listDocuments.add( document );
389+
List<String> listContributors = BlogHome.getUsersEditedBlogVersions( document.getId( ) );
390+
mapContributors.put( document.getId( ), listContributors );
388391
}
389392
}
390393

@@ -431,7 +434,7 @@ public String getManageBlogs( HttpServletRequest request )
431434
model.put( MARK_DATE_UPDATE_BLOG_AFTER, _dateUpdateBlogAfter );
432435
model.put( MARK_DATE_UPDATE_BLOG_BEFOR, _dateUpdateBlogBefor );
433436
model.put( MARK_UNPUBLISHED, _bIsUnpulished );
434-
437+
model.put( MARK_LIST_BLOG_CONTRIBUTORS, mapContributors );
435438
model.put( MARK_PERMISSION_CREATE_BLOG, bPermissionCreate );
436439
model.put( MARK_PERMISSION_MODIFY_BLOG, bPermissionModify );
437440
model.put( MARK_PERMISSION_DELETE_BLOG, bPermissionDelete );
@@ -1225,7 +1228,7 @@ public String addContent( HttpServletRequest request )
12251228
String partAfterFirstDelimiter = firstParts [0];
12261229
String [ ] secondParts = partAfterFirstDelimiter.split( secondDelimiter );
12271230
// Le mimeType
1228-
String mimeType = secondParts [1];
1231+
String mimeType = secondParts[1];
12291232
// Le fichier en base64
12301233
String base64FileString = StringUtils.EMPTY;
12311234
// Gestion des fichiers vides

webapp/WEB-INF/templates/admin/plugins/blog/manage_blogs.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
<@th>#i18n{blog.create_blog.TagsTitle}</@th>
6161
<@th>#i18n{blog.publication_blog.labelPublication}</@th>
6262
<@th>#i18n{portal.util.labelActions}</@th>
63+
<@th>#i18n{blog.manage_blogs.labelContributors}</@th>
6364
</@tr>
6465
<@tableHeadBodySeparator />
6566
<#list blog_list as blog>
@@ -153,7 +154,16 @@
153154
</#if>
154155
<@aButton href='jsp/site/Portal.jsp?page=blog&amp;id=${blog.id}' title='#i18n{portal.site.admin_page.labelShowPage}' buttonIcon='external-link' hideTitle=['all'] target='_blank' color='default ms-1' size='' class='btn-preview' />
155156
</@td>
156-
</@tr>
157+
<@td class='w-12'>
158+
<#list list_blog_contributors as blogId, contributorList>
159+
<#if blogId == blog.id>
160+
<#list contributorList as contributorName>
161+
${contributorName}
162+
</#list>
163+
</#if>
164+
</#list>
165+
</@td>
166+
</@tr>
157167
<#assign idx=idx + 1/>
158168
</#list>
159169
</@table>

0 commit comments

Comments
 (0)