Ignore:
Timestamp:
11 Jan 2012, 22:51:42 (13 years ago)
Author:
Henrik Bettermann
Message:

Backup today's work (mainly student navigation).

Location:
main/waeup.sirp/branches/henrik-bootstrap/src/waeup/sirp
Files:
2 added
1 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/branches/henrik-bootstrap/src/waeup/sirp/browser/layout.py

    r7448 r7450  
    5252default_primary_nav_template.__grok_name__ = 'default_primary_nav'
    5353
    54 
    5554class action(grok.action):
    5655
  • main/waeup.sirp/branches/henrik-bootstrap/src/waeup/sirp/browser/resources.py

    r7443 r7450  
    252252    waeup_sirp, 'bootstrap.min.css')
    253253
     254dropdown = ResourceInclusion(
     255    waeup_sirp, 'bootstrap-dropdown.js',
     256    depends=[jquery])
     257
    254258#: Register basic SIRP CSS (which is based on ``bootstrap.min.css`` and ``base``
    255259#: as a resource.
    256260waeup_base_css = ResourceInclusion(
    257261    waeup_sirp, 'waeup-base.css',
    258     depends=[bootstrap_min, base])
     262    depends=[dropdown,bootstrap_min, base])
    259263
    260264#: The red SIRP theme registered as a resource.
  • main/waeup.sirp/branches/henrik-bootstrap/src/waeup/sirp/browser/static/bootstrap.min.css

    r7442 r7450  
    13351335  height: 0;
    13361336  display: inline-block;
    1337   content: "↓
    1338   ";
     1337  content: "↓";
    13391338  text-indent: -99999px;
    13401339  vertical-align: top;
  • main/waeup.sirp/branches/henrik-bootstrap/src/waeup/sirp/browser/static/mobile.css

    r7449 r7450  
    11.container {
    2   width: 420px;
     2  width: 480px;
    33}
    44
    55body {
    6   padding-top: 120px;
     6  padding-top: 60px;
    77}
     8
     9select {
     10  width: 60px;
     11}
     12
     13.dataTables_length {
     14    float: left;
     15    width: 40%;
     16}
     17
     18.dataTables_filter {
     19    float: right;
     20    text-align: right;
     21    width: 60%;
     22}
  • main/waeup.sirp/branches/henrik-bootstrap/src/waeup/sirp/browser/static/waeup-base.css

    r7449 r7450  
    99body {
    1010  padding-top: 60px;
     11  background-color: #EEEEEE;
     12}
     13
     14.content {
     15    background-color: #FFFFFF;
     16    margin-left: -20px;
     17    margin-right: -20px;
     18    padding-bottom: 20px;
     19    padding-left: 20px;
     20    padding-right: 20px;
     21    padding-top: 20px;
     22    border-top-left-radius: 4px;
     23    border-top-right-radius: 4px;
     24}
     25
     26.well {
     27    background-color: #FFFFFF;
     28}
     29
     30.breadcrumb {
     31    background-color: #FFFFFF;
     32    background-image: None;
     33    border: 0px;
    1134}
    1235
     
    4063}
    4164
    42 table.display {
    43     margin-top: 25px;
     65.dataTables_filter {
     66  margin-bottom: 20px;
    4467}
    4568
    4669 /* SIRP stuff */
     70
     71.container {
     72  width: 700px;
     73}
     74
     75.actionbar {
     76  margin-bottom: 20px;
     77}
    4778
    4879.error {
  • main/waeup.sirp/branches/henrik-bootstrap/src/waeup/sirp/browser/templates/actionbutton.pt

    r7442 r7450  
    1 <a class="btn" tal:condition="viewlet/target_url"
     1<a class="btn actionbar" tal:condition="viewlet/target_url"
    22   tal:attributes="href viewlet/target_url">
    33  <img src="" alt="edit"
  • main/waeup.sirp/branches/henrik-bootstrap/src/waeup/sirp/browser/templates/certificatepage.pt

    r7446 r7450  
    3131</thead>
    3232<tbody>
    33   <tr tal:repeat="cc context/values">
     33  <tr tal:repeat="cc context/values" class="gradeC">
    3434     <td>
    3535      <span tal:content="cc/level">
  • main/waeup.sirp/branches/henrik-bootstrap/src/waeup/sirp/browser/templates/staffsitelayout.pt

    r7449 r7450  
    7171          </div>
    7272        </div>
    73         <div class="span12" tal:condition="provider:actionbar">
    74           <span tal:replace="structure provider:actionbar" />
    75           <br /><br />
    76         </div>
     73        <span tal:replace="structure provider:actionbar" />
    7774        <div tal:content="structure view/content"> THE CONTENT
    7875        </div>
  • main/waeup.sirp/branches/henrik-bootstrap/src/waeup/sirp/browser/templates/studentsitelayout.pt

    r7449 r7450  
    1010    <meta name="viewport" content="width=320, initial-scale=1, maximum-scale=1"/>
    1111    <link rel="stylesheet" media="only screen and (max-device-width: 480px)"
    12         tal:attributes="href python: view.url(layout.site, '@@/waeup.sirp.browser/mobile.css')" type="text/css" />
     12        tal:attributes="href python: view.url(layout.site, '@@/waeup.sirp.browser/mobile.css')"
     13        type="text/css" />
    1314    <link rel="shortcut icon" tal:attributes="href static/favicon.ico" type="image/x-icon" />
    1415    <link rel="alternate" type="application/rss+xml" title="RSS"
     
    5253          </div>
    5354        </div>
    54         <div tal:condition="provider:actionbar">
    55           <span tal:replace="structure provider:actionbar" />
    56           <br /><br />
    57         </div>
     55        <span tal:replace="structure provider:actionbar" />
    5856        <div tal:content="structure view/content"> THE CONTENT
    5957        </div>
  • main/waeup.sirp/branches/henrik-bootstrap/src/waeup/sirp/students/browser_templates/studycoursepage.pt

    r7447 r7450  
    5555
    5656
    57 <table class="zebra">
     57<table>
    5858  <thead>
    5959    <tr>
     
    6363  </thead>
    6464  <tbody>
    65     <tr tal:repeat="value context/values">
     65    <tr class="gradeC" tal:repeat="value context/values">
    6666      <td> <a tal:attributes="href value/__name__">
    6767      <span tal:content="value/level">CODE</span></a></td>
  • main/waeup.sirp/branches/henrik-bootstrap/src/waeup/sirp/students/viewlets.py

    r7442 r7450  
    6060                url, self.text)
    6161
    62 class StudentManageBaseLink(StudentManageLink):
    63     grok.order(1)
    64     link = 'index'
    65     text = u'Base Data'
    66 
    6762class StudentManageApplicationLink(StudentManageLink):
    68     grok.order(2)
     63    grok.order(1)
    6964    link = 'application_slip'
    7065    text = u'Application Slip'
     
    7570        if slip:
    7671            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>' % (
    7873                    url, self.text)
    7974        return ''
     75
     76class StudentManageBaseLink(StudentManageLink):
     77    grok.order(2)
     78    link = 'index'
     79    text = u'Base Data'
    8080
    8181class StudentManageClearanceLink(StudentManageLink):
     
    111111    text = u'History'
    112112
    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 StudentNavigation
    119     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     @property
    133     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     @property
    149     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         return
    155 
    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 
    186113class StudentsTab(PrimaryNavTab):
    187114    """Students tab in primary navigation.
     
    227154
    228155class MyStudentDataTab(PrimaryStudentNavTab):
    229     """MyData-tab in primary navigation.
     156    """MyData dropdown tab in primary navigation.
    230157    """
    231158    grok.order(3)
    232159    grok.require('waeup.viewMyStudentDataTab')
     160    grok.template('mydatadropdowntabs')
    233161    pnav = 4
    234162    tab_title = u'My Data'
    235163
    236164    @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
    240190
    241191def handle_file_delete(context, view, download_name):
Note: See TracChangeset for help on using the changeset viewer.