<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>


<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <style type="text/css">
			   <!--
             body, div, td, span, li, input {
        	font-family: Arial, Helvetica;
                font-size: 15px;
             }
             th {
                font-size: 15px;
             }
            .center, .pageTitle, .form {
		position: relative;
		margin: 0 auto;
		text-align: left;
                font-size: 18px;
            }
            .pageTitle {
		font-size: 18px;
		font-weight: bold;
            }
            .form {
		border:2px solid black;
            }
            .tableHeader {
                background-color: #333;
                font-size: 17px;
                color: white;
                height: 30px;
            }
            .tableFooter {
                background-color: #333;
                font-size: 17px;
                height: 35px;
            }
            .tableRowOdd {
		background-color: #FFFFFF;
            }
            .tableRowEven {
		background-color: #EEF0F0;
            }
            a {
                text-decoration: none;
                color: #337799;
                font-weight: bolder;
            }
            a:hover {
                text-decoration:underline;
                color: #FF5555;
                font-weight: bolder;
            }
            td {
                text-align: left;
            }
            .error{
                color : #FF0000;
                font-weight: bolder;
            }
            .errorStackTrace {
                color : #000000;
            }
            .formUserError {
                color : #FF0000;
                font-weight: bolder;
            }
            .name1{
                width: 350px;
            }
            .name2{
                width: 150px;
            }
            .name3{
                width: 50px;
            }
            .sor{
                    margin-top: 68px;
                    margin-left: 1040px;
                    color: black;
                    width: 156px;
                    height: 50px;
                }
            body{
                    position:relative;
                    margin: 0;
                    padding: 0;
                    height: auto;
                    height: 100%;
                    min-height:100%;
                    width: auto;
                    width: 100%;
                    min-width:100%;
                }
                .header{
                    position:relative;
                    height: 180px;
                    background-image:url("fej2.jpg");
                    background-repeat: repeat-x;
                }
                .menu{
                    position:relative;
                    width: 289px;
                    float:left;
                    background-image:url("menu.jpg");
                    background-repeat: repeat-y;
                    height: 700px;
                }
                .content{
                    position:relative;
                    float:left;
                    width: 900px;
                    float:left;
                    height: 700px;
                }
                /*------------------------------------------------------------ */
                .menupanels{
                    list-style-type: none;
                    margin-left: 25px;
                    padding: 0;
                    width: 210px; /* width of menu */

                }

                .menupanels li{
                    border-bottom: 1px solid white; /* white border beneath each menu item */
                }
                .menupanels li a{
                    background: #333 url("paneltop.gif") no-repeat left top; /*color of menu by default*/
                    display: block;
                    color: white;
                    width: auto;
                    padding: 5px 0; /* Vertical (top/bottom) padding for each menu link */
                    text-indent: 25px;
                    text-decoration: none;
                    border-bottom: 1px solid black; /*bottom border of menu link. Should be equal or darker to link's bgcolor*/

                }
                .menupanels li a:visited, .menupanels li a:active{
                    color: white;
                }
                .menupanels li a:hover{
                    background-color: black; /*color of menu onMouseover*/
                    color: white;
                    border-bottom: 1px solid black; /*bottom border of menu link during hover. Should be equal or darker to link's hover's bgcolor*/
                }
            </style>
            <title>JSP Page</title>
        </head>
        <body>
            <div class="header">
                <div class="sor">
                    <center>
                        <h:outputText value="#{Menu.user.name}"/><br>
                        <h:outputText value="ADMINISZTRÁTOR" rendered="#{Menu.user.userRole == 'ADMIN'}"/>
                        <h:outputText value="HALLGATÓ" rendered="#{Menu.user.userRole == 'STUDENT'}"/>
                        <h:outputText value="OKTATÓ" rendered="#{Menu.user.userRole == 'TEACHER'}"/>
                    </center>
                </div>
            </div>
            <div class="menu">
                <img src="logo.jpg" alt="logo"/>
                <ul class="menupanels">
                    <li><a href="faces/listkurzus.jsp">Meghírdetett tárgyak</a></li>
                    <li><a href="faces/listindex.jsp">Felvett tárgyak</a></li>
                    <li><a href="faces/listindexbook.jsp">Leckekönyv</a></li>
                    <li><a href="faces/listdiploma.jsp">Diplomamunka kiírások</a></li>
                    <li><a href="faces/login.jsp">Kijelentkezés</a></li>
                </ul>

            </div>
            <div class="content">
                <img src="cim_dt.jpg" alt="cim" style="margin-top: 0px; padding-top: 0px; margin-left: 134px;"/>
            <h:form><center>
            <br><br><br>
            <h:dataTable  cellspacing="false" value="#{ListDiploma.listThesis}" var="thesis" binding="#{ListDiploma.tableComponent}" rendered="#{!ListDiploma.listEmpty}"
                    styleClass="form" headerClass="tableHeader"  rowClasses="tableRowOdd, tableRowEven" columnClasses="name1,name2,name3">
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Téma neve" />
                    </f:facet>
                    <h:outputText value="#{thesis.title}" />
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Konzulens" />
                    </f:facet>
                    <h:outputText value="#{thesis.teacherId.name}" />
                </h:column>

                <h:column>
                    <f:facet name="header"/>
                    <h:panelGroup>
                        <h:commandLink action="#{ListDiploma.updateAction}" value="Módosítás" />
                        <h:outputText value="/"/>
                        <h:commandLink action="#{ListDiploma.deleteAction}" value="Törlés" />
                    </h:panelGroup>
                </h:column>


               
            </h:dataTable>
                    <h:panelGrid styleClass="form" columns="1" rendered="#{ListDiploma.listEmpty}">
                    <h:outputText value="Még nem választott diplomamunka témát" />
                    <h:commandButton action="#{ListDiploma.chooseAction}" value="Téma választása"/>
                </h:panelGrid>
                </center>
            </h:form>
            </div>
        </body>
    </html>
</f:view>
