Changeset 16459
- Timestamp:
- 15 Apr 2021, 07:20:26 (4 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/CHANGES.txt
r16455 r16459 5 5 ======================= 6 6 7 * No changes yet.7 * Enable managers to remove all flash notices of students in a department. 8 8 9 9 1.7 (2021-04-13) -
main/waeup.kofa/trunk/layout/theme.html
r14563 r16459 234 234 euismod. Donec sed odio dui. 235 235 </p> 236 <img src="static/img/bg.png" />237 236 238 237 <!-- Tabs... --> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/viewlets.py
r16235 r16459 560 560 "'All students, who requested clearance in this department, will be cleared. Are you sure?'") 561 561 562 class RemoveFlashDepartmentStudentsActionButton(ManageActionButton): 563 """ 'Remove all flash notices' button for departments. 564 """ 565 grok.context(IDepartment) 566 grok.view(DepartmentPage) 567 grok.name('removeflashdepartmentstudents') 568 grok.require('waeup.manageStudent') 569 icon = 'actionicon_wipe.png' 570 text = _('Remove all flash notices') 571 target = 'removeflash' 572 grok.order(5) 573 574 @property 575 def onclick(self): 576 return "return window.confirm(%s);" % _( 577 "'Flash notices of all students in this department will be removed. Are you sure?'") 578 562 579 class ManageCourseActionButton(ManageActionButton): 563 580 """ 'Edit settings' button for courses. -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r16444 r16459 3796 3796 return 3797 3797 3798 class RemoveFlashNoticeAllStudentsInDepartmentView(UtilityView, grok.View): 3799 """ Remove flash notices of all students in a department. 3800 """ 3801 grok.context(IDepartment) 3802 grok.name('removeflash') 3803 grok.require('waeup.manageStudent') 3804 3805 def update(self): 3806 cat = queryUtility(ICatalog, name='students_catalog') 3807 students = cat.searchResults( 3808 depcode=(self.context.code, self.context.code), 3809 ) 3810 num = 0 3811 for student in students: 3812 student.flash_notice = u'' 3813 num += 1 3814 self.flash(_('%d flash notices have been removed.' % num)) 3815 self.redirect(self.url(self.context)) 3816 return 3817 3818 def render(self): 3819 return 3820 3798 3821 class EditScoresPage(KofaPage): 3799 3822 """Page that allows to edit batches of scores. -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r16412 r16459 1880 1880 self.browser.getLink("Clear all students").click() 1881 1881 self.assertTrue('0 students have been cleared' in self.browser.contents) 1882 return 1883 1884 def test_remove_all_flash_notices(self): 1885 self.student.flash_notice = u'test' 1886 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 1887 self.browser.open('http://localhost/app/faculties/fac1/dep1') 1888 self.browser.getLink("Remove all flash notices").click() 1889 self.assertTrue('1 flash notices have been removed' in self.browser.contents) 1890 self.assertEqual(self.student.flash_notice, '') 1882 1891 return 1883 1892
Note: See TracChangeset for help on using the changeset viewer.