- Timestamp:
- 11 Jan 2012, 22:51:42 (13 years ago)
- Location:
- main/waeup.sirp/branches/henrik-bootstrap/src/waeup/sirp/students
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/branches/henrik-bootstrap/src/waeup/sirp/students/browser_templates/studycoursepage.pt
r7447 r7450 55 55 56 56 57 <table class="zebra">57 <table> 58 58 <thead> 59 59 <tr> … … 63 63 </thead> 64 64 <tbody> 65 <tr tal:repeat="value context/values">65 <tr class="gradeC" tal:repeat="value context/values"> 66 66 <td> <a tal:attributes="href value/__name__"> 67 67 <span tal:content="value/level">CODE</span></a></td> -
main/waeup.sirp/branches/henrik-bootstrap/src/waeup/sirp/students/viewlets.py
r7442 r7450 60 60 url, self.text) 61 61 62 class StudentManageBaseLink(StudentManageLink):63 grok.order(1)64 link = 'index'65 text = u'Base Data'66 67 62 class StudentManageApplicationLink(StudentManageLink): 68 grok.order( 2)63 grok.order(1) 69 64 link = 'application_slip' 70 65 text = u'Application Slip' … … 75 70 if slip: 76 71 url = self.view.url(self.context,self.link) 77 return u'<li "><a href="%s">%s</a></li>' % (72 return u'<li><a href="%s">%s</a></li>' % ( 78 73 url, self.text) 79 74 return '' 75 76 class StudentManageBaseLink(StudentManageLink): 77 grok.order(2) 78 link = 'index' 79 text = u'Base Data' 80 80 81 81 class StudentManageClearanceLink(StudentManageLink): … … 111 111 text = u'History' 112 112 113 114 class StudentMenu(grok.ViewletManager):115 grok.name('top_student')116 117 class StudentLink(PlainActionButton):118 """A link displayed in the student box which shows up for StudentNavigation119 objects.120 121 """122 grok.baseclass()123 grok.viewletmanager(StudentMenu)124 grok.context(ISIRPObject)125 grok.view(Interface)126 grok.order(5)127 grok.require('waeup.viewStudent')128 129 link = 'index'130 text = u'Base Data'131 132 @property133 def target_url(self):134 """Get a URL to the target...135 """136 return self.view.url(self.context.getStudent(), self.link)137 138 class StudentBaseLink(StudentLink):139 grok.order(1)140 link = 'index'141 text = u'Base Data'142 143 class ApplicationSlipLink(StudentLink):144 grok.order(2)145 link = 'application_slip'146 text = u'Application Slip'147 148 @property149 def target_url(self):150 slip = getUtility(IExtFileStore).getFileByContext(151 self.context.getStudent(), attr=self.link)152 if slip:153 return self.view.url(self.context,self.link)154 return155 156 class StudentClearanceLink(StudentLink):157 grok.order(3)158 link = 'view_clearance'159 text = u'Clearance Data'160 161 class StudentPersonalLink(StudentLink):162 grok.order(4)163 link = 'view_personal'164 text = u'Personal Data'165 166 class StudentStudyCourseLink(StudentLink):167 grok.order(5)168 link = 'studycourse'169 text = u'Study Course'170 171 class StudentPaymentsLink(StudentLink):172 grok.order(6)173 link = 'payments'174 text = u'Payments'175 176 class StudentAccommodationLink(StudentLink):177 grok.order(7)178 link = 'accommodation'179 text = u'Accommodation'180 181 class StudentHistoryLink(StudentLink):182 grok.order(8)183 link = 'history'184 text = u'History'185 186 113 class StudentsTab(PrimaryNavTab): 187 114 """Students tab in primary navigation. … … 227 154 228 155 class MyStudentDataTab(PrimaryStudentNavTab): 229 """MyData -tab in primary navigation.156 """MyData dropdown tab in primary navigation. 230 157 """ 231 158 grok.order(3) 232 159 grok.require('waeup.viewMyStudentDataTab') 160 grok.template('mydatadropdowntabs') 233 161 pnav = 4 234 162 tab_title = u'My Data' 235 163 236 164 @property 237 def link_target(self): 238 rel_link = '/students/%s' % self.request.principal.id 239 return self.view.application_url() + rel_link 165 def active(self): 166 view_pnav = getattr(self.view, 'pnav', 0) 167 if view_pnav == self.pnav: 168 return 'active dropdown' 169 return 'dropdown' 170 171 @property 172 def targets(self): 173 student_url = self.view.application_url() + ( 174 '/students/%s' % self.request.principal.id) 175 #app_slip = getUtility(IExtFileStore).getFileByContext( 176 # self.context.getStudent(), 'application_slip') 177 targets = [] 178 #if app_slip: 179 # targets = [{'url':student_url + '/application_slip', 'title':'Application Slip'},] 180 targets += [ 181 {'url':student_url + '/index', 'title':'Base Data'}, 182 {'url':student_url + '/view_clearance', 'title':'Clearance Data'}, 183 {'url':student_url + '/view_personal', 'title':'Personal Data'}, 184 {'url':student_url + '/studycourse', 'title':'Study Course'}, 185 {'url':student_url + '/payments', 'title':'Payments'}, 186 {'url':student_url + '/accommodation', 'title':'Accommodation Data'}, 187 {'url':student_url + '/history', 'title':'History'}, 188 ] 189 return targets 240 190 241 191 def handle_file_delete(context, view, download_name):
Note: See TracChangeset for help on using the changeset viewer.