Index: /main/waeup.kofa/trunk/CHANGES.txt
===================================================================
--- /main/waeup.kofa/trunk/CHANGES.txt	(revision 13318)
+++ /main/waeup.kofa/trunk/CHANGES.txt	(revision 13319)
@@ -5,6 +5,5 @@
 =======================
 
-* Add some methods to release expired bed allocations. View
-  components have to be added in custom packages.
+* Add methods and page to release expired bed allocations.
 
 
Index: /main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser.py	(revision 13318)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser.py	(revision 13319)
@@ -24,5 +24,5 @@
 from waeup.kofa.browser.layout import (
     KofaEditFormPage, KofaAddFormPage, KofaDisplayFormPage,
-    NullValidator)
+    NullValidator, UtilityView)
 from waeup.kofa.browser.breadcrumbs import Breadcrumb
 from waeup.kofa.browser.layout import default_primary_nav_template
@@ -164,4 +164,26 @@
         self.applyData(self.context, **data)
         self.flash(_('Settings have been saved.'))
+        return
+
+class ReleaseExpiredAllocationsPage(UtilityView, grok.View):
+    """Release all expired allocated beds.
+    """
+    grok.context(IHostelsContainer)
+    grok.name('releaseexpired')
+    grok.require('waeup.waeup.manageHostels')
+
+    def update(self, n=7):
+        released = self.context.releaseExpiredAllocations(n)
+        if len(released):
+            message = ', '.join(released)
+            self.context.writeLogMessage(self, 'released: %s' % message)
+            flash_msg = _('Successfully released beds: ${a}', mapping = {'a':message})
+        else:
+            flash_msg = _('No bed released.')
+        self.flash(flash_msg, type='success')
+        self.redirect(self.url(self.context))
+        return
+
+    def render(self):
         return
 
Index: /main/waeup.kofa/trunk/src/waeup/kofa/hostels/container.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/hostels/container.py	(revision 13318)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/hostels/container.py	(revision 13319)
@@ -65,7 +65,4 @@
             if student_id:
                 released.append('%s (%s)' % (bed.bed_id,student_id))
-        if len(released):
-            message = ', '.join(released)
-            self.writeLogMessage(self, 'released: %s' % message)
         return released
 
Index: /main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py	(revision 13318)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py	(revision 13319)
@@ -180,4 +180,5 @@
 
     def test_release_expired_allocations(self):
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
         cat = queryUtility(ICatalog, name='beds_catalog')
         bedticket = BedTicket()
@@ -191,11 +192,12 @@
         results = cat.searchResults(owner=(self.student_id, self.student_id))
         self.assertEqual(len(results), 1)
-        released = self.app['hostels'].releaseExpiredAllocations(7)
-        self.assertEqual(released, [])
+        self.browser.open(self.container_path + '/releaseexpired')
+        self.assertTrue('No bed released' in self.browser.contents)
         delta = timedelta(days=10)
         bedticket.booking_date = datetime.utcnow() - delta
-        released = self.app['hostels'].releaseExpiredAllocations(7)
-        self.assertEqual(len(released), 1)
-        self.assertEqual(released, ['hall_block_room_bed (K1000000)'])
+        self.browser.open(self.container_path + '/releaseexpired')
+        self.assertTrue(
+            'Successfully released beds: hall_block_room_bed (K1000000)'
+            in self.browser.contents)
         results = cat.searchResults(owner=(self.student_id, self.student_id))
         self.assertEqual(len(results), 0)
@@ -208,5 +210,5 @@
         logcontent = open(self.logfile).read()
         self.assertTrue(
-            'hostels.container.HostelsContainer - hostels - '
+            'hostels.browser.ReleaseExpiredAllocationsPage - hostels - '
             'released: hall_block_room_bed (K1000000)'
             in logcontent)
