Added service descriptions.
Pages now use service descriptions to describe services, falling back on the service type's displayable value if no description is given.
This commit is contained in:
		@@ -7,6 +7,7 @@ public class Service implements Serializable {
 | 
			
		||||
    int id
 | 
			
		||||
    private LocalDate date
 | 
			
		||||
    ServiceType serviceType
 | 
			
		||||
    String description
 | 
			
		||||
 | 
			
		||||
    public boolean equals(Object thatObj) {
 | 
			
		||||
        if (thatObj == null) return false
 | 
			
		||||
 
 | 
			
		||||
@@ -9,6 +9,7 @@ CREATE TABLE IF NOT EXISTS services (
 | 
			
		||||
    id SERIAL,
 | 
			
		||||
    date DATE NOT NULL,
 | 
			
		||||
    service_type VARCHAR(16) DEFAULT NULL,
 | 
			
		||||
    description VARCHAR(255) DEFAULT NULL,
 | 
			
		||||
    CONSTRAINT uc_serviceTypeAndDate UNIQUE (date, service_type),
 | 
			
		||||
    PRIMARY KEY (id));
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -126,7 +126,7 @@ table {
 | 
			
		||||
        text-align: center;
 | 
			
		||||
 | 
			
		||||
        & > h2 { display: none; }
 | 
			
		||||
        & > h2.song-name, & > h2.service-date { display: block; }
 | 
			
		||||
        & > h2.song-name, & > h2.service-desc { display: block; }
 | 
			
		||||
 | 
			
		||||
        & > nav > ul > li {
 | 
			
		||||
            display: inline-block;
 | 
			
		||||
 
 | 
			
		||||
@@ -38,8 +38,8 @@ if (!service) { response.sendError(response.SC_NOT_FOUND); return }
 | 
			
		||||
    <body>
 | 
			
		||||
        <header>
 | 
			
		||||
            <h1><a href="../">New Life Songs</a></h1>
 | 
			
		||||
            <h2 class=service-date><%= service.@date.toString("yyyy-MM-dd") %> (<%=
 | 
			
		||||
                    service.serviceType.displayName %>)</h2>
 | 
			
		||||
            <h2 class=service-desc><%= service.@date.toString("yyyy-MM-dd") %>: (<%=
 | 
			
		||||
                    service.description ?: service.serviceType.displayName %>)</h2>
 | 
			
		||||
 | 
			
		||||
            <nav><ul>
 | 
			
		||||
                <li><a href="../admin/">Admin</a></li>
 | 
			
		||||
 
 | 
			
		||||
@@ -45,7 +45,8 @@ songsDB = NLSongsContext.songsDB
 | 
			
		||||
                <% songsDB.findAllServices().sort { it.date }.reverse().each { service -> %>
 | 
			
		||||
                    <tr><td class=date><a href="../service/<%= service.id %>"><%=
 | 
			
		||||
                            service.@date.toString("yyyy-MM-dd") %></a></td>
 | 
			
		||||
                        <td class=service-type><%= service.serviceType.displayName %></td></tr><% } %>
 | 
			
		||||
                        <td class=service-type><%= service.description ?:
 | 
			
		||||
                            service.serviceType.displayName %></td></tr><% } %>
 | 
			
		||||
                </tbody>
 | 
			
		||||
                <!--<tfoot><tr>
 | 
			
		||||
                        <th class="dt-left">Date</th>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
#
 | 
			
		||||
#Fri Apr 10 19:11:21 CDT 2015
 | 
			
		||||
#Tue Apr 14 15:12:24 CDT 2015
 | 
			
		||||
major=2
 | 
			
		||||
version.release=false
 | 
			
		||||
minor=2
 | 
			
		||||
build=10
 | 
			
		||||
build=13
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user