-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alessandro Vermeulen
committed
Mar 21, 2011
0 parents
commit 4c08b42
Showing
62 changed files
with
7,147 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,6 @@ | |||
# OS generated files # | |||
###################### | |||
.DS_Store? | |||
ehthumbs.db | |||
Icon? | |||
Thumbs.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,12 @@ | |||
from Products.CMFCore.utils import getToolByName | |||
|
|||
def install(portal): | |||
setup_tool = getToolByName(portal, 'portal_setup') | |||
setup_tool.runAllImportStepsFromProfile('profile-Products.Doormat:default') | |||
return "Ran all import steps." | |||
|
|||
def uninstall(portal): | |||
setup_tool = getToolByName(portal, 'portal_setup') | |||
setup_tool.runAllImportStepsFromProfile('profile-Products.Doormat:uninstall') | |||
return "Ran all uninstall steps." | |||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,97 @@ | |||
# -*- coding: utf-8 -*- | |||
# | |||
# File: Doormat.py | |||
# | |||
# Copyright (c) 2010 by unknown <unknown> | |||
# Generator: ArchGenXML Version 2.5 | |||
# http://plone.org/products/archgenxml | |||
# | |||
# GNU General Public License (GPL) | |||
# | |||
# This program is free software; you can redistribute it and/or | |||
# modify it under the terms of the GNU General Public License | |||
# as published by the Free Software Foundation; either version 2 | |||
# of the License, or (at your option) any later version. | |||
# | |||
# This program is distributed in the hope that it will be useful, | |||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
# GNU General Public License for more details. | |||
# | |||
# You should have received a copy of the GNU General Public License | |||
# along with this program; if not, write to the Free Software | |||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | |||
# 02110-1301, USA. | |||
# | |||
|
|||
__author__ = """unknown <unknown>""" | |||
__docformat__ = 'plaintext' | |||
|
|||
|
|||
# There are three ways to inject custom code here: | |||
# | |||
# - To set global configuration variables, create a file AppConfig.py. | |||
# This will be imported in config.py, which in turn is imported in | |||
# each generated class and in this file. | |||
# - To perform custom initialisation after types have been registered, | |||
# use the protected code section at the bottom of initialize(). | |||
|
|||
import logging | |||
logger = logging.getLogger('Doormat') | |||
logger.debug('Installing Product') | |||
|
|||
import os | |||
import os.path | |||
from Globals import package_home | |||
import Products.CMFPlone.interfaces | |||
from Products.Archetypes import listTypes | |||
from Products.Archetypes.atapi import * | |||
from Products.Archetypes.utils import capitalize | |||
from Products.CMFCore import DirectoryView | |||
from Products.CMFCore import permissions as cmfpermissions | |||
from Products.CMFCore import utils as cmfutils | |||
from Products.CMFPlone.utils import ToolInit | |||
from config import * | |||
|
|||
DirectoryView.registerDirectory('skins', product_globals) | |||
|
|||
|
|||
##code-section custom-init-head #fill in your manual code here | |||
##/code-section custom-init-head | |||
|
|||
|
|||
def initialize(context): | |||
"""initialize product (called by zope)""" | |||
##code-section custom-init-top #fill in your manual code here | |||
##/code-section custom-init-top | |||
|
|||
# imports packages and types for registration | |||
import content | |||
|
|||
|
|||
# Initialize portal content | |||
all_content_types, all_constructors, all_ftis = process_types( | |||
listTypes(PROJECTNAME), | |||
PROJECTNAME) | |||
|
|||
cmfutils.ContentInit( | |||
PROJECTNAME + ' Content', | |||
content_types = all_content_types, | |||
permission = DEFAULT_ADD_CONTENT_PERMISSION, | |||
extra_constructors = all_constructors, | |||
fti = all_ftis, | |||
).initialize(context) | |||
|
|||
# Give it some extra permissions to control them on a per class limit | |||
for i in range(0,len(all_content_types)): | |||
klassname=all_content_types[i].__name__ | |||
if not klassname in ADD_CONTENT_PERMISSIONS: | |||
continue | |||
|
|||
context.registerClass(meta_type = all_ftis[i]['meta_type'], | |||
constructors= (all_constructors[i],), | |||
permission = ADD_CONTENT_PERMISSIONS[klassname]) | |||
|
|||
##code-section custom-init-bottom #fill in your manual code here | |||
##/code-section custom-init-bottom | |||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
# Make this a python package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,55 @@ | |||
<configure | |||
xmlns="http://namespaces.zope.org/zope" | |||
xmlns:browser="http://namespaces.zope.org/browser" | |||
xmlns:five="http://namespaces.zope.org/five" | |||
xmlns:zcml="http://namespaces.zope.org/zcml" | |||
xmlns:i18n="http://namespaces.zope.org/i18n" | |||
xmlns:plone="http://namespaces.plone.org/plone" | |||
i18n_domain="Doormat"> | |||
|
|||
|
|||
<browser:page | |||
for="..content.interfaces.IDoormat" | |||
name="doormat-view" | |||
class=".views.DoormatView" | |||
template="doormat_view.pt" | |||
permission="zope2.View" | |||
/> | |||
|
|||
<browser:page | |||
for="..content.interfaces.IDoormat" | |||
name="doormat-view-bare" | |||
class=".views.DoormatView" | |||
template="doormat_bare_view.pt" | |||
permission="zope2.View" | |||
/> | |||
|
|||
<browser:page | |||
for="..content.interfaces.IDoormat" | |||
name="doormat-macros" | |||
template="macros.pt" | |||
permission="zope.Public" | |||
/> | |||
|
|||
<browser:viewlet | |||
name="doormat.footer" | |||
manager="plone.app.layout.viewlets.interfaces.IPortalFooter" | |||
template="doormat_viewlet.pt" | |||
permission="zope2.View" | |||
layer=".interfaces.IDoormatLayer" | |||
/> | |||
|
|||
<browser:viewlet | |||
name="doormat.footer.bare" | |||
manager="plone.app.layout.viewlets.interfaces.IPortalFooter" | |||
template="doormat_viewlet_bare.pt" | |||
permission="zope2.View" | |||
layer=".interfaces.IDoormatLayer" | |||
/> | |||
|
|||
<browser:resourceDirectory | |||
name="Products.Doormat.stylesheets" | |||
directory="stylesheets" | |||
/> | |||
|
|||
</configure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
<div metal:use-macro="view/context/@@doormat-macros/body" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,5 @@ | |||
<div class="row"> | |||
<div class="cell width-full position-0" > | |||
<div metal:use-macro="view/context/@@doormat-macros/body" /> | |||
</div> | |||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,9 @@ | |||
<tal:getDoormat | |||
tal:define="doormat_brains python: | |||
context.portal_catalog(portal_type='Doormat',sort_on='created')" | |||
tal:condition="python: len(doormat_brains) > 0"> | |||
<tal:getView | |||
tal:define="doormat_object python: doormat_brains[0].getObject()" | |||
tal:content="structure doormat_object/@@doormat-view" | |||
/> | |||
</tal:getDoormat> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,9 @@ | |||
<tal:getDoormat | |||
tal:define="doormat_brains python: | |||
context.portal_catalog(portal_type='Doormat',sort_on='created')" | |||
tal:condition="python: len(doormat_brains) > 0"> | |||
<tal:getView | |||
tal:define="doormat_object python: doormat_brains[0].getObject()" | |||
tal:content="structure doormat_object/@@doormat-view-bare" | |||
/> | |||
</tal:getDoormat> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,5 @@ | |||
from zope.interface import Interface | |||
|
|||
class IDoormatLayer(Interface): | |||
""" Marker interface for browser layer | |||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,48 @@ | |||
<html xmlns="http://www.w3.org/1999/xhtml" | |||
xmlns:tal="http://xml.zope.org/namespaces/tal" | |||
xmlns:metal="http://xml.zope.org/namespaces/metal" | |||
> | |||
|
|||
<div id="doormat-container" | |||
tal:define=" | |||
doormat_data view/getDoormatData; | |||
nr_of_cols python:len(doormat_data); | |||
" | |||
tal:attributes="class string:columns-${nr_of_cols}" | |||
metal:define-macro="body"> | |||
|
|||
<h2 tal:define="title view/getDoormatTitle" | |||
tal:condition="title" | |||
tal:content="title" | |||
> | |||
[Doormat title] | |||
</h2> | |||
<div tal:attributes="class string:doormatColumn column-${repeat/column/index}" | |||
tal:repeat="column doormat_data"> | |||
<h3 tal:condition="column/show_title" | |||
tal:content="column/column_title"> | |||
[Column title] | |||
</h3> | |||
<dl class="doormatSection" tal:repeat="section column/column_sections"> | |||
<dt class="doormatSectionHeader" | |||
tal:condition="section/show_title" | |||
tal:content="section/section_title">[title for section]</dt> | |||
<dd class="doormatSectionBody" tal:repeat="link section/section_links"> | |||
<a tal:condition="python: link.get('link_url', None)" | |||
tal:attributes=" | |||
href link/link_url; | |||
class link/link_class; | |||
" | |||
tal:content="link/link_title"> | |||
[link title] | |||
</a> | |||
<div tal:condition="python: link.get('content', None)" | |||
tal:replace="structure link/content"> | |||
[content] | |||
</div> | |||
</dd> | |||
</dl> | |||
</div> | |||
</div> | |||
|
|||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,43 @@ | |||
#doormat-container { | |||
background:none repeat scroll 0 0 #DDDDDD; | |||
font-size:75%; | |||
margin:1em 0; | |||
float: left; | |||
width: 100%; | |||
} | |||
#doormat-container h2 { | |||
margin: 0.5em 0.5em 0px 0.5em; | |||
} | |||
#doormat-container h3 { | |||
margin: 0.5em 0px; | |||
} | |||
#doormat-container dl { | |||
margin: 0.5em 0px; | |||
} | |||
#doormat-container dl dd { | |||
margin-left: 0px; | |||
} | |||
#doormat-container .doormatColumn { | |||
float: left; | |||
margin: 0px 1em; | |||
} | |||
|
|||
/* Make all columns equally wide */ | |||
#doormat-container.columns-2 .doormatColumn { | |||
width: 48%; | |||
} | |||
#doormat-container.columns-3 .doormatColumn { | |||
width: 31%; | |||
} | |||
#doormat-container.columns-4 .doormatColumn { | |||
width: 23%; | |||
} | |||
#doormat-container.columns-5 .doormatColumn { | |||
width: 18%; | |||
} | |||
#doormat-container.columns-6 .doormatColumn { | |||
width: 14%; | |||
} | |||
#doormat-container.columns-7 .doormatColumn { | |||
width: 12%; | |||
} |
Oops, something went wrong.