Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

Commit

Permalink
Change input option fields to input radio fields for grant mechanism
Browse files Browse the repository at this point in the history
Support a matrix table with javascript support.
The javascript will change the color if you change the grant settings.
This should be usefull for to check the bigger changes before you commit the form.

Added grant vvocabulary for supporting RadioWidget via a simply Choise field.
Added grant vocabulary interface for register the RadioWidget
Different changes for bulding a matrix table instead dropdown input fields
  • Loading branch information
projekt01 committed Jan 6, 2005
1 parent a808a64 commit d391903
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
16 changes: 13 additions & 3 deletions browser/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"""
from zope.interface import implements
from zope.i18n import translate
from zope.app.zapi import getName, getPath
from zope.app.publisher.interfaces.http import ILogin, ILogout
from zope.app.security.interfaces import IAuthenticationUtility
from zope.app.security.principalregistry import UnauthenticatedPrincipal
Expand All @@ -35,21 +36,30 @@ def __init__(self, context, request):
self.request = request

def render(self, name):
print ""
print "AuthUtilitySearchView render"
sourcename = 'principals.zcml'
html = []

# add sub title for source search field
html.append('<h4 i18n:translate="">%s</h4>' % sourcename)
# start row for search fields
html.append('<div class="row">')
html.append('<div class="label">')
html.append('Search String')
html.append('</div>')
html.append('<div class="field">')
html.append('<input type="text" name="%s" />' %(name+'.searchstring'))
html.append('</div>')
html.append('</div>')

# add search button for search fields
html.append('<div class="row">')
html.append('<div class="field">')
html.append('<input type="submit" name="%s" value="%s" />'
% (name+'.search',
translate(search_label, context=self.request)))

html.append('</div>')

# end row
html.append('</div>')

return '\n'.join(html)
Expand Down
7 changes: 6 additions & 1 deletion browser/authutilitysearchview.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Now that we have our queriable, we create the view for it:
This allows us to render a search form.

>>> print view.render('test') # doctest: +NORMALIZE_WHITESPACE
<h4 i18n:translate="">principals.zcml</h4>
<div class="row">
<div class="label">
Search String
Expand All @@ -36,7 +37,11 @@ This allows us to render a search form.
<input type="text" name="test.searchstring" />
</div>
</div>
<br /><input type="submit" name="test.search" value="Search" />
<div class="row">
<div class="field">
<input type="submit" name="test.search" value="Search" />
</div>
</div>

If we ask for results:

Expand Down

0 comments on commit d391903

Please sign in to comment.