Changeset 11008
- Timestamp:
- 30 Jan 2014, 10:40:40 (11 years ago)
- Location:
- main/waeup.kofa/branches/uli-diazo-themed/src/waeup/kofa/browser
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/branches/uli-diazo-themed/src/waeup/kofa/browser/pages.py
r11006 r11008 85 85 user = view.request.form.get('user', None) 86 86 if user is None or localrole is None: 87 view.flash('No user selected.' )87 view.flash('No user selected.', type='danger') 88 88 view.redirect(view.url(view.context, '@@manage')+'#tab%s' % tab) 89 89 return … … 100 100 child_ids = view.request.form.get('role_id', None) 101 101 if child_ids is None: 102 view.flash(_('No local role selected.') )102 view.flash(_('No local role selected.'), type='danger') 103 103 view.redirect(view.url(view.context, '@@manage')+'#tab%s' % tab) 104 104 return … … 117 117 except: 118 118 view.flash('Could not remove %s: %s: %s' % ( 119 child_id, sys.exc_info()[0], sys.exc_info()[1])) 119 child_id, sys.exc_info()[0], sys.exc_info()[1]), 120 type='danger') 120 121 if len(deleted): 121 122 view.flash( … … 133 134 child_id = form['val_id'] 134 135 else: 135 view.flash(_('No item selected.') )136 view.flash(_('No item selected.'), type='danger') 136 137 if tab: 137 138 view.redirect(view.url(view.context, redirect)+'#tab%s' % tab) … … 152 153 except: 153 154 view.flash('Could not delete %s: %s: %s' % ( 154 id, sys.exc_info()[0], sys.exc_info()[1]) )155 id, sys.exc_info()[0], sys.exc_info()[1]), type='danger') 155 156 if len(deleted): 156 157 view.flash(_('Successfully removed: ${a}', … … 282 283 self.request.principal.id) 283 284 self.flash( 284 _('Your personal data record is outdated. Please update.')) 285 _('Your personal data record is outdated. Please update.'), 286 type='warning') 285 287 self.redirect(self.application_url() + rel_link) 286 288 return … … 327 329 type='warning') 328 330 return 329 self.flash(_('You entered invalid credentials.') )331 self.flash(_('You entered invalid credentials.'), type='danger') 330 332 return 331 333 … … 443 445 self.flash(_('Your message has been sent.')) 444 446 else: 445 self.flash(_('A smtp server error occurred.') )447 self.flash(_('A smtp server error occurred.'), type='danger') 446 448 return 447 449 … … 589 591 errors = validator.validate_password(password, password_ctl) 590 592 if errors: 591 self.flash( ' '.join(errors) )593 self.flash( ' '.join(errors), type='danger') 592 594 return 593 595 try: … … 602 604 except KeyError: 603 605 self.status = self.flash('The userid chosen already exists ' 604 'in the database.' )606 'in the database.', type='danger') 605 607 return 606 608 self.redirect(self.url(self.context)) … … 633 635 errors = validator.validate_password(password, password_ctl) 634 636 if errors: 635 self.flash( ' '.join(errors) )637 self.flash( ' '.join(errors), type='danger') 636 638 return 637 639 changed_fields = self.applyData(self.context, **data) … … 852 854 ob_class, sessionconfiguration.academic_session)) 853 855 except KeyError: 854 self.flash(_('The session chosen already exists.') )856 self.flash(_('The session chosen already exists.'), type='danger') 855 857 return 856 858 self.redirect(self.url(self.context, '@@index')+'#tab2') … … 909 911 child_id = form['val_id'] 910 912 else: 911 self.flash(_('No item selected.') )913 self.flash(_('No item selected.'), type='danger') 912 914 return 913 915 if not isinstance(child_id, list): … … 920 922 deleted.append(id) 921 923 except OSError: 922 self.flash(_('OSError: The file could not be deleted.')) 924 self.flash(_('OSError: The file could not be deleted.'), 925 type='danger') 923 926 return 924 927 if len(deleted): … … 1024 1027 _('All import managers have been notified by email.')) 1025 1028 else: 1026 self.flash(_('An smtp server error occurred.') )1029 self.flash(_('An smtp server error occurred.'), type='danger') 1027 1030 return 1028 1031 … … 1032 1035 if number_of_pendings > self.max_files: 1033 1036 self.flash( 1034 _('Maximum number of files in the data center exceeded.')) 1037 _('Maximum number of files in the data center exceeded.'), 1038 type='danger') 1035 1039 self.redirect(self.url(self.context)) 1036 1040 return … … 1043 1047 filename = uploadfile.filename 1044 1048 #if 'pending' in filename: 1045 # self.flash(_("You can't re-upload pending data files.") )1049 # self.flash(_("You can't re-upload pending data files."), type='danger') 1046 1050 # return 1047 1051 if not filename.endswith('.csv'): 1048 self.flash(_("Only csv files are allowed.") )1052 self.flash(_("Only csv files are allowed."), type='danger') 1049 1053 return 1050 1054 normalized_filename = self.getNormalizedFileName(filename) … … 1054 1058 self.context.storage, 'unfinished', normalized_filename) 1055 1059 if os.path.exists(finished_file) or os.path.exists(unfinished_file): 1056 self.flash(_("File with same name was uploaded earlier.")) 1060 self.flash(_("File with same name was uploaded earlier."), 1061 type='danger') 1057 1062 return 1058 1063 target = os.path.join(self.context.storage, normalized_filename) … … 1068 1073 "has invalid CSV format. " 1069 1074 "First problematic line detected: line %s. " 1070 "Please replace." % invalid_line) )1075 "Please replace." % invalid_line), type='danger') 1071 1076 logger.info('%s - invalid file uploaded: %s' % 1072 1077 (ob_class, target)) … … 1080 1085 1081 1086 except IOError: 1082 self.flash('Error while uploading file. Please retry.' )1083 self.flash('I/O error: %s' % sys.exc_info()[1] )1087 self.flash('Error while uploading file. Please retry.', type='danger') 1088 self.flash('I/O error: %s' % sys.exc_info()[1], type='danger') 1084 1089 return 1085 1090 self.redirect(self.url(self.context)) … … 1273 1278 return 1274 1279 if cancel is not None: 1275 self.flash(_('Import aborted.') )1280 self.flash(_('Import aborted.'), type='warning') 1276 1281 self.redirect(self.url(self.context)) 1277 1282 return … … 1285 1290 if self.importer and 'update' in self.importer: 1286 1291 if self.mode != 'update': 1287 self.flash(_('Update mode only!') )1292 self.flash(_('Update mode only!'), type='warning') 1288 1293 self.mode_locked = True 1289 1294 self.mode = 'update' … … 1299 1304 else: 1300 1305 self.reader = () 1301 self.flash(warnings )1306 self.flash(warnings, type='warning') 1302 1307 1303 1308 class DatacenterImportStep3(KofaPage): … … 1396 1401 return 1397 1402 if cancel is not None: 1398 self.flash(_('Import aborted.') )1403 self.flash(_('Import aborted.'), type='warning') 1399 1404 self.redirect(self.url(self.context)) 1400 1405 return … … 1411 1416 warnings = self.getWarnings() 1412 1417 if warnings: 1413 self.flash(warnings )1418 self.flash(warnings, type='warning') 1414 1419 1415 1420 class DatacenterImportStep4(KofaPage): … … 1473 1478 if self.warn_num: 1474 1479 self.flash(_('Processing of ${a} rows failed.', 1475 mapping = {'a':self.warn_num}) )1480 mapping = {'a':self.warn_num}), type='warning') 1476 1481 self.flash(_('Successfully processed ${a} rows.', 1477 1482 mapping = {'a':linenum - self.warn_num})) … … 1511 1516 self.flash( 1512 1517 _('Log files can only be searched ' + 1513 'on Unix-based operating systems.') )1518 'on Unix-based operating systems.'), type='danger') 1514 1519 self.redirect(self.url(self.context, '@@logs')) 1515 1520 return … … 1525 1530 self.context.queryLogfiles(logname, query)) 1526 1531 except ValueError: 1527 self.flash(_('Invalid search expression.') )1532 self.flash(_('Invalid search expression.'), type='danger') 1528 1533 return 1529 1534 if not self.result: 1530 self.flash(_('No search results found.') )1535 self.flash(_('No search results found.'), type='warning') 1531 1536 return 1532 1537 … … 1557 1562 for name in not_copied: 1558 1563 self.flash(_('File already existed (not copied): ${a}', 1559 mapping = {'a':name}) )1564 mapping = {'a':name}), type='danger') 1560 1565 except: 1561 1566 self.flash(_('Given storage path cannot be used. ${a}', … … 1725 1730 def delFaculties(self, **data): 1726 1731 if not checkPermission('waeup.managePortal', self.context): 1727 self.flash(_('You are not allowed to remove entire faculties.')) 1732 self.flash(_('You are not allowed to remove entire faculties.'), 1733 type='warning') 1728 1734 return 1729 1735 delSubobjects(self, redirect='@@manage', tab='1') … … 1758 1764 self.context.addFaculty(faculty) 1759 1765 except KeyError: 1760 self.flash(_('The faculty code chosen already exists.')) 1766 self.flash(_('The faculty code chosen already exists.'), 1767 type='danger') 1761 1768 return 1762 1769 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') … … 1813 1820 def delDepartments(self, **data): 1814 1821 if not checkPermission('waeup.managePortal', self.context): 1815 self.flash(_('You are not allowed to remove entire departments.')) 1822 self.flash(_('You are not allowed to remove entire departments.'), 1823 type='danger') 1816 1824 return 1817 1825 delSubobjects(self, redirect='@@manage', tab='2') … … 1881 1889 else: 1882 1890 if 'search' in form: 1883 self.flash(_('Empty search string') )1891 self.flash(_('Empty search string'), type='warning') 1884 1892 return 1885 1893 self.hitlist = self._find_students(query=self.searchterm, 1886 1894 searchtype=self.searchtype, view=self) 1887 1895 if not self.hitlist: 1888 self.flash(_('No student found.') )1896 self.flash(_('No student found.'), type='warning') 1889 1897 return 1890 1898 … … 1906 1914 self.context.addDepartment(department) 1907 1915 except KeyError: 1908 self.flash(_('The code chosen already exists in this faculty.')) 1916 self.flash(_('The code chosen already exists in this faculty.'), 1917 type='danger') 1909 1918 return 1910 1919 self.status = self.flash( … … 2005 2014 def delCertificates(self, **data): 2006 2015 if not checkPermission('waeup.managePortal', self.context): 2007 self.flash(_('You are not allowed to remove certificates.')) 2016 self.flash(_('You are not allowed to remove certificates.'), 2017 type='warning') 2008 2018 return 2009 2019 delSubobjects( … … 2059 2069 message += '<a href="%s">%s</a>' % ( 2060 2070 self.url(entry), getattr(entry, '__name__', u'Unnamed')) 2061 self.flash(message )2071 self.flash(message, type='warning') 2062 2072 self.redirect(self.url(self.context, u'@@addcourse')) 2063 2073 return … … 2100 2110 message += '<a href="%s">%s</a>' % ( 2101 2111 self.url(entry), getattr(entry, '__name__', u'Unnamed')) 2102 self.flash(message )2112 self.flash(message, type='warning') 2103 2113 self.redirect(self.url(self.context, u'@@addcertificate')) 2104 2114 return … … 2261 2271 except KeyError: 2262 2272 self.status = self.flash(_('The chosen certificate course is already ' 2263 'part of this certificate.') )2273 'part of this certificate.'), type='warning') 2264 2274 return 2265 2275 self.status = self.flash( … … 2389 2399 user = self._searchUser(identifier, email) 2390 2400 if user is None: 2391 self.flash(_('No record found.') )2401 self.flash(_('No record found.'), type='warning') 2392 2402 return 2393 2403 # Change password … … 2410 2420 'has been sent to ${a}.', mapping = {'a':email})) 2411 2421 else: 2412 self.flash(_('An smtp server error occurred.') )2422 self.flash(_('An smtp server error occurred.'), type='danger') 2413 2423 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 2414 2424 self.context.logger.info( -
main/waeup.kofa/branches/uli-diazo-themed/src/waeup/kofa/browser/templates/datacenterimport2page.pt
r8651 r11008 9 9 Please select a file-processor and a processing-mode from the selections below. 10 10 </p> 11 <div >12 <table tal:define="prev_table view/getPreviewTable;" >11 <div class="table-responsive"> 12 <table tal:define="prev_table view/getPreviewTable;" class="table table-condensed"> 13 13 <thead> 14 14 <tr> … … 55 55 </p> 56 56 </div> 57 <input class="btn " type="submit" name="cancel" tal:attributes="value view/cancel_button" />58 <input class="btn danger" type="submit" name="back1" tal:attributes="value view/back_button" />59 <input class="btn primary"57 <input class="btn btn-default" type="submit" name="cancel" tal:attributes="value view/cancel_button" /> 58 <input class="btn btn-danger" type="submit" name="back1" tal:attributes="value view/back_button" /> 59 <input class="btn btn-primary" 60 60 tal:attributes="disabled python: view.getWarnings() and 'disabled' or ''; value view/proceed_button" 61 61 type="submit" name="proceed" /> -
main/waeup.kofa/branches/uli-diazo-themed/src/waeup/kofa/browser/templates/datacenterimport3page.pt
r8783 r11008 1 1 <div i18n:domain="waeup.kofa" i18n:translate="" 2 class="alert -messagesuccess" tal:condition="not: view/getWarnings">2 class="alert alert-success" tal:condition="not: view/getWarnings"> 3 3 Header fields OK 4 4 </div> … … 29 29 30 30 <div> 31 32 33 31 <table tal:define="prev_table view/getPreviewTable; 34 headers view/headerfields;"> 32 headers view/headerfields;" 33 class="table"> 35 34 <thead> 36 35 <tr> … … 45 44 </td> 46 45 <td> 47 <select class="span4"name="headerfield">46 <select name="headerfield"> 48 47 <option tal:repeat="opt view/getPossibleHeaders" 49 48 tal:attributes="value opt/value; … … 62 61 </div> 63 62 64 <input class="btn " type="submit" name="cancel"63 <input class="btn btn-default" type="submit" name="cancel" 65 64 tal:attributes="value view/cancel_button" /> 66 <input class="btn " type="reset" name="reset"65 <input class="btn btn-default" type="reset" name="reset" 67 66 tal:attributes="value view/reset_button" /> 68 <input class="btn " type="submit" name="update"67 <input class="btn btn-default" type="submit" name="update" 69 68 tal:attributes="value view/update_button" /> 70 69 <br /><br /> 71 <input class="btn danger" type="submit" name="back2"70 <input class="btn btn-danger" type="submit" name="back2" 72 71 tal:attributes="value view/back_button" /> 73 <input class="btn primary"72 <input class="btn btn-primary" 74 73 tal:attributes="disabled python: view.getWarnings() and 'disabled' or ''; value view/proceed_button" 75 74 type="submit" name="proceed"/> -
main/waeup.kofa/branches/uli-diazo-themed/src/waeup/kofa/browser/templates/datacenterimport4page.pt
r10099 r11008 15 15 </p> 16 16 <form method="POST" i18n:domain="waeup.kofa"> 17 <input class="btn primary" type="submit" name="finish"17 <input class="btn btn-primary" type="submit" name="finish" 18 18 tal:attributes="value view/back_button" /> 19 19 </form>
Note: See TracChangeset for help on using the changeset viewer.