Skip to content
Browse files

Merge branch 'master' of github.com:rinfo/lagrummet.se

  • Loading branch information...
2 parents 2a42f1f + d4649f1 commit 07fb198e553c227bf7e8696f119c35114efe2a67 @AndersZ AndersZ committed Mar 13, 2012
View
4 application.properties
@@ -1,9 +1,9 @@
#Grails Metadata file
-#Thu Dec 22 11:36:34 CET 2011
+#Tue Mar 06 09:39:12 CET 2012
app.grails.version=1.3.7
app.name=lagrummet.se
app.servlet.version=2.4
-app.version=0.7.3
+app.version=0.7.4
plugins.error-pages-fix=0.2
plugins.hibernate=1.3.7
plugins.jquery=1.6.1.1
View
15 grails-app/controllers/se/lagrummet/PageController.groovy
@@ -57,6 +57,9 @@ class PageController {
params.author = SecUser.get(springSecurityService.principal.id)
def pageInstance = new Page(params)
+ def now = new Date()
+ pageInstance.dateCreated = now
+ pageInstance.lastUpdated = now
def instanceToSave
if (pageInstance.parent) {
@@ -314,14 +317,13 @@ class PageController {
@Secured(['ROLE_EDITOR', 'ROLE_ADMIN', 'IS_AUTHENTICATED_FULLY'])
def update = {
+ flash.messages = []
def pageInstance = Page.get(params.id)
if (pageInstance) {
if (params.version) {
def version = Long.valueOf(params.version)
if (pageInstance.version > version) {
- pageInstance.errors.rejectValue("version", "default.optimistic.locking.failure", [message(code: 'page.label', default: 'Page')] as Object[], "Another user has updated this Page while you were editing")
- render(view: "edit", model: [pageInstance: pageInstance])
- return
+ flash.messages.add("${message(code: 'page.updated.updatedByAnotherUser')}")
}
}
@@ -353,17 +355,18 @@ class PageController {
if (toBeDeleted) {
pageInstance.puffs.removeAll(toBeDeleted)
}
-
+
+ pageInstance.lastUpdated = now
if (!pageInstance.hasErrors() && pageInstance.save(flush:true)) {
- flash.message = "${message(code: 'page.updated.message', args: [pageInstance.h1])}"
+ flash.messages.add "${message(code: 'page.updated.message', args: [pageInstance.h1])}"
redirect(action: "edit", id: pageInstance.id)
}
else {
render(view: "edit", model: [pageInstance: pageInstance])
}
}
else {
- flash.message = "${message(code: 'default.not.found.message', args: [message(code: 'page.label', default: 'Page'), params.id])}"
+ flash.messages.add "${message(code: 'default.not.found.message', args: [message(code: 'page.label', default: 'Page'), params.id])}"
redirect(action: "edit", id: pageInstance.id)
}
}
View
3 grails-app/domain/se/lagrummet/Page.groovy
@@ -92,6 +92,7 @@ class Page implements Comparable<Page>{
sort pageOrder:"asc", dateCreated: "desc"
children sort: "pageOrder"
puffs sort: "dateCreated", order: "asc", cascade: "all-delete-orphan"
+ autoTimestamp false
}
def url = {
@@ -108,6 +109,8 @@ class Page implements Comparable<Page>{
pageBackup.media = null
pageBackup.puffs = null
pageBackup.autoSaves = null
+ pageBackup.dateCreated = this.lastUpdated
+ pageBackup.lastUpdated = new Date()
this.addToAutoSaves(pageBackup).save()
}
View
5 grails-app/views/page/edit.gsp
@@ -10,9 +10,12 @@
</head>
<body>
<div class="body">
- <g:if test="${flash.message}">
+ <g:if test="${flash.message}">
<div class="message">${flash.message}</div>
</g:if>
+ <g:each in="${flash.messages}">
+ <div class="message">${it}</div>
+ </g:each>
<g:hasErrors bean="${pageInstance}">
<div class="errors">
<g:renderErrors bean="${pageInstance}" as="list" />
View
2 grails-app/views/search/extendedSearch.gsp
@@ -105,7 +105,7 @@
<g:form mapping="extendedSearch" fragment="searchResults" method="GET" class="extendedSearch ${hidden}" name="Rattsfall">
<input type="hidden" name="kategori" value="Rattsfall" />
- <label for="utgivare"><g:message code="extendedSearch.domstol.label" default="Völj domstol"/></label>
+ <label for="utgivare"><g:message code="extendedSearch.domstol.label" default="Välj domstol"/></label>
<select name="utgivare">
<g:each in="${grailsApplication.config.lagrummet.search.courtList}">
<option value="${it.value}"
View
2 lagrummet.se-config.properties.template
@@ -0,0 +1,2 @@
+dataSource.username=theUser
+dataSource.password=thePassword

0 comments on commit 07fb198

Please sign in to comment.
Something went wrong with that request. Please try again.