Changeset 7321 for main/waeup.sirp/trunk/src/waeup/sirp/browser
- Timestamp:
- 10 Dec 2011, 06:15:17 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/browser
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/__init__.py
r7274 r7321 2 2 3 3 from waeup.sirp.browser.layout import ( 4 WAeUPPage, WAeUPForm, WAeUPLayout, WAeUPDisplayFormPage, WAeUPEditFormPage,5 WAeUPAddFormPage, NullValidator)4 SIRPPage, SIRPForm, SIRPLayout, SIRPDisplayFormPage, SIRPEditFormPage, 5 SIRPAddFormPage, NullValidator) 6 6 from waeup.sirp.browser.pages import ContactAdminForm 7 7 -
main/waeup.sirp/trunk/src/waeup/sirp/browser/breadcrumbs.py
r7195 r7321 33 33 """ 34 34 grok.provides(IBreadcrumb) 35 grok.context(interfaces.I WAeUPObject)35 grok.context(interfaces.ISIRPObject) 36 36 grok.name('index') 37 37 -
main/waeup.sirp/trunk/src/waeup/sirp/browser/browser.txt
r7234 r7321 1 Browsing the WAeUP portal2 ************* ************3 4 Here we visit all parts of a WAeUP portal using a browser.1 Browsing SIRP 2 ************* 3 4 Here we visit all parts of a SIRP portal using a browser. 5 5 6 6 University -
main/waeup.sirp/trunk/src/waeup/sirp/browser/exceptions.py
r7195 r7321 22 22 from zope.publisher.interfaces import INotFound 23 23 from zope.security.interfaces import IUnauthorized 24 from waeup.sirp.browser.layout import WAeUPPage24 from waeup.sirp.browser.layout import SIRPPage 25 25 26 26 grok.templatedir('templates') … … 61 61 62 62 63 class NotFoundPage( WAeUPPage):63 class NotFoundPage(SIRPPage): 64 64 """A page rendered when an object cannot be found. 65 65 -
main/waeup.sirp/trunk/src/waeup/sirp/browser/interfaces.py
r7308 r7321 21 21 from zope.interface import Interface, Attribute 22 22 from waeup.sirp.interfaces import ( 23 I WAeUPObject, IUniversity, IUsersContainer, IDataCenter)23 ISIRPObject, IUniversity, IUsersContainer, IDataCenter) 24 24 from waeup.sirp.university.interfaces import ( 25 25 IFacultyContainer, IFaculty, IFacultyAdd, IDepartment, IDepartmentAdd, -
main/waeup.sirp/trunk/src/waeup/sirp/browser/layout.py
r7274 r7321 29 29 from zope.interface import Interface 30 30 from zope.site.hooks import getSite 31 from waeup.sirp.interfaces import I WAeUPObject, IUserAccount31 from waeup.sirp.interfaces import ISIRPObject, IUserAccount 32 32 from waeup.sirp.browser.interfaces import ITheme 33 from waeup.sirp.browser.theming import get_all_themes, WAeUPThemeGray133 from waeup.sirp.browser.theming import get_all_themes, SIRPThemeGray1 34 34 from waeup.sirp.students.interfaces import IStudentNavigation 35 35 from waeup.sirp.applicants.interfaces import IApplicant … … 101 101 return True 102 102 103 class WAeUPLayout(Layout, UtilityView):103 class SIRPLayout(Layout, UtilityView): 104 104 """A megrok.layout.Layout with additional methods. 105 105 """ 106 106 grok.baseclass() 107 107 108 class WAeUPForm(Form, UtilityView):108 class SIRPForm(Form, UtilityView): 109 109 """A megrok.layout.Form with additional methods. 110 110 """ … … 112 112 113 113 def setUpWidgets(self,ignore_request=False): 114 super( WAeUPForm,self).setUpWidgets(ignore_request)114 super(SIRPForm,self).setUpWidgets(ignore_request) 115 115 if self.widgets.get('subject'): 116 116 self.widgets['subject'].displayWidth = 45 … … 120 120 self.widgets['body'].width = 35 121 121 122 class WAeUPPage(Page):122 class SIRPPage(Page): 123 123 """A megrok.layout page with additional methods. 124 124 """ 125 125 grok.baseclass() 126 126 127 class WAeUPDisplayFormPage(DisplayForm, UtilityView):127 class SIRPDisplayFormPage(DisplayForm, UtilityView): 128 128 """A megrok.layout.DisplayForm with additional methods. 129 129 """ … … 131 131 template = default_waeup_display_template 132 132 133 class WAeUPEditFormPage(EditForm, UtilityView):133 class SIRPEditFormPage(EditForm, UtilityView): 134 134 """A megrok.layout.EditForm with additional methods. 135 135 """ … … 138 138 139 139 def setUpWidgets(self,ignore_request=False): 140 super( WAeUPEditFormPage,self).setUpWidgets(ignore_request)140 super(SIRPEditFormPage,self).setUpWidgets(ignore_request) 141 141 if self.widgets.get('title'): 142 142 self.widgets['title'].displayWidth = 80 … … 148 148 self.widgets['notice'].height = 3 149 149 150 class WAeUPAddFormPage(AddForm, UtilityView):150 class SIRPAddFormPage(AddForm, UtilityView): 151 151 """A megrok.layout.AddForm with additional methods. 152 152 """ … … 154 154 template = default_waeup_edit_template 155 155 156 class SiteLayout( WAeUPLayout):156 class SiteLayout(SIRPLayout): 157 157 """ The general site layout. 158 158 """ 159 grok.context(I WAeUPObject)159 grok.context(ISIRPObject) 160 160 161 161 #: An instance of the default theme to use for the site layout 162 default_theme = WAeUPThemeGray1()162 default_theme = SIRPThemeGray1() 163 163 stafftemp = grok.PageTemplateFile('templates/staffsitelayout.pt') 164 164 studenttemp = grok.PageTemplateFile('templates/studentsitelayout.pt') -
main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
r7274 r7321 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """ Viewing components for WAeUP objects.18 """ Viewing components for SIRP objects. 19 19 """ 20 20 import copy … … 38 38 from zope.session.interfaces import ISession 39 39 from waeup.sirp.browser import ( 40 WAeUPPage, WAeUPForm, WAeUPEditFormPage, WAeUPAddFormPage,41 WAeUPDisplayFormPage, NullValidator)40 SIRPPage, SIRPForm, SIRPEditFormPage, SIRPAddFormPage, 41 SIRPDisplayFormPage, NullValidator) 42 42 from waeup.sirp.browser.interfaces import ( 43 43 IUniversity, IFacultyContainer, IFaculty, IFacultyAdd, … … 46 46 from waeup.sirp.browser.resources import warning, datepicker, tabs, datatable 47 47 from waeup.sirp.interfaces import( 48 I WAeUPObject, IUsersContainer, IUserAccount, IDataCenter,49 I WAeUPXMLImporter, IWAeUPXMLExporter, IBatchProcessor,48 ISIRPObject, IUsersContainer, IUserAccount, IDataCenter, 49 ISIRPXMLImporter, ISIRPXMLExporter, IBatchProcessor, 50 50 ILocalRolesAssignable, DuplicationError, IConfigurationContainer, 51 51 ISessionConfiguration, ISessionConfigurationAdd, … … 60 60 from waeup.sirp.utils.helpers import get_user_account, send_mail 61 61 62 grok.context(I WAeUPObject)62 grok.context(ISIRPObject) 63 63 grok.templatedir('templates') 64 64 … … 139 139 # 140 140 141 class LoginPage( WAeUPPage):141 class LoginPage(SIRPPage): 142 142 """A login page, available for all objects. 143 143 """ 144 144 grok.name('login') 145 grok.context(I WAeUPObject)145 grok.context(ISIRPObject) 146 146 grok.require('waeup.Public') 147 147 title = u'Login' … … 174 174 175 175 176 class LogoutPage( WAeUPPage):176 class LogoutPage(SIRPPage): 177 177 """A logout page. Calling this page will log the current user out. 178 178 """ 179 grok.context(I WAeUPObject)179 grok.context(ISIRPObject) 180 180 grok.require('waeup.Public') 181 181 grok.name('logout') … … 185 185 auth = getUtility(IAuthentication) 186 186 ILogout(auth).logout(self.request) 187 self.flash("You have been logged out. Thanks for using WAeUP SIRP!")187 self.flash("You have been logged out. Thanks for using SIRP SIRP!") 188 188 self.redirect(self.application_url()) 189 189 … … 192 192 # 193 193 194 class ContactAdminForm( WAeUPForm):194 class ContactAdminForm(SIRPForm): 195 195 grok.name('contactadmin') 196 196 #grok.context(IUniversity) … … 263 263 # 264 264 265 class UniversityPage( WAeUPDisplayFormPage):265 class UniversityPage(SIRPDisplayFormPage): 266 266 """ The main university page. 267 267 """ … … 286 286 return view.widgets['frontpage']() 287 287 288 class AdministrationPage( WAeUPPage):288 class AdministrationPage(SIRPPage): 289 289 """ The administration overview page. 290 290 """ … … 333 333 # 334 334 335 class UsersContainerPage( WAeUPPage):335 class UsersContainerPage(SIRPPage): 336 336 """Overview page for all local users. 337 337 """ … … 370 370 return site_roles_string 371 371 372 class AddUserFormPage( WAeUPAddFormPage):372 class AddUserFormPage(SIRPAddFormPage): 373 373 grok.require('waeup.manageUsers') 374 374 grok.context(IUsersContainer) … … 407 407 self.redirect(self.url(self.context)) 408 408 409 class UserManageFormPage( WAeUPEditFormPage):409 class UserManageFormPage(SIRPEditFormPage): 410 410 """Manage a user account. 411 411 """ … … 499 499 return "%s (%s)" % (self.context.title, self.context.__name__) 500 500 501 class MyRolesPage( WAeUPPage):501 class MyRolesPage(SIRPPage): 502 502 """Display site roles and local roles assigned to officers. 503 503 """ … … 535 535 # 536 536 537 class SearchPage( WAeUPPage):537 class SearchPage(SIRPPage): 538 538 """General search page for the academics section. 539 539 """ … … 562 562 # 563 563 564 class ConfigurationContainerDisplayFormPage( WAeUPDisplayFormPage):564 class ConfigurationContainerDisplayFormPage(SIRPDisplayFormPage): 565 565 """View page of the configuration container. 566 566 """ … … 574 574 form_fields['frontpage'].custom_widget = ReSTDisplayWidget 575 575 576 class ConfigurationContainerManageFormPage( WAeUPEditFormPage):576 class ConfigurationContainerManageFormPage(SIRPEditFormPage): 577 577 """Manage page of the configuration container. We always use the 578 578 manage page in the UI not the view page, thus we use the index name here. … … 629 629 return 630 630 631 class SessionConfigurationAddFormPage( WAeUPAddFormPage):631 class SessionConfigurationAddFormPage(SIRPAddFormPage): 632 632 """Add a session configuration object to configuration container. 633 633 """ … … 657 657 return 658 658 659 class SessionConfigurationManageFormPage( WAeUPEditFormPage):659 class SessionConfigurationManageFormPage(SIRPEditFormPage): 660 660 """Manage session configuration object. 661 661 """ … … 692 692 # 693 693 694 class DatacenterPage( WAeUPPage):694 class DatacenterPage(SIRPPage): 695 695 grok.context(IDataCenter) 696 696 grok.name('index') … … 699 699 pnav = 0 700 700 701 class DatacenterUploadPage( WAeUPPage):701 class DatacenterUploadPage(SIRPPage): 702 702 grok.context(IDataCenter) 703 703 grok.name('upload') … … 743 743 return '%s_%s%s' % (base, filtered_username, ext.lower()) 744 744 745 class DatacenterImportStep1( WAeUPPage):745 class DatacenterImportStep1(SIRPPage): 746 746 """Manual import step 1: choose file 747 747 """ … … 773 773 self.redirect(self.url(self.context, '@@import2')) 774 774 775 class DatacenterImportStep2( WAeUPPage):775 class DatacenterImportStep2(SIRPPage): 776 776 """Manual import step 2: choose importer 777 777 """ … … 891 891 self.flash(warnings) 892 892 893 class DatacenterImportStep3( WAeUPPage):893 class DatacenterImportStep3(SIRPPage): 894 894 """Manual import step 3: modify header 895 895 """ … … 995 995 self.flash(warnings) 996 996 997 class DatacenterImportStep4( WAeUPPage):997 class DatacenterImportStep4(SIRPPage): 998 998 """Manual import step 4: do actual import 999 999 """ … … 1052 1052 linenum - (self.warn_num))) 1053 1053 1054 class DatacenterLogsOverview( WAeUPPage):1054 class DatacenterLogsOverview(SIRPPage): 1055 1055 grok.context(IDataCenter) 1056 1056 grok.name('logs') … … 1073 1073 self.files = self.context.getLogFiles() 1074 1074 1075 class DatacenterLogsFileview( WAeUPPage):1075 class DatacenterLogsFileview(SIRPPage): 1076 1076 grok.context(IDataCenter) 1077 1077 grok.name('show') … … 1092 1092 self.filecontents = open(fullpath, 'rb').read() 1093 1093 1094 class DatacenterSettings( WAeUPPage):1094 class DatacenterSettings(SIRPPage): 1095 1095 grok.context(IDataCenter) 1096 1096 grok.name('manage') … … 1132 1132 1133 1133 def render(self): 1134 exporter = I WAeUPXMLExporter(self.context)1134 exporter = ISIRPXMLExporter(self.context) 1135 1135 xml = exporter.export().read() 1136 1136 self.response.setHeader( … … 1138 1138 return xml 1139 1139 1140 class ImportXMLPage( WAeUPPage):1140 class ImportXMLPage(SIRPPage): 1141 1141 """Replace the context object by an object created from an XML 1142 1142 representation. … … 1154 1154 if not xmlfile: 1155 1155 return 1156 importer = I WAeUPXMLImporter(self.context)1156 importer = ISIRPXMLImporter(self.context) 1157 1157 obj = importer.doImport(xmlfile) 1158 1158 if type(obj) != type(self.context): … … 1175 1175 # 1176 1176 1177 class FacultyContainerPage( WAeUPPage):1177 class FacultyContainerPage(SIRPPage): 1178 1178 """ Index page for faculty containers. 1179 1179 """ … … 1186 1186 grok.template('facultypage') 1187 1187 1188 class FacultyContainerManageFormPage( WAeUPEditFormPage):1188 class FacultyContainerManageFormPage(SIRPEditFormPage): 1189 1189 """Manage the basic properties of a `Faculty` instance. 1190 1190 """ … … 1224 1224 1225 1225 1226 class FacultyAddFormPage( WAeUPAddFormPage):1226 class FacultyAddFormPage(SIRPAddFormPage): 1227 1227 """ Page form to add a new faculty to a faculty container. 1228 1228 """ … … 1253 1253 # Faculty pages 1254 1254 # 1255 class FacultyPage( WAeUPPage):1255 class FacultyPage(SIRPPage): 1256 1256 """Index page of faculties. 1257 1257 """ … … 1269 1269 return 'Departments' 1270 1270 1271 class FacultyManageFormPage( WAeUPEditFormPage):1271 class FacultyManageFormPage(SIRPEditFormPage): 1272 1272 """Manage the basic properties of a `Faculty` instance. 1273 1273 """ … … 1341 1341 return del_local_roles(self,3,**data) 1342 1342 1343 class DepartmentAddFormPage( WAeUPAddFormPage):1343 class DepartmentAddFormPage(SIRPAddFormPage): 1344 1344 """Add a department to a faculty. 1345 1345 """ … … 1374 1374 # Department pages 1375 1375 # 1376 class DepartmentPage( WAeUPPage):1376 class DepartmentPage(SIRPPage): 1377 1377 """Department index page. 1378 1378 """ … … 1407 1407 yield(dict(url=url, name=key, container=val)) 1408 1408 1409 class ShowStudentsPage( WAeUPPage):1409 class ShowStudentsPage(SIRPPage): 1410 1410 """Page that lists all students in the department. 1411 1411 """ … … 1430 1430 return 1431 1431 1432 class DepartmentManageFormPage( WAeUPEditFormPage):1432 class DepartmentManageFormPage(SIRPEditFormPage): 1433 1433 """Manage the basic properties of a `Department` instance. 1434 1434 """ … … 1530 1530 return del_local_roles(self,4,**data) 1531 1531 1532 class CourseAddFormPage( WAeUPAddFormPage):1532 class CourseAddFormPage(SIRPAddFormPage): 1533 1533 """Add-form to add course to a department. 1534 1534 """ … … 1571 1571 return 1572 1572 1573 class CertificateAddFormPage( WAeUPAddFormPage):1573 class CertificateAddFormPage(SIRPAddFormPage): 1574 1574 """Add-form to add certificate to a department. 1575 1575 """ … … 1616 1616 # Courses pages 1617 1617 # 1618 class CoursePage( WAeUPPage):1618 class CoursePage(SIRPPage): 1619 1619 """Course index page. 1620 1620 """ … … 1629 1629 return 'Course: %s (%s)' % (self.context.title, self.context.code) 1630 1630 1631 class CourseManageFormPage( WAeUPEditFormPage):1631 class CourseManageFormPage(SIRPEditFormPage): 1632 1632 """Edit form page for courses. 1633 1633 """ … … 1663 1663 # Certificate pages 1664 1664 # 1665 class CertificatePage( WAeUPDisplayFormPage):1665 class CertificatePage(SIRPDisplayFormPage): 1666 1666 """Index page for certificates. 1667 1667 """ … … 1683 1683 return super(CertificatePage, self).update() 1684 1684 1685 class CertificateManageFormPage( WAeUPEditFormPage):1685 class CertificateManageFormPage(SIRPEditFormPage): 1686 1686 """Manage the properties of a `Certificate` instance. 1687 1687 """ … … 1738 1738 1739 1739 1740 class CertificateCourseAddFormPage( WAeUPAddFormPage):1740 class CertificateCourseAddFormPage(SIRPAddFormPage): 1741 1741 """Add-page to add a course ref to a certificate 1742 1742 """ … … 1771 1771 # Certificate course pages... 1772 1772 # 1773 class CertificateCoursePage( WAeUPPage):1773 class CertificateCoursePage(SIRPPage): 1774 1774 """CertificateCourse index page. 1775 1775 """ … … 1788 1788 return course_levels.getTerm(self.context.level).title 1789 1789 1790 class CertificateCourseManageFormPage( WAeUPEditFormPage):1790 class CertificateCourseManageFormPage(SIRPEditFormPage): 1791 1791 """Manage the basic properties of a `CertificateCourse` instance. 1792 1792 """ -
main/waeup.sirp/trunk/src/waeup/sirp/browser/resources.py
r7280 r7321 257 257 depends=[reset_fonts_grids]) 258 258 259 #: Register basic WAeUP base CSS (which is based on ``yuiapp.css`` as a259 #: Register basic SIRP base CSS (which is based on ``yuiapp.css`` as a 260 260 #: resource. 261 261 waeup_base_css = ResourceInclusion( … … 263 263 depends=[yuiapp_css, base]) 264 264 265 #: The red WAeUP theme registered as a resource.265 #: The red SIRP theme registered as a resource. 266 266 waeuptheme_red1 = ResourceInclusion( 267 267 waeup_sirp, 'waeuptheme-red1.css', 268 268 depends=[waeup_base_css]) 269 269 270 #: The gray WAeUP theme registered as a resource.270 #: The gray SIRP theme registered as a resource. 271 271 waeuptheme_gray1 = ResourceInclusion( 272 272 waeup_sirp, 'waeuptheme-gray1.css', -
main/waeup.sirp/trunk/src/waeup/sirp/browser/static/waeup-base.css
r7240 r7321 1 /* This is the base stylesheet for WAeUPSIRP. It defines base styles1 /* This is the base stylesheet for SIRP. It defines base styles 2 2 additionally or modifying yuiapp.css styles and yuirfg.css. For themes, please create 3 3 a stylesheet overriding values set here in a file named -
main/waeup.sirp/trunk/src/waeup/sirp/browser/theming.py
r7195 r7321 23 23 from zope.interface import Interface 24 24 from zope.schema.interfaces import IVocabularyFactory 25 from waeup.sirp.interfaces import Simple WAeUPVocabulary25 from waeup.sirp.interfaces import SimpleSIRPVocabulary 26 26 from waeup.sirp.browser.interfaces import ITheme 27 27 from waeup.sirp.browser.resources import ( … … 30 30 ) 31 31 32 class WAeUPThemeBase(grok.GlobalUtility):32 class SIRPThemeBase(grok.GlobalUtility): 33 33 grok.implements(ITheme) 34 34 grok.name('base waeup theme') … … 39 39 return [waeup_base_css] 40 40 41 class WAeUPThemeRed1(grok.GlobalUtility):41 class SIRPThemeRed1(grok.GlobalUtility): 42 42 grok.implements(ITheme) 43 43 grok.name('red waeup theme') … … 48 48 return [waeuptheme_red1] 49 49 50 class WAeUPThemeGray1(grok.GlobalUtility):50 class SIRPThemeGray1(grok.GlobalUtility): 51 51 grok.implements(ITheme) 52 52 grok.name('gray waeup theme') … … 57 57 return [waeuptheme_gray1] 58 58 59 class WAeUPThemeEmpty(grok.GlobalUtility):59 class SIRPThemeEmpty(grok.GlobalUtility): 60 60 """A theme based on jQuery only. 61 61 … … 113 113 terms = [(theme.description, name) 114 114 for name, theme in get_all_themes()] 115 vocab = Simple WAeUPVocabulary(*terms)115 vocab = SimpleSIRPVocabulary(*terms) 116 116 return vocab -
main/waeup.sirp/trunk/src/waeup/sirp/browser/viewlets.py
r7243 r7321 28 28 IFacultyContainer, IFaculty, IDepartment, ICourse, ICertificate, 29 29 ICertificateCourse, IBreadcrumbContainer, IUniversity, IUsersContainer) 30 from waeup.sirp.interfaces import (I WAeUPObject, IWAeUPXMLExporter,31 I WAeUPXMLImporter, IDataCenter, IUserAccount)32 from waeup.sirp.browser.layout import WAeUPPage, default_primary_nav_template30 from waeup.sirp.interfaces import (ISIRPObject, ISIRPXMLExporter, 31 ISIRPXMLImporter, IDataCenter, IUserAccount) 32 from waeup.sirp.browser.layout import SIRPPage, default_primary_nav_template 33 33 from waeup.sirp.utils.helpers import get_user_account 34 34 35 35 grok.templatedir('templates') 36 grok.context(I WAeUPObject) # Make IWAeUPObject the default context36 grok.context(ISIRPObject) # Make ISIRPObject the default context 37 37 38 38 class LeftSidebar(grok.ViewletManager): … … 74 74 """ 75 75 grok.baseclass() 76 grok.context(I WAeUPObject)76 grok.context(ISIRPObject) 77 77 grok.viewletmanager(ActionBar) 78 78 icon = 'actionicon_modify.png' # File must exist in static/ … … 185 185 186 186 class BreadCrumbs(grok.Viewlet): 187 grok.context(I WAeUPObject)187 grok.context(ISIRPObject) 188 188 grok.viewletmanager(BreadCrumbManager) 189 189 grok.order(1) … … 227 227 grok.baseclass() 228 228 grok.viewletmanager(LeftSidebar) 229 grok.context(I WAeUPObject)229 grok.context(ISIRPObject) 230 230 grok.order(5) 231 231 grok.require('waeup.manageUniversity') … … 279 279 """ 280 280 grok.viewletmanager(LeftSidebar) 281 grok.context(I WAeUPObject)281 grok.context(ISIRPObject) 282 282 grok.view(Interface) 283 283 grok.order(2) … … 313 313 """ 314 314 grok.viewletmanager(LeftSidebar) 315 grok.context(I WAeUPObject)315 grok.context(ISIRPObject) 316 316 grok.view(Interface) 317 317 grok.order(5) … … 519 519 class BrowseActionButton(ActionButton): 520 520 grok.baseclass() 521 grok.context(I WAeUPObject)521 grok.context(ISIRPObject) 522 522 grok.template('actionbutton') 523 523 grok.viewletmanager(ActionBar)
Note: See TracChangeset for help on using the changeset viewer.