Changeset 5927


Ignore:
Timestamp:
12 Apr 2011, 11:39:01 (14 years ago)
Author:
Henrik Bettermann
Message:

Adjust user and datacenter pages.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/browser
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py

    r5917 r5927  
    1515from hurry.workflow.interfaces import NoTransitionAvailableError
    1616from zope import schema
     17from waeup.sirp.browser.resources import warning
    1718try:
    1819    from zope.authentication.interfaces import (
     
    235236    grok.context(IUserContainer)
    236237    grok.name('index')
    237     title = 'Users'
     238    title = 'Portal Users'
    238239   
    239240    def update(self, userid=None, adduser=None, edit=None, delete=None):
     
    845846    pnav = 1
    846847
    847     def update(self):
    848         self.table = ITableProvider(self.context).getTables(self)[0]
    849         self.table.need()
    850    
    851     def getFaculties(self):
    852         """Convinience method to create a sorted list of faculties.
    853 
    854         It provides a list of dicts with entries for all data needed by
    855         usual list templates.
    856         """
    857         result = []
    858         for key, val in self.context.items():
    859             result.append(dict(id=key, name=val.title))
    860         return result
     848    def update(self, code=None, edit=None, delete=None):
     849        warning.need()
     850        if delete is not None and code is not None:
     851            try:
     852                del self.context[code]
     853                self.flash('Faculty %s successfully removed.' % code)               
     854            except:
     855                self.flash('Could not delete %s.' % code)
    861856
    862857class AddFacultyFormPage(WAeUPAddFormPage):
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/datacenterlogspage.pt

    r4910 r5927  
    1 <h2>Available Log Files</h2>
    2 
    31<p>
    42  Here you can see the local logfiles.
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/datacentermanagepage.pt

    r4789 r5927  
    1 <h1>Data Center Settings</h1>
    2 
    31<form method="POST">
    42  <div>
     
    64    <input type="text" name="newpath"
    75           tal:attributes="value context/storage" />
    8     <br />
     6    <br /><br />
    97    <div>
    108      <input type="checkbox" name="move" checked="checked" />
     
    1513      <label for="overwrite">Overwrite contents in new location?</label>
    1614    </div>
    17 
     15    <br />
    1816    <input type="submit" name="save" value="Save" />
    1917    <input type="reset" name="reset" value="Reset" />
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/datacenteruploadpage.pt

    r4789 r5927  
    1 <h1>Upload a file</h1>
    2 
    31<form method="post" enctype="multipart/form-data">
    42  <input type="file" name="uploadfile:file" />
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/usercontainerpage.pt

    r4789 r5927  
    1 <h2>Registered Users</h2>
     1<h2>Portal Users</h2>
     2
     3<p>
     4  Here you can manage portal users. 
     5</p>
    26
    37<table class="zebra">
     
    2731  </tbody>
    2832</table>
    29 <form method="post" action="add">
    30   <input type="submit" name="adduser" value="Add user" />
    31 </form>
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/viewlets.py

    r5917 r5927  
    99from waeup.sirp.browser.pages import (
    1010    UniversityPage, FacultyContainerPage, DatacenterPage, FacultyPage,
    11     DepartmentPage, CoursePage, CertificatePage, CertificateCoursePage)
     11    DepartmentPage, CoursePage, CertificatePage, CertificateCoursePage, UserContainerPage)
    1212from waeup.sirp.browser.interfaces import (
    1313    IFacultyContainer, IFaculty, IDepartment, ICourse, ICertificate,
    14     ICertificateCourse, IBreadcrumbContainer, IUniversity)
     14    ICertificateCourse, IBreadcrumbContainer, IUniversity, IUserContainer)
    1515from waeup.sirp.interfaces import (IWAeUPObject, IWAeUPXMLExporter,
    1616                                   IWAeUPXMLImporter, IDataCenter)
     
    350350#
    351351
     352class AddUserActionButton(AddActionButton):
     353    grok.require('waeup.manageUsers')
     354    grok.context(IUserContainer)
     355    grok.view(UserContainerPage)
     356    text = 'Add user'
     357
    352358class AddFacultyActionButton(AddActionButton):
    353359    grok.context(IFacultyContainer)
     
    386392
    387393
    388 class RemoveFacultyActionButton(RemoveActionButton):
    389     grok.context(IFacultyContainer)
    390     grok.view(FacultyContainerPage)
    391     text = 'Remove faculty'
     394#class RemoveFacultyActionButton(RemoveActionButton):
     395#    grok.context(IFacultyContainer)
     396#    grok.view(FacultyContainerPage)
     397#    text = 'Remove faculty'
    392398   
    393399class RemoveDepartmentActionButton(RemoveActionButton):
Note: See TracChangeset for help on using the changeset viewer.