1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
|
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
>
<h:head>
<title>Blog</title>
</h:head>
<h:body>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<ui:include src="connection.xhtml"/>
<p:panel style="width: 794px; height: 80px; margin-left: auto; margin-right: auto">
<p><h:outputText style="color: red; font-size: 20px" value="#{blogListController.currentBlog.title}"/></p>
<p><h:outputText style="color: blue; font-size: 15px" value="#{blogListController.currentBlog.description}"/></p>
</p:panel>
<h:form id="ListArticle">
<p:layout id="layoutSouth" style="width:800px; height: 560px; margin-left: auto; margin-right: auto" >
<p:layoutUnit position="west" size="100" >
left
</p:layoutUnit>
<p:layoutUnit position="center" >
<f:subview id="subviewCreateNewArt" rendered="#{connectionController.connected}">
<p align="left" >
<p:commandButton id="DialogButtoNewArti" value="Créer un nouvel article" onclick="dialogNewArticle.show()" type="button" style="color: blue; background-color: aqua"/>
</p>
</f:subview>
<p:dataTable id="dataTableArticle" value="#{articleController.BlogArticle(blogListController.currentBlog.blogId)}" var="currentArticle"
paginator="true" rows="10"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="5,10,15">
<p:column>
<!-- En tete avec titre et footer de fin -->
<p:panel header="#{currentArticle.title}" footer="#{currentArticle.blog.user.toString()}">
<p align="right">Mis à jour le : <h:outputText style="text-align: left" value="#{articleController.stringOfDate(currentArticle.updateDate)}"/></p>
<!-- Insertion de l'image à gauche -->
<img src="#{currentArticle.image}" align="left" height="90" width="90">
<!-- texte résumé de l'article -->
<h:outputText value="#{articleController.extraitText(currentArticle.content)}" /><br></br> </img>
<br></br><br></br>
<!-- bouton LIRE PLUS -->
<p align="right"> <p:commandButton id="modalDialogButton" value="Lire plus..." update="dialogFullArticle" onclick="dialogFullArticle.show();" type="button" style="color: darkgreen; height: 1px;"/> <br></br><br></br><br></br></p>
<!-- Nombres de vues -->
<p align="right"><h:outputText style="text-align: left" value="#{currentArticle.nbViews}"/> vues</p>
<!-- MENU OPTION -->
<f:facet name="options">
<p:menu rendered="#{articleController.compareUser(connectionController.connectedUser, currentArticle.blog.user)}">
<p:submenu label="Options">
<p:menuitem value="Editer" url="#" icon="ui-icon-pencil" update="dialogEditArticle" onclick="dialogEditArticle.show();"/>
<p:menuitem value="Supprimer" url="#" icon="ui-icon-close" onclick="#{articleController.doDeleteArticle(currentArticle)};"/>
<p:menuitem value="Inviter à lire" url="#" icon="ui-icon-person" onclick="dialogInvit.show();"/>
</p:submenu>
</p:menu>
</f:facet>
</p:panel>
</p:column>
</p:dataTable>
</p:layoutUnit>
<p:layoutUnit position="east" size="100">
right
</p:layoutUnit>
</p:layout>
<!-- Fenetre de dialogue pour l'ajout d'un article -->
<p:dialog id="DialogNewArt" header="Nouvel Article" widgetVar="dialogNewArticle" modal="true" width="900">
<p:panel>
<p align="left">
<h:outputLabel value="Titre: " />
<p:inputText style="width:450px" value="#{articleController.newArticle.title}"/><br></br><br></br>
<h:outputLabel value="Mots clés " />
<p:inputText style="width:425px" value="#{articleController.newArticle.tagList}"/> Attention, à séparer par une virgule
</p>
<p:editor id="editor" value="#{articleController.newArticle.content}" width="765"/><br></br>
<p align="left">
Ajouter Dans le blog : <p:selectOneMenu style="text-align: left; alignment-adjust: auto; width: 350px" value="#{articleController.userBlog.displayBlogId}">
<f:selectItems value="#{articleController.viewListBlogUser(connectionController.connectedUser.userId)}" var="blog" itemLabel="#{blog.title}" itemValue="#{blog.blogId}"/>
</p:selectOneMenu>
</p>
<h:panelGrid columns="2" style="margin-top:10px">
<p:commandButton id="submitButton" value="Ajouter l'article" update="display" action="#{articleController.doSaveArticle(articleController.newArticle)}" oncomplete="dlg.show()" icon="ui-icon-disk" />
</h:panelGrid>
<p:dialog header="Content" widgetVar="dlg" showEffect="fade" hideEffect="fade" modal="true">
<h:outputText id="display" value="#{editorBean.value}" escape="false" />
</p:dialog>
</p:panel>
</p:dialog>
<!-- Fenetre de dialogue pour la modification d'un article -->
<p:dialog id="DialogEditArt" header="Edition Article" widgetVar="dialogEditArticle" modal="true" width="900">
<p:panel>
<p align="left">
<h:outputLabel value="Titre : " />
<p:inputText style="width:450px" value="#{currentArticle.title}"/><br></br><br></br>
<h:outputLabel value="Mots clés " />
<p:inputText style="width:425px" value="#{currentArticle.tagList}"/> Attention, à séparer par une virgule<br></br><br></br>
<h:outputLabel value="Url de l'image : " />
<p:inputText style="width:400px" value="#{currentArticle.image}"/>
</p>
<p:editor id="editor1" value="#{currentArticle.content}" width="765"/><br></br>
<!-- ******************************************** -->
<h:panelGrid columns="2" style="margin-top:10px">
<p:commandButton id="submitButtonEdit" value="Sauver l'article" update="display" oncomplete="dlg.show()"
icon="ui-icon-disk" />
</h:panelGrid>
<p:dialog header="Content" widgetVar="dlg" showEffect="fade" hideEffect="fade" modal="true">
<h:outputText id="display2" value="#{editorBean.value}" escape="false" />
</p:dialog>
</p:panel>
</p:dialog>
<!-- Fenetre de dialogue pour l'affichage de l'article complet -->
<p:dialog id="DialogFulltArt" header="#{currentArticle.title}" widgetVar="dialogFullArticle" modal="true" width="900">
<p:panel footer="#{currentArticle.blog.user.toString()}" style="color: #D20005">
<p align="left">
<b><font color="green"><h:outputLabel value="Blog : " /> </font></b>
<h:commandLink value="#{currentArticle.blog.toString()}" action="#{blogListController.viewCurrentBlog(currentArticle.blog)}" /><br></br><br></br>
<b><font color="green"><h:outputLabel value="Catégorie : " /> </font></b>
<h:outputText value="#{currentArticle.blog.category.toString()}" /><br></br><br></br>
<b><font color="green"><h:outputLabel value="Mots clés : " /> </font></b>
<h:outputText value="#{currentArticle.tagList}" /><br></br><br></br>
<img src="#{currentArticle.image}" align="left" height="180" width="180" style="margin:10px">
<h:outputText value="#{currentArticle.content}" width="765"/></img><br></br><br></br>
<font color="green" style="float: right"><b><h:outputLabel value="Nombre de vue : " /></b>
<h:outputText value="#{currentArticle.nbViews}" /></font><br></br>
</p>
</p:panel>
</p:dialog>
<!--
<p:growl id="messages" />
<p:confirmDialog id="dialConfirmDelete" message="Etes-vous sur de vouloir supprimer cet article ?"
header="Confirmation de suppression" severity="alert" widgetVar="confirmationDelete">
<p:commandButton id="confirm" value="Supprimer" update="messages" oncomplete="confirmation.hide()"
action="#{articleController.doDeleteArticle(currentArticle)}" />
<p:commandButton id="decline" value="Annuler" onclick="dialConfirmDelete.hide()" type="button" />
</p:confirmDialog> -->
</h:form>
</h:body>
</html> |
Partager