[gen] Bugfixes.

This commit is contained in:
Gaetan Delannay 2014-02-27 12:54:05 +01:00
parent c002b5cb59
commit fe56ee27a0
10 changed files with 19 additions and 18 deletions

View file

@ -42,7 +42,7 @@ class Field:
dLayouts = 'lrv-d-f'
wLayouts = Table('lrv-f')
# Render a field. Optiona vars:
# Render a field. Optional vars:
# * fieldName can be given as different as field.name for fields included
# in List fields: in this case, fieldName includes the row
# index.
@ -409,9 +409,11 @@ class Field:
layouts['view'].addCssClasses('focus')
layouts['edit'].addCssClasses('focus')
# If layouts are the default ones, set width=None instead of width=100%
# for the field if it is not in a group (excepted for rich texts).
# for the field if it is not in a group (excepted for rich texts and
# refs).
if areDefault and not self.group and \
not ((self.type == 'String') and (self.format == self.XHTML)):
not ((self.type == 'String') and (self.format == self.XHTML)) and \
not (self.type == 'Ref'):
for layoutType in layouts.iterkeys():
layouts[layoutType].width = ''
# Remove letters "r" from the layouts if the field is not required.

View file

@ -124,7 +124,7 @@ class Date(Field):
monthToName='%s_to_month' % name;
yearToName='%s_to_year' % name">
<td></td>
<td><label>_('search_to')</label>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td><label>:_('search_to')</label>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td height="20px">
<select id=":dayToName" name=":dayToName">
<option value="">--</option>
@ -142,10 +142,10 @@ class Date(Field):
value=":value">:value</option>
</select>
<!-- The icon for displaying the calendar popup -->
<x if="widget.calendar">
<x if="field.calendar">
<input type="hidden" id=":toName" name=":toName"/>
<img id=":'%s_img' % toName" src=":url('calendar.gif')"/>
<script type="text/javascript">::field.getJsInit(toName, years)">
<script type="text/javascript">::field.getJsInit(toName, years)
</script>
</x>
</td>

View file

@ -35,7 +35,7 @@ class Pod(Field):
'contact the system administrator.'
DELETE_TEMP_DOC_ERROR = 'A temporary document could not be removed. %s.'
pxView = pxCell = Px('''<x>
pxView = pxCell = Px('''
<!-- Ask action -->
<x if="field.askAction"
var2="doLabel='%s_askaction' % field.labelId;
@ -46,8 +46,7 @@ class Pod(Field):
<img for="fmt in field.getOutputFormats(zobj)" src=":url(fmt)"
onclick=":'generatePodDocument(%s, %s, %s, %s)' % \
(q(zobj.UID()), q(name), q(fmt), q(ztool.getQueryInfo()))"
title=":fmt.capitalize()" class="clickable"/>
</x>''')
title=":fmt.capitalize()" class="clickable"/>''')
pxEdit = pxSearch = ''

View file

@ -173,7 +173,7 @@ class String(Field):
<option for="v in field.getPossibleValues(ztool, withTranslations=True,\
withBlankValue=False, className=className)"
selected=":v[0] in preSelected" value=":v[0]"
title=":v[1]">ztool.truncateValue(v[1], field.swidth)</option>
title=":v[1]">:ztool.truncateValue(v[1], field.swidth)</option>
</select>
</x><br/>
</x>''')

View file

@ -1263,7 +1263,7 @@ class ToolMixin(BaseMixin):
fields that need to be shown on a page displaying query results.'''
# Skip this if we are searching multiple content types.
if ',' in contentType: return ()
return [f.__dict__ for f in self.getAllAppyTypes(contentType) \
return [f for f in self.getAllAppyTypes(contentType) \
if (f.type == 'Pod') and (f.show == 'result')]
def formatDate(self, aDate, withHour=True):

View file

@ -326,7 +326,7 @@ msgstr "XLS (Microsoft Excel)"
#. Default: "Welcome to this Appy-powered site."
msgid "front_page_text"
msgstr "Bienvenue sur HubSessions pour le Collège communal de Schaerbeek (site 'Additions')."
msgstr "Bienvenue sur ce site fabriqué avec <a href=\"http://appyframework.org\" target=\"_blank\">Appy</a>"
#. Default: "Please type \"${text}\" (without the double quotes) in the field besides, but without the character at position ${number}."
msgid "captcha_text"

View file

@ -66,9 +66,9 @@ img { border: 0; vertical-align: middle }
background-color: #dbdde1; font-weight: bold }
.navigate td { padding: 4px 9px }
.login { margin: 3px; color: black }
.button { border-width: 0 !important; color: #666666; height: 23px; width: 150px;
cursor:pointer; font-size: 90%; padding: 1px 0 0 10px;
background-color: transparent !important }
input.button { border-width: 0 !important; color: #666666; height: 23px;
width: 150px; cursor:pointer; font-size: 90%; padding: 1px 0 0 10px;
background-color: transparent !important }
.buttons { margin-left: 4px }
.message { position: absolute; top: -40px; left: 50%; font-size: 90%;
width: 600px; border: 1px #F0C36D solid; padding: 6px;

View file

@ -441,7 +441,7 @@ class ToolWrapper(AbstractWrapper):
if="zobjects and fields" align=":dright">
<tr>
<td var="zobj=zobjects[0]; obj=zobj.appy()"
for="field in fields">:field.pxView</td>
for="field in fields">:field.pxRender</td>
</tr>
</table>

View file

@ -33,7 +33,7 @@ class TranslationWrapper(AbstractWrapper):
sourceMsg = sourceMsg.replace('<','&lt;').replace('>','&gt;')
sourceMsg = sourceMsg.replace('\n', '<br/>')
return '<div class="translationLabel"><acronym title="%s" ' \
'style="margin-right: 5px"><img src="help.png"/></acronym>' \
'style="margin-right: 5px"><img src="/ui/help.png"/></acronym>' \
'%s</div>' % (fieldName, sourceMsg)
def show(self, field):

View file

@ -189,7 +189,7 @@ class AbstractWrapper(object):
</tr>
<!-- The user strip -->
<tr height="28px">
<tr height=":discreetLogin and '5px' or '28px'">
<td>
<table class="userStrip">
<tr>