Changeset 7811 for main/waeup.kofa/trunk/src/waeup/kofa/hostels
- Timestamp:
- 8 Mar 2012, 19:00:51 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/hostels
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/hostels/__init__.py
r6963 r7811 2 2 """ 3 3 # Make this a package. 4 from waeup. sirp.hostels.container import HostelsContainer5 from waeup. sirp.hostels.hostel import Hostel, Bed4 from waeup.kofa.hostels.container import HostelsContainer 5 from waeup.kofa.hostels.hostel import Hostel, Bed 6 6 7 7 __all__ = [ -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser.py
r7718 r7811 22 22 from zope.i18n import translate 23 23 from zope.component import getUtility 24 from waeup. sirp.browser import (25 SIRPEditFormPage, SIRPAddFormPage, SIRPDisplayFormPage,24 from waeup.kofa.browser import ( 25 KOFAEditFormPage, KOFAAddFormPage, KOFADisplayFormPage, 26 26 NullValidator) 27 from waeup. sirp.browser.breadcrumbs import Breadcrumb28 from waeup. sirp.browser.resources import datepicker, datatable, tabs, warning29 from waeup. sirp.browser.layout import default_primary_nav_template30 from waeup. sirp.browser.pages import delSubobjects31 from waeup. sirp.browser.viewlets import (27 from waeup.kofa.browser.breadcrumbs import Breadcrumb 28 from waeup.kofa.browser.resources import datepicker, datatable, tabs, warning 29 from waeup.kofa.browser.layout import default_primary_nav_template 30 from waeup.kofa.browser.pages import delSubobjects 31 from waeup.kofa.browser.viewlets import ( 32 32 ManageActionButton, PrimaryNavTab) 33 from waeup. sirp.browser.layout import jsaction, action34 from waeup. sirp.interfaces import ISIRPObject, ISIRPUtils35 from waeup. sirp.interfaces import MessageFactory as _36 from waeup. sirp.hostels.vocabularies import NOT_OCCUPIED37 from waeup. sirp.hostels.hostel import Hostel38 from waeup. sirp.hostels.interfaces import (33 from waeup.kofa.browser.layout import jsaction, action 34 from waeup.kofa.interfaces import IKOFAObject, IKOFAUtils 35 from waeup.kofa.interfaces import MessageFactory as _ 36 from waeup.kofa.hostels.vocabularies import NOT_OCCUPIED 37 from waeup.kofa.hostels.hostel import Hostel 38 from waeup.kofa.hostels.interfaces import ( 39 39 IHostelsContainer, IHostel, IBed, IBedAllocateStudent) 40 40 41 41 def write_log_message(view, message): 42 ob_class = view.__implemented__.__name__.replace('waeup. sirp.','')42 ob_class = view.__implemented__.__name__.replace('waeup.kofa.','') 43 43 view.context.loggerInfo(ob_class, message) 44 44 return … … 61 61 """ 62 62 63 grok.context(I SIRPObject)63 grok.context(IKOFAObject) 64 64 grok.order(5) 65 65 grok.require('waeup.viewHostels') … … 96 96 mapping = {'a':co[1], 'b':co[2], 'c':co[3]}) 97 97 98 class HostelsContainerPage( SIRPDisplayFormPage):98 class HostelsContainerPage(KOFADisplayFormPage): 99 99 """The standard view for hostels containers. 100 100 """ … … 113 113 text = _('Manage accommodation section') 114 114 115 class HostelsContainerManagePage( SIRPDisplayFormPage):115 class HostelsContainerManagePage(KOFADisplayFormPage): 116 116 """The manage page for hostel containers. 117 117 """ … … 148 148 return 149 149 150 class HostelAddFormPage( SIRPAddFormPage):150 class HostelAddFormPage(KOFAAddFormPage): 151 151 """Add-form to add a hostel. 152 152 """ … … 175 175 return 176 176 177 class HostelDisplayFormPage( SIRPDisplayFormPage):177 class HostelDisplayFormPage(KOFADisplayFormPage): 178 178 """ Page to display hostel data 179 179 """ … … 196 196 target = 'manage' 197 197 198 class HostelManageFormPage( SIRPEditFormPage):198 class HostelManageFormPage(KOFAEditFormPage): 199 199 """ View to edit hostel data 200 200 """ … … 261 261 switched = [] # for log file 262 262 switched_translated = [] # for flash message 263 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE263 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 264 264 preferred_language = self.request.cookies.get( 265 ' sirp.language', portal_language)265 'kofa.language', portal_language) 266 266 for bed_id in child_id: 267 267 message = self.context[bed_id].switchReservation() 268 268 switched.append('%s (%s)' % (bed_id,message)) 269 m_translated = translate(message, 'waeup. sirp',269 m_translated = translate(message, 'waeup.kofa', 270 270 target_language=preferred_language) 271 271 switched_translated.append('%s (%s)' % (bed_id,m_translated)) … … 306 306 return 307 307 308 class BedManageFormPage( SIRPEditFormPage):308 class BedManageFormPage(KOFAEditFormPage): 309 309 """ View to edit bed data 310 310 """ -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser_templates/containermanagepage.pt
r7718 r7811 1 1 <form action="." tal:attributes="action request/URL" 2 i18n:domain="waeup. sirp"2 i18n:domain="waeup.kofa" 3 3 method="POST" enctype="multipart/form-data"> 4 4 <table> -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser_templates/containerpage.pt
r7718 r7811 1 <div i18n:domain="waeup. sirp"1 <div i18n:domain="waeup.kofa" 2 2 i18n:translate="" tal:condition="python: not len(context.keys())"> 3 3 There no subobjects registered yet. 4 4 </div> 5 5 6 <table i18n:domain="waeup. sirp">6 <table i18n:domain="waeup.kofa"> 7 7 <thead> 8 8 <tr> -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser_templates/hostelmanagepage.pt
r7737 r7811 1 1 <form action="." tal:attributes="action request/URL" method="POST" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 4 4 <ul class="tabs" data-tabs="tabs"> -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/catalog.py
r7257 r7811 20 20 import grok 21 21 from grok import index 22 from waeup. sirp.interfaces import IUniversity23 from waeup. sirp.hostels.interfaces import IBed22 from waeup.kofa.interfaces import IUniversity 23 from waeup.kofa.hostels.interfaces import IBed 24 24 25 25 class BedIndexes(grok.Indexes): -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/container.py
r7652 r7811 20 20 """ 21 21 import grok 22 from waeup. sirp.hostels.interfaces import IHostelsContainer, IHostel23 from waeup. sirp.utils.logger import Logger22 from waeup.kofa.hostels.interfaces import IHostelsContainer, IHostel 23 from waeup.kofa.utils.logger import Logger 24 24 25 25 class HostelsContainer(grok.Container, Logger): … … 48 48 return 49 49 50 logger_name = 'waeup. sirp.${sitename}.hostels'50 logger_name = 'waeup.kofa.${sitename}.hostels' 51 51 logger_filename = 'hostels.log' 52 52 -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/hostel.py
r7718 r7811 22 22 from zope.event import notify 23 23 from datetime import datetime 24 from waeup. sirp.utils.helpers import attrs_to_fields25 from waeup. sirp.hostels.vocabularies import NOT_OCCUPIED26 from waeup. sirp.hostels.interfaces import IHostel, IBed, IBedAllocateStudent27 from waeup. sirp.students.interfaces import IBedTicket28 from waeup. sirp.interfaces import MessageFactory as _24 from waeup.kofa.utils.helpers import attrs_to_fields 25 from waeup.kofa.hostels.vocabularies import NOT_OCCUPIED 26 from waeup.kofa.hostels.interfaces import IHostel, IBed, IBedAllocateStudent 27 from waeup.kofa.students.interfaces import IBedTicket 28 from waeup.kofa.interfaces import MessageFactory as _ 29 29 30 30 class Hostel(grok.Container): -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/interfaces.py
r7718 r7811 18 18 from zope.interface import invariant, Invalid 19 19 from zope import schema 20 from waeup. sirp.interfaces import ISIRPObject21 from waeup. sirp.interfaces import MessageFactory as _22 from waeup. sirp.hostels.vocabularies import (20 from waeup.kofa.interfaces import IKOFAObject 21 from waeup.kofa.interfaces import MessageFactory as _ 22 from waeup.kofa.hostels.vocabularies import ( 23 23 bed_letters, blocks, special_handling, StudentSource) 24 24 25 class IHostelsContainer(I SIRPObject):25 class IHostelsContainer(IKOFAObject): 26 26 """A container for all kind of hostel objects. 27 27 28 28 """ 29 29 30 class IHostel(I SIRPObject):30 class IHostel(IKOFAObject): 31 31 """A base representation of hostels. 32 32 … … 146 146 raise Invalid(_('Bed categories overlap.')) 147 147 148 class IBed(I SIRPObject):148 class IBed(IKOFAObject): 149 149 """A base representation of beds. 150 150 -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py
r7802 r7811 30 30 from zope.catalog.interfaces import ICatalog 31 31 from zope.component import queryUtility 32 from waeup. sirp.app import University33 from waeup. sirp.hostels.interfaces import (32 from waeup.kofa.app import University 33 from waeup.kofa.hostels.interfaces import ( 34 34 IHostelsContainer, IHostel, IBed) 35 from waeup. sirp.hostels.container import HostelsContainer36 from waeup. sirp.hostels.hostel import Hostel, Bed37 from waeup. sirp.testing import (FunctionalLayer, FunctionalTestCase)38 from waeup. sirp.students.student import Student39 from waeup. sirp.students.accommodation import BedTicket40 from waeup. sirp.university.department import Department35 from waeup.kofa.hostels.container import HostelsContainer 36 from waeup.kofa.hostels.hostel import Hostel, Bed 37 from waeup.kofa.testing import (FunctionalLayer, FunctionalTestCase) 38 from waeup.kofa.students.student import Student 39 from waeup.kofa.students.accommodation import BedTicket 40 from waeup.kofa.university.department import Department 41 41 42 42 class HostelsContainerTestCase(FunctionalTestCase): -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/vocabularies.py
r7718 r7811 22 22 from zope.catalog.interfaces import ICatalog 23 23 from zc.sourcefactory.contextual import BasicContextualSourceFactory 24 from waeup. sirp.interfaces import SimpleSIRPVocabulary25 from waeup. sirp.interfaces import MessageFactory as _24 from waeup.kofa.interfaces import SimpleKOFAVocabulary 25 from waeup.kofa.interfaces import MessageFactory as _ 26 26 27 27 NOT_OCCUPIED = u'not occupied' … … 54 54 return "%s - %s" % (value, self.acco_students(context)[value]) 55 55 56 bed_letters = Simple SIRPVocabulary(56 bed_letters = SimpleKOFAVocabulary( 57 57 (_('Bed A'),'A'), 58 58 (_('Bed B'),'B'), … … 66 66 ) 67 67 68 blocks = Simple SIRPVocabulary(68 blocks = SimpleKOFAVocabulary( 69 69 (_('Block A'),'A'), 70 70 (_('Block B'),'B'), … … 84 84 ) 85 85 86 special_handling = Simple SIRPVocabulary(86 special_handling = SimpleKOFAVocabulary( 87 87 (_('Regular Hostel'),'regular'), 88 88 (_('Blocked Hostel'),'blocked'),
Note: See TracChangeset for help on using the changeset viewer.