some CSS improvements and other fixes

git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@1408 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2006-10-17 17:23:37 +00:00
parent 3c158f2f93
commit 7eb49d2513
5 changed files with 23 additions and 6 deletions

View file

@ -170,9 +170,9 @@
<tr metal:define-macro="buttons"> <tr metal:define-macro="buttons">
<td colspan="5" <td colspan="5"
tal:define="dlgName view/dialog_name"> tal:define="dlgName view/dialog_name">
<input type="button" value="Cancel" onClick="dlg.hide();" <input type="submit" value="Save" onClick="dlg.hide()" class="submit"
tal:attributes="onClick string:dialogs['$dlgName'].hide()"> tal:attributes="onClick string:dialogs['$dlgName'].hide()">
<input type="submit" value="Save" onClick="dlg.hide()" <input type="button" value="Cancel" onClick="dlg.hide();"
tal:attributes="onClick string:dialogs['$dlgName'].hide()"> tal:attributes="onClick string:dialogs['$dlgName'].hide()">
</td> </td>
</tr> </tr>

View file

@ -5,6 +5,16 @@
*/ */
a:hover {
background-color: #f0f0ff;
text-decoration: none;
}
pre {
overflow: scroll;
max-height: 35em;
}
.box { .box {
margin: 12px; margin: 12px;
} }
@ -74,6 +84,7 @@ div.image {
margin-right: 5px; margin-right: 5px;
} }
/* search stuff */ /* search stuff */
.searchForm input.button, input.submit { .searchForm input.button, input.submit {

View file

@ -68,8 +68,8 @@ class NodeView(BaseView):
def setupController(self): def setupController(self):
cm = self.controller.macros cm = self.controller.macros
cm.register('css', identifier='loops.css', cm.register('css', identifier='loops.css', resourceName='loops.css',
resourceName='loops.css', media='all') media='all', position=3)
cm.register('js', 'loops.js', resourceName='loops.js') cm.register('js', 'loops.js', resourceName='loops.js')
cm.register('portlet_left', 'navigation', title='Navigation', cm.register('portlet_left', 'navigation', title='Navigation',
subMacro=self.template.macros['menu']) subMacro=self.template.macros['menu'])

View file

@ -34,7 +34,6 @@ from zope.formlib.interfaces import DISPLAY_UNWRITEABLE
from zope.proxy import removeAllProxies from zope.proxy import removeAllProxies
from zope.security import canAccess, canWrite from zope.security import canAccess, canWrite
from zope.security.proxy import removeSecurityProxy from zope.security.proxy import removeSecurityProxy
from zope.documenttemplate.dt_util import html_quote
from cybertools.typology.interfaces import IType from cybertools.typology.interfaces import IType
from loops.interfaces import IBaseResource, IDocument, IMediaAsset from loops.interfaces import IBaseResource, IDocument, IMediaAsset
@ -42,6 +41,7 @@ from loops.browser.common import EditForm, BaseView
from loops.browser.concept import ConceptRelationView, ConceptConfigureView from loops.browser.concept import ConceptRelationView, ConceptConfigureView
from loops.browser.node import NodeView from loops.browser.node import NodeView
from loops.interfaces import ITypeConcept from loops.interfaces import ITypeConcept
from loops.browser.util import html_quote
renderingFactories = { renderingFactories = {
'text/plain': 'zope.source.plaintext', 'text/plain': 'zope.source.plaintext',
@ -210,7 +210,7 @@ class DocumentView(ResourceView):
contentType = self.context.contentType contentType = self.context.contentType
typeKey = renderingFactories.get(contentType, None) typeKey = renderingFactories.get(contentType, None)
if typeKey is None: if typeKey is None:
if contentType == 'text/html': if contentType == u'text/html':
return text return text
return u'<pre>%s</pre>' % html_quote(text) return u'<pre>%s</pre>' % html_quote(text)
source = zapi.createObject(typeKey, text) source = zapi.createObject(typeKey, text)

View file

@ -58,3 +58,9 @@ class LoopsMenu(BrowserMenu):
getMenu(item.submenuId, object, request)) or None} getMenu(item.submenuId, object, request)) or None}
for order, action, item in result] for order, action, item in result]
def html_quote(text, character_entities=((u'&', u'&amp;'), (u'<', u'&lt;' ),
(u'>', u'&gt;' ), (u'"', u'&quot;'))):
for re, name in character_entities:
text = text.replace(re, name)
return text