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
 | 
					    int id
 | 
				
			||||||
    private LocalDate date
 | 
					    private LocalDate date
 | 
				
			||||||
    ServiceType serviceType
 | 
					    ServiceType serviceType
 | 
				
			||||||
 | 
					    String description
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public boolean equals(Object thatObj) {
 | 
					    public boolean equals(Object thatObj) {
 | 
				
			||||||
        if (thatObj == null) return false
 | 
					        if (thatObj == null) return false
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,6 +9,7 @@ CREATE TABLE IF NOT EXISTS services (
 | 
				
			|||||||
    id SERIAL,
 | 
					    id SERIAL,
 | 
				
			||||||
    date DATE NOT NULL,
 | 
					    date DATE NOT NULL,
 | 
				
			||||||
    service_type VARCHAR(16) DEFAULT NULL,
 | 
					    service_type VARCHAR(16) DEFAULT NULL,
 | 
				
			||||||
 | 
					    description VARCHAR(255) DEFAULT NULL,
 | 
				
			||||||
    CONSTRAINT uc_serviceTypeAndDate UNIQUE (date, service_type),
 | 
					    CONSTRAINT uc_serviceTypeAndDate UNIQUE (date, service_type),
 | 
				
			||||||
    PRIMARY KEY (id));
 | 
					    PRIMARY KEY (id));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -126,7 +126,7 @@ table {
 | 
				
			|||||||
        text-align: center;
 | 
					        text-align: center;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        & > h2 { display: none; }
 | 
					        & > h2 { display: none; }
 | 
				
			||||||
        & > h2.song-name, & > h2.service-date { display: block; }
 | 
					        & > h2.song-name, & > h2.service-desc { display: block; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        & > nav > ul > li {
 | 
					        & > nav > ul > li {
 | 
				
			||||||
            display: inline-block;
 | 
					            display: inline-block;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -38,8 +38,8 @@ if (!service) { response.sendError(response.SC_NOT_FOUND); return }
 | 
				
			|||||||
    <body>
 | 
					    <body>
 | 
				
			||||||
        <header>
 | 
					        <header>
 | 
				
			||||||
            <h1><a href="../">New Life Songs</a></h1>
 | 
					            <h1><a href="../">New Life Songs</a></h1>
 | 
				
			||||||
            <h2 class=service-date><%= service.@date.toString("yyyy-MM-dd") %> (<%=
 | 
					            <h2 class=service-desc><%= service.@date.toString("yyyy-MM-dd") %>: (<%=
 | 
				
			||||||
                    service.serviceType.displayName %>)</h2>
 | 
					                    service.description ?: service.serviceType.displayName %>)</h2>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <nav><ul>
 | 
					            <nav><ul>
 | 
				
			||||||
                <li><a href="../admin/">Admin</a></li>
 | 
					                <li><a href="../admin/">Admin</a></li>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -45,7 +45,8 @@ songsDB = NLSongsContext.songsDB
 | 
				
			|||||||
                <% songsDB.findAllServices().sort { it.date }.reverse().each { service -> %>
 | 
					                <% songsDB.findAllServices().sort { it.date }.reverse().each { service -> %>
 | 
				
			||||||
                    <tr><td class=date><a href="../service/<%= service.id %>"><%=
 | 
					                    <tr><td class=date><a href="../service/<%= service.id %>"><%=
 | 
				
			||||||
                            service.@date.toString("yyyy-MM-dd") %></a></td>
 | 
					                            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>
 | 
					                </tbody>
 | 
				
			||||||
                <!--<tfoot><tr>
 | 
					                <!--<tfoot><tr>
 | 
				
			||||||
                        <th class="dt-left">Date</th>
 | 
					                        <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
 | 
					major=2
 | 
				
			||||||
version.release=false
 | 
					version.release=false
 | 
				
			||||||
minor=2
 | 
					minor=2
 | 
				
			||||||
build=10
 | 
					build=13
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user