Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 8 files changed
  • 0 commit comments
  • 2 contributors
109 grails-app/controllers/alocadorhorarios/DepartamentoController.groovy
View
@@ -1,10 +1,103 @@
-package alocadorhorarios
-
+package alocadorhorarios
+
+import org.springframework.dao.DataIntegrityViolationException
+
class DepartamentoController {
-
- static scaffold = true
-
-
-
-
+
+ static allowedMethods = [save: "POST", update: "POST", delete: "POST"]
+
+ def index() {
+ redirect(action: "list", params: params)
+ }
+
+ def list() {
+ params.max = Math.min(params.max ? params.int('max') : 10, 100)
+ [departamentoInstanceList: Departamento.list(params), departamentoInstanceTotal: Departamento.count()]
+ }
+
+ def create() {
+ [departamentoInstance: new Departamento(params)]
+ }
+
+ def save() {
+ def departamentoInstance = new Departamento(params)
+ if (!departamentoInstance.save(flush: true)) {
+ render(view: "create", model: [departamentoInstance: departamentoInstance])
+ return
+ }
+
+ flash.message = message(code: 'default.created.message', args: [message(code: 'departamento.label', default: 'Departamento'), departamentoInstance.id])
+ redirect(action: "show", id: departamentoInstance.id)
+ }
+
+ def show() {
+ def departamentoInstance = Departamento.get(params.id)
+ if (!departamentoInstance) {
+ flash.message = message(code: 'default.not.found.message', args: [message(code: 'departamento.label', default: 'Departamento'), params.id])
+ redirect(action: "list")
+ return
+ }
+
+ [departamentoInstance: departamentoInstance]
+ }
+
+ def edit() {
+ def departamentoInstance = Departamento.get(params.id)
+ if (!departamentoInstance) {
+ flash.message = message(code: 'default.not.found.message', args: [message(code: 'departamento.label', default: 'Departamento'), params.id])
+ redirect(action: "list")
+ return
+ }
+
+ [departamentoInstance: departamentoInstance]
+ }
+
+ def update() {
+ def departamentoInstance = Departamento.get(params.id)
+ if (!departamentoInstance) {
+ flash.message = message(code: 'default.not.found.message', args: [message(code: 'departamento.label', default: 'Departamento'), params.id])
+ redirect(action: "list")
+ return
+ }
+
+ if (params.version) {
+ def version = params.version.toLong()
+ if (departamentoInstance.version > version) {
+ departamentoInstance.errors.rejectValue("version", "default.optimistic.locking.failure",
+ [message(code: 'departamento.label', default: 'Departamento')] as Object[],
+ "Another user has updated this Departamento while you were editing")
+ render(view: "edit", model: [departamentoInstance: departamentoInstance])
+ return
+ }
+ }
+
+ departamentoInstance.properties = params
+
+ if (!departamentoInstance.save(flush: true)) {
+ render(view: "edit", model: [departamentoInstance: departamentoInstance])
+ return
+ }
+
+ flash.message = message(code: 'default.updated.message', args: [message(code: 'departamento.label', default: 'Departamento'), departamentoInstance.id])
+ redirect(action: "show", id: departamentoInstance.id)
+ }
+
+ def delete() {
+ def departamentoInstance = Departamento.get(params.id)
+ if (!departamentoInstance) {
+ flash.message = message(code: 'default.not.found.message', args: [message(code: 'departamento.label', default: 'Departamento'), params.id])
+ redirect(action: "list")
+ return
+ }
+
+ try {
+ departamentoInstance.delete(flush: true)
+ flash.message = message(code: 'default.deleted.message', args: [message(code: 'departamento.label', default: 'Departamento'), params.id])
+ redirect(action: "list")
+ }
+ catch (DataIntegrityViolationException e) {
+ flash.message = message(code: 'default.not.deleted.message', args: [message(code: 'departamento.label', default: 'Departamento'), params.id])
+ redirect(action: "show", id: params.id)
+ }
+ }
}
4 grails-app/controllers/alocadorhorarios/ProfessorController.groovy
View
@@ -9,7 +9,7 @@ class ProfessorController {
def index() {
redirect(action: "list", params: params)
}
-
+
def imagemProfessor ={
if (params.id){
Professor professor = Professor.findById(params.id)
@@ -20,7 +20,7 @@ class ProfessorController {
}
}
-
+
def list() {
params.max = Math.min(params.max ? params.int('max') : 10, 100)
[professorInstanceList: Professor.list(params), professorInstanceTotal: Professor.count()]
45 grails-app/views/departamento/_form.gsp
View
@@ -1,5 +1,10 @@
<%@ page import="alocadorhorarios.Departamento" %>
+
+
+<g:javascript src="${resource(dir:'js', file:'ColorP.js')}" />
+
+<r:require module="jquery-ui" />
<div class="fieldcontain ${hasErrors(bean: departamentoInstance, field: 'nome', 'error')} ">
<label for="nome">
@@ -8,15 +13,16 @@
</label>
<g:textField name="nome" value="${departamentoInstance?.nome}"/>
</div>
+
<div class="fieldcontain ${hasErrors(bean: departamentoInstance, field: 'cor', 'error')} ">
<label for="cor">
<g:message code="departamento.cor.label" default="Cor" />
</label>
- <g:textField class="iColorPicker" id="mycolor" name="cor" value="${departamentoInstance?.cor}"/>
+ <g:textField class="iColorPicker" id="mycolor" name="cor" value="${departamentoInstance?.cor}"/>
</div>
-
+
<div class="fieldcontain ${hasErrors(bean: departamentoInstance, field: 'chefe', 'error')} ">
<label for="chefe">
<g:message code="departamento.chefe.label" default="Chefe" />
@@ -55,20 +61,27 @@
<g:message code="departamento.professores.label" default="Professores" />
</label>
- <g:select name="professores" from="${alocadorhorarios.Professor.list()}" multiple="multiple" optionKey="id" size="5" value="${departamentoInstance?.professores*.id}" class="many-to-many"/>
-</div>
+
+<ul class="one-to-many">
+<g:each in="${departamentoInstance?.professores?}" var="p">
+ <li><g:link controller="professor" action="show" id="${p.id}">${p?.encodeAsHTML()}</g:link></li>
+</g:each>
+<li class="add">
+<g:link controller="professor" action="create" params="['departamento.id': departamentoInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'professor.label', default: 'Professor')])}</g:link>
+</li>
+</ul>
+</div>
-<g:javascript library="jquery"/>
-<r:require module="jquery-ui" />
-
+<script type="text/javascript">
-<g:javascript>
var imageUrl = '${resource(dir: 'images', file: 'color.png')}';
-function iColorShow(id, id2) {
+
+
+ function iColorShow(id, id2) {
var eICP = jQuery("#" + id2).position();
jQuery("#iColorPicker").css({
'top' : eICP.top + (jQuery("#" + id).outerHeight()) + "px",
@@ -126,8 +139,8 @@ this.iColorPicker = function() {
jQuery("#iColorPicker").fadeOut()
}).appendTo("body");
jQuery('table.pickerTable td').css({
- 'width' : '12px',
- 'height' : '14px',
+ 'width' : '2px',
+ 'height' : '2px',
'border' : '1px solid #000',
'cursor' : 'pointer'
});
@@ -159,8 +172,14 @@ this.iColorPicker = function() {
+ '" style="border:0;margin:0 0 0 3px" align="absmiddle" ></a>')
})
};
-jQuery(function() {
+
+func: jQuery(function() {
iColorPicker()
})
-</g:javascript>
+
+
+</script>
+
+
+
112 grails-app/views/departamento/list.gsp
View
@@ -26,11 +26,11 @@
<g:sortableColumn property="nome" title="${message(code: 'departamento.nome.label', default: 'Nome')}" />
- <g:sortableColumn property="cor" title="${message(code: 'departamento.cor.label', default: 'Cor')}" />
+ <g:sortableColumn property="cor" title="${message(code: 'departamento.cor.label', default: 'Cor')}" />
<th><g:message code="departamento.chefe.label" default="Chefe" /></th>
- <th><g:message code="departamento.subchefe.label" default="Subchefe" /></th>
+ <th><g:message code="departamento.subchefe.label" default="Subchefe" /></th>
</tr>
</thead>
@@ -40,7 +40,7 @@
<td><g:link action="show" id="${departamentoInstance.id}">${fieldValue(bean: departamentoInstance, field: "nome")}</g:link></td>
- <td style="background-color:${fieldValue(bean: departamentoInstance, field: "cor")} " > </td>
+ <td style="background-color:${fieldValue(bean: departamentoInstance, field: "cor")}"></td>
<td>${fieldValue(bean: departamentoInstance, field: "chefe")}</td>
@@ -55,110 +55,4 @@
</div>
</div>
</body>
- <g:javascript>
-var imageUrl = '${resource(dir: 'images', file: 'color.png')}';
-function iColorShow(id, id2) {
- var eICP = jQuery("#" + id2).position();
- jQuery("#iColorPicker").css({
- 'top' : eICP.top + (jQuery("#" + id).outerHeight()) + "px",
- 'left' : (eICP.left) + "px",
- 'position' : 'absolute'
- }).fadeIn("fast");
- jQuery("#iColorPickerBg").css({
- 'position' : 'fixed',
- 'top' : 0,
- 'left' : 0,
- 'width' : '100%',
- 'height' : '100%'
- }).fadeIn("fast");
- var def = jQuery("#" + id).val();
- jQuery('#colorPreview span').text(def);
- jQuery('#colorPreview').css('background', def);
- jQuery('#color').val(def);
- var hxs = jQuery('#iColorPicker');
- for (i = 0; i < hxs.length; i++) {
- var tbl = document.getElementById('hexSection' + i);
- var tblChilds = tbl.childNodes;
- for (j = 0; j < tblChilds.length; j++) {
- var tblCells = tblChilds[j].childNodes;
- for (k = 0; k < tblCells.length; k++) {
- jQuery(tblChilds[j].childNodes[k]).unbind().mouseover(
- function(a) {
- var aaa = "#" + jQuery(this).attr('hx');
- jQuery('#colorPreview').css('background', aaa);
- jQuery('#colorPreview span').text(aaa)
- }).click(function() {
- var aaa = "#" + jQuery(this).attr('hx');
- jQuery("#" + id).val(aaa).css("background", aaa);
- jQuery("#iColorPickerBg").hide();
- jQuery("#iColorPicker").fadeOut();
- jQuery(this)
- })
- }
- }
- }
-}
-this.iColorPicker = function() {
- jQuery("input.iColorPicker")
- .each(
- function(i) {
- if (i == 0) {
- jQuery(document.createElement("div"))
- .attr("id", "iColorPicker")
- .css('display', 'none')
- .html(
- '<table class="pickerTable" id="pickerTable0"><thead id="hexSection0"><tr><td style="background:#f00;" hx="f00"></td><td style="background:#ff0" hx="ff0"></td><td style="background:#0f0" hx="0f0"></td><td style="background:#0ff" hx="0ff"></td><td style="background:#00f" hx="00f"></td><td style="background:#f0f" hx="f0f"></td><td style="background:#fff" hx="fff"></td><td style="background:#ebebeb" hx="ebebeb"></td><td style="background:#e1e1e1" hx="e1e1e1"></td><td style="background:#d7d7d7" hx="d7d7d7"></td><td style="background:#cccccc" hx="cccccc"></td><td style="background:#c2c2c2" hx="c2c2c2"></td><td style="background:#b7b7b7" hx="b7b7b7"></td><td style="background:#acacac" hx="acacac"></td><td style="background:#a0a0a0" hx="a0a0a0"></td><td style="background:#959595" hx="959595"></td></tr><tr><td style="background:#ee1d24" hx="ee1d24"></td><td style="background:#fff100" hx="fff100"></td><td style="background:#00a650" hx="00a650"></td><td style="background:#00aeef" hx="00aeef"></td><td style="background:#2f3192" hx="2f3192"></td><td style="background:#ed008c" hx="ed008c"></td><td style="background:#898989" hx="898989"></td><td style="background:#7d7d7d" hx="7d7d7d"></td><td style="background:#707070" hx="707070"></td><td style="background:#626262" hx="626262"></td><td style="background:#555" hx="555"></td><td style="background:#464646" hx="464646"></td><td style="background:#363636" hx="363636"></td><td style="background:#262626" hx="262626"></td><td style="background:#111" hx="111"></td><td style="background:#000" hx="000"></td></tr><tr><td style="background:#f7977a" hx="f7977a"></td><td style="background:#fbad82" hx="fbad82"></td><td style="background:#fdc68c" hx="fdc68c"></td><td style="background:#fff799" hx="fff799"></td><td style="background:#c6df9c" hx="c6df9c"></td><td style="background:#a4d49d" hx="a4d49d"></td><td style="background:#81ca9d" hx="81ca9d"></td><td style="background:#7bcdc9" hx="7bcdc9"></td><td style="background:#6ccff7" hx="6ccff7"></td><td style="background:#7ca6d8" hx="7ca6d8"></td><td style="background:#8293ca" hx="8293ca"></td><td style="background:#8881be" hx="8881be"></td><td style="background:#a286bd" hx="a286bd"></td><td style="background:#bc8cbf" hx="bc8cbf"></td><td style="background:#f49bc1" hx="f49bc1"></td><td style="background:#f5999d" hx="f5999d"></td></tr><tr><td style="background:#f16c4d" hx="f16c4d"></td><td style="background:#f68e54" hx="f68e54"></td><td style="background:#fbaf5a" hx="fbaf5a"></td><td style="background:#fff467" hx="fff467"></td><td style="background:#acd372" hx="acd372"></td><td style="background:#7dc473" hx="7dc473"></td><td style="background:#39b778" hx="39b778"></td><td style="background:#16bcb4" hx="16bcb4"></td><td style="background:#00bff3" hx="00bff3"></td><td style="background:#438ccb" hx="438ccb"></td><td style="background:#5573b7" hx="5573b7"></td><td style="background:#5e5ca7" hx="5e5ca7"></td><td style="background:#855fa8" hx="855fa8"></td><td style="background:#a763a9" hx="a763a9"></td><td style="background:#ef6ea8" hx="ef6ea8"></td><td style="background:#f16d7e" hx="f16d7e"></td></tr><tr><td style="background:#ee1d24" hx="ee1d24"></td><td style="background:#f16522" hx="f16522"></td><td style="background:#f7941d" hx="f7941d"></td><td style="background:#fff100" hx="fff100"></td><td style="background:#8fc63d" hx="8fc63d"></td><td style="background:#37b44a" hx="37b44a"></td><td style="background:#00a650" hx="00a650"></td><td style="background:#00a99e" hx="00a99e"></td><td style="background:#00aeef" hx="00aeef"></td><td style="background:#0072bc" hx="0072bc"></td><td style="background:#0054a5" hx="0054a5"></td><td style="background:#2f3192" hx="2f3192"></td><td style="background:#652c91" hx="652c91"></td><td style="background:#91278f" hx="91278f"></td><td style="background:#ed008c" hx="ed008c"></td><td style="background:#ee105a" hx="ee105a"></td></tr><tr><td style="background:#9d0a0f" hx="9d0a0f"></td><td style="background:#a1410d" hx="a1410d"></td><td style="background:#a36209" hx="a36209"></td><td style="background:#aba000" hx="aba000"></td><td style="background:#588528" hx="588528"></td><td style="background:#197b30" hx="197b30"></td><td style="background:#007236" hx="007236"></td><td style="background:#00736a" hx="00736a"></td><td style="background:#0076a4" hx="0076a4"></td><td style="background:#004a80" hx="004a80"></td><td style="background:#003370" hx="003370"></td><td style="background:#1d1363" hx="1d1363"></td><td style="background:#450e61" hx="450e61"></td><td style="background:#62055f" hx="62055f"></td><td style="background:#9e005c" hx="9e005c"></td><td style="background:#9d0039" hx="9d0039"></td></tr><tr><td style="background:#790000" hx="790000"></td><td style="background:#7b3000" hx="7b3000"></td><td style="background:#7c4900" hx="7c4900"></td><td style="background:#827a00" hx="827a00"></td><td style="background:#3e6617" hx="3e6617"></td><td style="background:#045f20" hx="045f20"></td><td style="background:#005824" hx="005824"></td><td style="background:#005951" hx="005951"></td><td style="background:#005b7e" hx="005b7e"></td><td style="background:#003562" hx="003562"></td><td style="background:#002056" hx="002056"></td><td style="background:#0c004b" hx="0c004b"></td><td style="background:#30004a" hx="30004a"></td><td style="background:#4b0048" hx="4b0048"></td><td style="background:#7a0045" hx="7a0045"></td><td style="background:#7a0026" hx="7a0026"></td></tr></thead><tbody><tr><td style="border:1px solid #000;background:#fff;cursor:pointer;height:60px;-moz-background-clip:-moz-initial;-moz-background-origin:-moz-initial;-moz-background-inline-policy:-moz-initial;" colspan="16" align="center" id="colorPreview"><span style="color:#000;border:1px solid rgb(0, 0, 0);padding:5px;background-color:#fff;font:11px Arial, Helvetica, sans-serif;"></span></td></tr></tbody></table><style>#iColorPicker input{margin:2px}</style>')
- .appendTo("body");
- jQuery(document.createElement("div")).attr("id",
- "iColorPickerBg").click(function() {
- jQuery("#iColorPickerBg").hide();
- jQuery("#iColorPicker").fadeOut()
- }).appendTo("body");
- jQuery('table.pickerTable td').css({
- 'width' : '12px',
- 'height' : '14px',
- 'border' : '1px solid #000',
- 'cursor' : 'pointer'
- });
- jQuery('#iColorPicker table.pickerTable').css({
- 'border-collapse' : 'collapse'
- });
- jQuery('#iColorPicker').css({
- 'border' : '1px solid #ccc',
- 'background' : '#333',
- 'padding' : '5px',
- 'color' : '#fff',
- 'z-index' : 9999
- })
- }
- jQuery('#colorPreview').css({
- 'height' : '50px'
- });
- jQuery(this)
- .css("backgroundColor", jQuery(this).val())
- .after(
- '<a href="javascript:void(null)" id="icp_'
- + this.id
- + '" onclick="iColorShow(\''
- + this.id
- + '\',\'icp_'
- + this.id
- + '\')"><img src="'
- + imageUrl
- + '" style="border:0;margin:0 0 0 3px" align="absmiddle" ></a>')
- })
-};
-jQuery(function() {
- iColorPicker()
-})
-
-</g:javascript>
</html>
-
-<g:javascript library="jquery"/>
-<r:require module="jquery-ui" />
-
-
-
-
-
2  grails-app/views/departamento/show.gsp
View
@@ -36,7 +36,7 @@
<li class="fieldcontain">
<span id="cor-label" class="property-label"><g:message code="departamento.cor.label" default="Cor" /></span>
- <span class="property-value" style="background-color:${fieldValue(bean: departamentoInstance, field: "cor")} " aria-labelledby="cor-label"><g:fieldValue bean="${departamentoInstance}" field="cor"/></span>
+ <span style="background-color:${fieldValue(bean: departamentoInstance, field: "cor")} " class="property-value" aria-labelledby="cor-label"><g:fieldValue bean="${departamentoInstance}" field="cor"/></span>
</li>
</g:if>
35 grails-app/views/professor/_form.gsp
View
@@ -2,14 +2,6 @@
-<div class="fieldcontain ${hasErrors(bean: professorInstance, field: 'nome', 'error')} ">
- <label for="nome">
- <g:message code="professor.nome.label" default="Nome" />
-
- </label>
- <g:textField name="nome" value="${professorInstance?.nome}"/>
-</div>
-
<div class="fieldcontain ${hasErrors(bean: professorInstance, field: 'matricula', 'error')} ">
<label for="matricula">
<g:message code="professor.matricula.label" default="Matricula" />
@@ -18,6 +10,14 @@
<g:textField name="matricula" value="${professorInstance?.matricula}"/>
</div>
+<div class="fieldcontain ${hasErrors(bean: professorInstance, field: 'nome', 'error')} ">
+ <label for="nome">
+ <g:message code="professor.nome.label" default="Nome" />
+
+ </label>
+ <g:textField name="nome" value="${professorInstance?.nome}"/>
+</div>
+
<div class="fieldcontain ${hasErrors(bean: professorInstance, field: 'email', 'error')} ">
<label for="email">
<g:message code="professor.email.label" default="Email" />
@@ -34,11 +34,28 @@
<input type="file" id="imagem" name="imagem" />
</div>
+<div class="fieldcontain ${hasErrors(bean: professorInstance, field: 'departamento', 'error')} required">
+ <label for="departamento">
+ <g:message code="professor.departamento.label" default="Departamento" />
+ <span class="required-indicator">*</span>
+ </label>
+ <g:select id="departamento" name="departamento.id" from="${alocadorhorarios.Departamento.list()}" optionKey="id" required="" value="${professorInstance?.departamento?.id}" class="many-to-one"/>
+</div>
+
<div class="fieldcontain ${hasErrors(bean: professorInstance, field: 'telefones', 'error')} ">
<label for="telefones">
<g:message code="professor.telefones.label" default="Telefones" />
</label>
- <g:select name="telefones" from="${alocadorhorarios.Telefone.list()}" multiple="multiple" optionKey="id" size="5" value="${professorInstance?.telefones*.id}" class="many-to-many"/>
+
+<ul class="one-to-many">
+<g:each in="${professorInstance?.telefones?}" var="t">
+ <li><g:link controller="telefone" action="show" id="${t.id}">${t?.encodeAsHTML()}</g:link></li>
+</g:each>
+<li class="add">
+<g:link controller="telefone" action="create" params="['professor.id': professorInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'telefone.label', default: 'Telefone')])}</g:link>
+</li>
+</ul>
+
</div>
130 grails-app/views/professor/list.gsp
View
@@ -1,63 +1,87 @@
-<%@ page import="alocadorhorarios.Professor" %>
+<%@ page import="alocadorhorarios.Professor"%>
<!doctype html>
<html>
- <head>
+<head>
+<meta name="layout" content="main">
<link rel="stylesheet" href="${resource(dir: 'css', file: 'style.css')}" type="text/css">
- <meta name="layout" content="main">
- <g:set var="entityName" value="${message(code: 'professor.label', default: 'Professor')}" />
- <title><g:message code="default.list.label" args="[entityName]" /></title>
- </head>
- <body>
- <a href="#list-professor" class="skip" tabindex="-1"><g:message code="default.link.skip.label" default="Skip to content&hellip;"/></a>
- <div class="nav" role="navigation">
- <ul>
- <li><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></li>
- <li><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></li>
- </ul>
- </div>
- <div id="list-professor" class="content scaffold-list" role="main">
- <h1><g:message code="default.list.label" args="[entityName]" /></h1>
- <g:if test="${flash.message}">
- <div class="message" role="status">${flash.message}</div>
- </g:if>
- <table>
- <thead>
- <tr>
-
- <g:sortableColumn property="nome" title="${message(code: 'professor.nome.label', default: 'Nome')}" />
-
- <g:sortableColumn property="matricula" title="${message(code: 'professor.matricula.label', default: 'Matricula')}" />
-
- <g:sortableColumn property="email" title="${message(code: 'professor.email.label', default: 'Email')}" />
-
-
- <th>Imagem</th>
-
- </tr>
- </thead>
- <tbody>
- <g:each in="${professorInstanceList}" status="i" var="professorInstance">
+<g:set var="entityName"
+ value="${message(code: 'professor.label', default: 'Professor')}" />
+<title><g:message code="default.list.label" args="[entityName]" /></title>
+</head>
+<body>
+ <a href="#list-professor" class="skip" tabindex="-1"><g:message
+ code="default.link.skip.label" default="Skip to content&hellip;" /></a>
+ <div class="nav" role="navigation">
+ <ul>
+ <li><a class="home" href="${createLink(uri: '/')}"><g:message
+ code="default.home.label" /></a></li>
+ <li><g:link class="create" action="create">
+ <g:message code="default.new.label" args="[entityName]" />
+ </g:link></li>
+ </ul>
+ </div>
+ <div id="list-professor" class="content scaffold-list" role="main">
+ <h1>
+ <g:message code="default.list.label" args="[entityName]" />
+ </h1>
+ <g:if test="${flash.message}">
+ <div class="message" role="status">
+ ${flash.message}
+ </div>
+ </g:if>
+ <table>
+ <thead>
+ <tr>
+
+ <g:sortableColumn property="matricula"
+ title="${message(code: 'professor.matricula.label', default: 'Matricula')}" />
+
+ <g:sortableColumn property="nome"
+ title="${message(code: 'professor.nome.label', default: 'Nome')}" />
+
+ <g:sortableColumn property="email"
+ title="${message(code: 'professor.email.label', default: 'Email')}" />
+
+ <th>Imagem</th>
+
+ <th><g:message code="professor.departamento.label"
+ default="Departamento" /></th>
+
+ </tr>
+ </thead>
+ <tbody>
+ <g:each in="${professorInstanceList}" status="i"
+ var="professorInstance">
<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
-
- <td><g:link action="show" id="${professorInstance.id}">${fieldValue(bean: professorInstance, field: "nome")}</g:link></td>
-
- <td>${fieldValue(bean: professorInstance, field: "matricula")}</td>
-
- <td>${fieldValue(bean: professorInstance, field: "email")}</td>
-
-
- <td>
- <img alt="" class="imgDoubleBorderLightGray" width="100" height="100" src="/AlocadorHorarios/professor/imagemProfessor/${professorInstance.id}">
+
+ <td><g:link action="show" id="${professorInstance.id}">
+ ${fieldValue(bean: professorInstance, field: "matricula")}
+ </g:link></td>
+
+ <td>
+ ${fieldValue(bean: professorInstance, field: "nome")}
</td>
-
+
+ <td>
+ ${fieldValue(bean: professorInstance, field: "email")}
+ </td>
+
+ <td><img alt="" class="imgDoubleBorderLightGray" width="100"
+ height="100"
+ src="/AlocadorHorarios/professor/imagemProfessor/${professorInstance.id}">
+ </td>
+ <td>
+ ${fieldValue(bean: professorInstance, field: "departamento")}
+ </td>
+
</tr>
</g:each>
- </tbody>
- </table>
- <div class="pagination">
- <g:paginate total="${professorInstanceTotal}" />
- </div>
+ </tbody>
+ </table>
+ <div class="pagination">
+ <g:paginate total="${professorInstanceTotal}" />
</div>
- </body>
+ </div>
+</body>
</html>
36 grails-app/views/professor/show.gsp
View
@@ -4,8 +4,8 @@
<html>
<head>
<meta name="layout" content="main">
- <link rel="stylesheet" href="${resource(dir: 'css', file: 'style.css')}" type="text/css">
<g:set var="entityName" value="${message(code: 'professor.label', default: 'Professor')}" />
+ <link rel="stylesheet" href="${resource(dir: 'css', file: 'style.css')}" type="text/css">
<title><g:message code="default.show.label" args="[entityName]" /></title>
</head>
<body>
@@ -24,20 +24,20 @@
</g:if>
<ol class="property-list professor">
- <g:if test="${professorInstance?.nome}">
+ <g:if test="${professorInstance?.matricula}">
<li class="fieldcontain">
- <span id="nome-label" class="property-label"><g:message code="professor.nome.label" default="Nome" /></span>
+ <span id="matricula-label" class="property-label"><g:message code="professor.matricula.label" default="Matricula" /></span>
- <span class="property-value" aria-labelledby="nome-label"><g:fieldValue bean="${professorInstance}" field="nome"/></span>
+ <span class="property-value" aria-labelledby="matricula-label"><g:fieldValue bean="${professorInstance}" field="matricula"/></span>
</li>
</g:if>
- <g:if test="${professorInstance?.matricula}">
+ <g:if test="${professorInstance?.nome}">
<li class="fieldcontain">
- <span id="matricula-label" class="property-label"><g:message code="professor.matricula.label" default="Matricula" /></span>
+ <span id="nome-label" class="property-label"><g:message code="professor.nome.label" default="Nome" /></span>
- <span class="property-value" aria-labelledby="matricula-label"><g:fieldValue bean="${professorInstance}" field="matricula"/></span>
+ <span class="property-value" aria-labelledby="nome-label"><g:fieldValue bean="${professorInstance}" field="nome"/></span>
</li>
</g:if>
@@ -50,19 +50,23 @@
</li>
</g:if>
-
- <g:if test="${professorInstance?.imagem}">
+
+ <g:if test="${professorInstance?.imagem}">
<li class="fieldcontain">
- <span id="imagem-label" class="property-label">
+ <span id="imagem-label" class="property-label"><g:message code="professor.imagem.label" default="Imagem" /></span>
+ <img alt="" class="imgDoubleBorderLightGray" width="100" height="100" style="margin-left: 15px" src="/AlocadorHorarios/professor/imagemProfessor/${professorInstance.id}">
+ </li>
+ </g:if>
+
+ <g:if test="${professorInstance?.departamento}">
+ <li class="fieldcontain">
+ <span id="departamento-label" class="property-label"><g:message code="professor.departamento.label" default="Departamento" /></span>
- <g:message code="professor.imagem.label" default="Imagem" /></span>
-
- <img alt="" class="imgDoubleBorderLightGray" width="100" height="100" style="margin-left: 15px" src="/AlocadorHorarios/professor/imagemProfessor/${professorInstance.id}">
+ <span class="property-value" aria-labelledby="departamento-label"><g:link controller="departamento" action="show" id="${professorInstance?.departamento?.id}">${professorInstance?.departamento?.encodeAsHTML()}</g:link></span>
-
- </li>
+ </li>
</g:if>
-
+
<g:if test="${professorInstance?.telefones}">
<li class="fieldcontain">
<span id="telefones-label" class="property-label"><g:message code="professor.telefones.label" default="Telefones" /></span>

No commit comments for this range

Something went wrong with that request. Please try again.