Changeset 7445 for main/waeup.sirp/branches/henrik-bootstrap/src/waeup/sirp
- Timestamp:
- 10 Jan 2012, 10:43:18 (13 years ago)
- Location:
- main/waeup.sirp/branches/henrik-bootstrap/src/waeup/sirp/browser
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/branches/henrik-bootstrap/src/waeup/sirp/browser/layout.py
r7442 r7445 52 52 default_primary_nav_template.__grok_name__ = 'default_primary_nav' 53 53 54 55 class action(grok.action): 56 57 def __call__(self, success): 58 action = SIRPAction(self.label, success=success, **self.options) 59 self.actions.append(action) 60 return action 61 62 class SIRPAction(Action): 63 64 def __init__(self, label, style='', **options): 65 super(SIRPAction, self).__init__(label, **options) 66 self.style = style 67 68 def render(self): 69 if not self.available(): 70 return '' 71 label = self.label 72 if isinstance(label, Message): 73 label = zope.i18n.translate(self.label, context=self.form.request) 74 return ('<input type="submit" id="%s" name="%s" value="%s"' 75 ' class="btn %s"/>' % 76 (self.__name__, self.__name__, escape(label, quote=True), 77 self.style)) 78 54 79 class jsaction(grok.action): 55 80 -
main/waeup.sirp/branches/henrik-bootstrap/src/waeup/sirp/browser/pages.py
r7404 r7445 59 59 from waeup.sirp.authentication import get_principal_role_manager 60 60 from waeup.sirp.utils.helpers import get_user_account 61 from waeup.sirp.browser.layout import jsaction, JSAction61 from waeup.sirp.browser.layout import jsaction, action 62 62 63 63 grok.context(ISIRPObject) … … 215 215 return get_user_account(self.request) 216 216 217 @ grok.action('Send message now')217 @action('Send message now', style='primary') 218 218 def send(self, *args, **data): 219 219 fullname = self.request.principal.title … … 244 244 'fullname', 'email_from', 'body') 245 245 246 @ grok.action('Send now')246 @action('Send now', style='primary') 247 247 def send(self, *args, **data): 248 248 sirp_utils = getUtility(ISIRPUtils) … … 378 378 title = 'Portal Users' 379 379 380 @ grok.action('Add user')380 @action('Add user', style='primary') 381 381 def addUser(self, **data): 382 382 name = data['name'] … … 426 426 self.widgets['description'].height = 3 427 427 428 @ grok.action('Save')428 @action('Save', style='primary') 429 429 def save(self, **data): 430 430 form = self.request.form … … 444 444 return 445 445 446 @ grok.action('Cancel', validator=NullValidator)446 @action('Cancel', validator=NullValidator) 447 447 def cancel(self, **data): 448 448 self.redirect(self.url(self.context.__parent__)) … … 461 461 return u'Send message to %s' % self.context.title 462 462 463 @ grok.action('Send message now')463 @action('Send message now', style='primary') 464 464 def send(self, *args, **data): 465 465 try: … … 596 596 return super(ConfigurationContainerManageFormPage, self).update() 597 597 598 @ grok.action('Save')598 @action('Save', style='primary') 599 599 def save(self, **data): 600 600 self.applyData(self.context, **data) … … 602 602 return 603 603 604 @ grok.action('Add session configuration', validator=NullValidator)604 @action('Add session configuration', validator=NullValidator, style='primary') 605 605 def addSubunit(self, **data): 606 606 self.redirect(self.url(self.context, '@@add')) … … 621 621 return 622 622 623 @ grok.action('Update plugins', validator=NullValidator)623 @action('Update plugins', validator=NullValidator) 624 624 def updatePlugins(self, **data): 625 625 grok.getSite().updatePlugins() … … 638 638 pnav = 0 639 639 640 @ grok.action('Add Session Configuration')640 @action('Add Session Configuration', style='primary') 641 641 def addSessionConfiguration(self, **data): 642 642 sessionconfiguration = createObject(u'waeup.SessionConfiguration') … … 650 650 return 651 651 652 @ grok.action('Cancel', validator=NullValidator)652 @action('Cancel', validator=NullValidator) 653 653 def cancel(self): 654 654 self.redirect(self.url(self.context, '@@index')+'#tab-2') … … 674 674 return 'Edit academic session %s configuration' % session_string 675 675 676 @ grok.action('Save')676 @action('Save', style='primary') 677 677 def save(self, **data): 678 678 self.applyData(self.context, **data) … … 681 681 return 682 682 683 @ grok.action('Cancel', validator=NullValidator)683 @action('Cancel', validator=NullValidator) 684 684 def cancel(self): 685 685 self.redirect(self.url(self.context.__parent__, '@@index')+'#tab-2') … … 1210 1210 return 1211 1211 1212 @ grok.action('Add faculty', validator=NullValidator)1212 @action('Add faculty', validator=NullValidator) 1213 1213 def addFaculty(self, **data): 1214 1214 self.redirect(self.url(self.context, '@@add')) 1215 1215 return 1216 1216 1217 @ grok.action('Cancel', validator=NullValidator)1217 @action('Cancel', validator=NullValidator) 1218 1218 def cancel(self, **data): 1219 1219 self.redirect(self.url(self.context)) … … 1232 1232 pnav = 1 1233 1233 1234 @ grok.action('Add faculty')1234 @action('Add faculty', style='primary') 1235 1235 def addFaculty(self, **data): 1236 1236 faculty = createObject(u'waeup.Faculty') … … 1243 1243 self.redirect(self.url(self.context, u'@@manage')+'#tab-1') 1244 1244 1245 @ grok.action('Cancel')1245 @action('Cancel') 1246 1246 def cancel(self, **data): 1247 1247 self.redirect(self.url(self.context)) … … 1315 1315 return 1316 1316 1317 @ grok.action('Save')1317 @action('Save', style='primary') 1318 1318 def save(self, **data): 1319 1319 self.applyData(self.context, **data) 1320 1320 return 1321 1321 1322 @ grok.action('Cancel', validator=NullValidator)1322 @action('Cancel', validator=NullValidator) 1323 1323 def cancel(self, **data): 1324 1324 self.redirect(self.url(self.context)) 1325 1325 return 1326 1326 1327 @ grok.action('Add department', validator=NullValidator)1327 @action('Add department', validator=NullValidator) 1328 1328 def addSubunit(self, **data): 1329 1329 self.redirect(self.url(self.context, '@@add')) 1330 1330 return 1331 1331 1332 @ grok.action('Add local role', validator=NullValidator)1332 @action('Add local role', validator=NullValidator) 1333 1333 def addLocalRole(self, **data): 1334 1334 return add_local_role(self, '3', **data) 1335 1335 1336 @ grok.action('Remove selected local roles')1336 @action('Remove selected local roles') 1337 1337 def delLocalRoles(self, **data): 1338 1338 return del_local_roles(self,3,**data) … … 1352 1352 return self.context.longtitle() 1353 1353 1354 @ grok.action('Add department')1354 @action('Add department', style='primary') 1355 1355 def addDepartment(self, **data): 1356 1356 department = createObject(u'waeup.Department') … … 1364 1364 self.redirect(self.url(self.context, u'@@manage')+'#tab-2') 1365 1365 1366 @ grok.action('Cancel')1366 @action('Cancel') 1367 1367 def cancel(self, **data): 1368 1368 self.redirect(self.url(self.context)) … … 1503 1503 return get_users_with_local_roles(self.context) 1504 1504 1505 @ grok.action('Save')1505 @action('Save', style='primary') 1506 1506 def save(self, **data): 1507 1507 self.applyData(self.context, **data) … … 1520 1520 return 1521 1521 1522 @ grok.action('Add course', validator=NullValidator)1522 @action('Add course', validator=NullValidator) 1523 1523 def addCourse(self, **data): 1524 1524 self.redirect(self.url(self.context, 'addcourse')) 1525 1525 return 1526 1526 1527 @ grok.action('Add certificate', validator=NullValidator)1527 @action('Add certificate', validator=NullValidator) 1528 1528 def addCertificate(self, **data): 1529 1529 self.redirect(self.url(self.context, 'addcertificate')) 1530 1530 return 1531 1531 1532 @ grok.action('Cancel', validator=NullValidator)1532 @action('Cancel', validator=NullValidator) 1533 1533 def cancel(self, **data): 1534 1534 self.redirect(self.url(self.context)) 1535 1535 return 1536 1536 1537 @ grok.action('Add local role', validator=NullValidator)1537 @action('Add local role', validator=NullValidator) 1538 1538 def addLocalRole(self, **data): 1539 1539 return add_local_role(self, 4, **data) 1540 1540 1541 @ grok.action('Remove selected local roles')1541 @action('Remove selected local roles') 1542 1542 def delLocalRoles(self, **data): 1543 1543 return del_local_roles(self,4,**data) … … 1557 1557 return self.context.longtitle() 1558 1558 1559 @ grok.action('Add course')1559 @action('Add course') 1560 1560 def addCourse(self, **data): 1561 1561 course = createObject(u'waeup.Course') … … 1579 1579 self.redirect(self.url(self.context, u'@@manage')+'#tab-2') 1580 1580 1581 @ grok.action('Cancel', validator=NullValidator)1581 @action('Cancel', validator=NullValidator) 1582 1582 def cancel(self, **data): 1583 1583 self.redirect(self.url(self.context)) … … 1598 1598 return self.context.longtitle() 1599 1599 1600 @ grok.action('Add certificate')1600 @action('Add certificate') 1601 1601 def addCertificate(self, **data): 1602 1602 certificate = createObject(u'waeup.Certificate') … … 1621 1621 return 1622 1622 1623 @ grok.action('Cancel', validator=NullValidator)1623 @action('Cancel', validator=NullValidator) 1624 1624 def cancel(self): #, **data): 1625 1625 self.redirect(self.url(self.context)) … … 1657 1657 return 'Course: %s (%s)' % (self.context.title, self.context.code) 1658 1658 1659 @ grok.action('Save')1659 @action('Save', style='primary') 1660 1660 def save(self, **data): 1661 1661 self.applyData(self.context, **data) 1662 1662 return 1663 1663 1664 @ grok.action('Save and return')1664 @action('Save and return') 1665 1665 def saveAndReturn(self, **data): 1666 1666 self.applyData(self.context, **data) … … 1668 1668 return 1669 1669 1670 @ grok.action('Cancel', validator=NullValidator)1670 @action('Cancel', validator=NullValidator) 1671 1671 def cancel(self, **data): 1672 1672 self.redirect(self.url(self.context)) … … 1731 1731 form_fields = grok.AutoFields(ICertificate) 1732 1732 1733 @ grok.action('Save')1733 @action('Save', style='primary') 1734 1734 def save(self, **data): 1735 1735 self.applyData(self.context, **data) … … 1741 1741 return 1742 1742 1743 @ grok.action('Add course referrer', validator=NullValidator)1743 @action('Add course referrer', validator=NullValidator) 1744 1744 def addCertificateCourse(self, **data): 1745 1745 self.redirect(self.url(self.context, 'addcertificatecourse')) 1746 1746 return 1747 1747 1748 @ grok.action('Cancel', validator=NullValidator)1748 @action('Cancel', validator=NullValidator) 1749 1749 def cancel(self, **data): 1750 1750 self.redirect(self.url(self.context)) … … 1765 1765 return get_users_with_local_roles(self.context) 1766 1766 1767 @ grok.action('Add local role', validator=NullValidator)1767 @action('Add local role', validator=NullValidator) 1768 1768 def addLocalRole(self, **data): 1769 1769 return add_local_role(self, 3, **data) 1770 1770 1771 @ grok.action('Remove selected local roles')1771 @action('Remove selected local roles') 1772 1772 def delLocalRoles(self, **data): 1773 1773 return del_local_roles(self,3,**data) … … 1788 1788 return "Certificate: %s (%s)" % (self.context.title, self.context.code) 1789 1789 1790 @ grok.action('Add course referrer')1790 @action('Add course referrer') 1791 1791 def addCertcourse(self, **data): 1792 1792 try: … … 1798 1798 self.redirect(self.url(self.context, u'@@manage')+'#tab-2') 1799 1799 1800 @ grok.action('Cancel', validator=NullValidator)1800 @action('Cancel', validator=NullValidator) 1801 1801 def cancel(self, **data): 1802 1802 self.redirect(self.url(self.context)) … … 1838 1838 return 'Course Referrer: %s' % (self.context.__name__) 1839 1839 1840 @ grok.action('Save and return')1840 @action('Save and return') 1841 1841 def saveAndReturn(self, **data): 1842 1842 parent = self.context.__parent__ … … 1853 1853 return 1854 1854 1855 @ grok.action('Cancel', validator=NullValidator)1855 @action('Cancel', validator=NullValidator) 1856 1856 def cancel(self, **data): 1857 1857 self.redirect(self.url(self.context)) -
main/waeup.sirp/branches/henrik-bootstrap/src/waeup/sirp/browser/static/waeup-base.css
r7443 r7445 36 36 37 37 .dataTables_wrapper { 38 min-height: 150px; 38 min-height: 50px; 39 margin-bottom: 50px; 39 40 }
Note: See TracChangeset for help on using the changeset viewer.