Imported from SVN by Bitbucket

This commit is contained in:
2015-03-31 20:26:20 +00:00
committed by bitbucket
commit ceb7984dec
212 changed files with 49537 additions and 0 deletions

6
caotek/__init__.py Executable file
View File

@@ -0,0 +1,6 @@
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)

4
caotek/zidol_theme/__init__.py Executable file
View File

@@ -0,0 +1,4 @@
# -*- extra stuff goes here -*-
def initialize(context):
"""Initializer called when used as a Zope 2 product."""

View File

@@ -0,0 +1 @@
#

View File

@@ -0,0 +1,42 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser"
i18n_domain="caotek.zidol_theme">
<include package="Products.Collage" />
<includeOverrides file="overrides.zcml" />
<!-- 'caotek Zidol theme' Zope 3 browser layer -->
<interface
interface=".interfaces.IThemeSpecific"
type="zope.publisher.interfaces.browser.IBrowserSkinType"
name="caotek Zidol theme"
/>
<!-- Viewlets registration -->
<browser:viewlet
name="caotek.zidol_theme.footer"
manager="plone.app.layout.viewlets.interfaces.IPortalFooter"
class="plone.app.layout.viewlets.common.FooterViewlet"
template="templates/footer.pt"
layer=".interfaces.IThemeSpecific"
permission="zope2.View"
/>
<!-- Zope 3 browser resources -->
<!-- Resource directory for images -->
<browser:resourceDirectory
name="caotek.zidol_theme.images"
directory="images"
layer=".interfaces.IThemeSpecific"
/>
<!-- Resource directory for stylesheets -->
<browser:resourceDirectory
name="caotek.zidol_theme.stylesheets"
directory="stylesheets"
layer=".interfaces.IThemeSpecific"
/>
</configure>

View File

@@ -0,0 +1,56 @@
README for the 'browser/images/' directory
==========================================
This folder is a Zope 3 Resource Directory acting as a repository for images.
Its declaration is located in 'browser/configure.zcml':
<!-- Resource directory for images -->
<browser:resourceDirectory
name="caotek.zidol_theme.images"
directory="images"
layer=".interfaces.IThemeSpecific"
/>
An image placed in this directory (e.g. 'logo.png') can be accessed from
this relative URL:
"++resource++caotek.zidol_theme.images/logo.png"
Note that it might be better to register each of these resources separately if
you want them to be overridable from zcml directives.
The only way to override a resource in a resource directory is to override the
entire directory (all elements have to be copied over).
A Zope 3 browser resource declared like this in 'browser/configure.zcml':
<browser:resource
name="logo.png"
file="images/logo.png"
layer=".interfaces.IThemeSpecific"
/>
can be accessed from this relative URL:
"++resource++logo.png"
Notes
-----
* Whatever the way they are declared (in bulk inside a resource directory or
as separate resources), images registered as Zope 3 browser resources don't
have all the attributes that Zope 2 image objects have (i.e. the 'title'
property and the 'tag()' and 'get_size()' methods).
This means that if you want the html tag of your image to be auto-generated
(this is the case by default for the portal logo), you should store it in a
directory that is located in the 'skins/' folder of your package, registered
as a File System Directory View in the 'portal_skins' tool, and added to the
layers of your skin.
* Customizing/overriding images that are originally accessed from the
'portal_skins' tool (e.g. Plone default logo and icons) can be done inside
that tool only. There is no known way to do it with Zope 3 browser
resources.
Vice versa, there is no known (easy) way to override a Zope 3 browser
resource from a skin layer in 'portal_skins'.

View File

@@ -0,0 +1,6 @@
from plone.theme.interfaces import IDefaultPloneLayer
class IThemeSpecific(IDefaultPloneLayer):
"""Marker interface that defines a Zope 3 browser layer.
"""

View File

@@ -0,0 +1,24 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser"
i18n_domain="caotek.zidol_theme">
<browser:page
name="summary"
for="Products.ATContentTypes.content.topic.ATTopic"
permission="zope.Public"
template="templates/topic_summary.pt"
class="Products.Collage.browser.views.SummaryTopicView"
layer="Products.Collage.interfaces.ICollageBrowserLayer"
/>
<browser:page
name="standard"
for="Products.ATContentTypes.content.topic.ATTopic"
permission="zope.Public"
template="templates/topic_standard.pt"
class="Products.Collage.browser.views.StandardTopicView"
layer="Products.Collage.interfaces.ICollageBrowserLayer"
/>
</configure>

View File

@@ -0,0 +1,61 @@
README for the 'browser/stylesheets/' directory
===============================================
This folder is a Zope 3 Resource Directory acting as a repository for
stylesheets.
Its declaration is located in 'browser/configure.zcml':
<!-- Resource directory for stylesheets -->
<browser:resourceDirectory
name="caotek.zidol_theme.stylesheets"
directory="stylesheets"
layer=".interfaces.IThemeSpecific"
/>
A stylesheet placed in this directory (e.g. 'main.css') can be accessed from
this relative URL:
"++resource++caotek.zidol_theme.stylesheets/main.css"
Note that it might be better to register each of these resources separately if
you want them to be overridable from zcml directives.
The only way to override a resource in a resource directory is to override the
entire directory (all elements have to be copied over).
A Zope 3 browser resource declared like this in 'browser/configure.zcml':
<browser:resource
name="main.css"
file="stylesheets/main.css"
layer=".interfaces.IThemeSpecific"
/>
can be accessed from this relative URL:
"++resource++main.css"
Notes
-----
* Stylesheets registered as Zope 3 resources might be flagged as not found in
the 'portal_css' tool if the layer they are registered for doesn't match the
default skin set in 'portal_skins'.
This can be confusing but it must be considered as a minor bug in the CSS
registry instead of a lack in the way Zope 3 resources are handled in
Zope 2.
* There might be a way to interpret DTML from a Zope 3 resource view.
Although, if you need to use DTML for setting values in a stylesheet (the
same way as in default Plone stylesheets where values are read from
'base_properties'), it is much easier to store it in a directory that is
located in the 'skins/' folder of your package, registered as a File System
Directory View in the 'portal_skins' tool, and added to the layers of your
skin.
* Customizing/overriding stylesheets that are originally accessed from the
'portal_skins' tool (e.g. Plone default stylesheets) can be done inside that
tool only. There is no known way to do it with Zope 3 browser resources.
Vice versa, there is no known way to override a Zope 3 browser resource from
a skin layer in 'portal_skins'.

View File

@@ -0,0 +1,2 @@
/* Stylesheet for the 'caotek Zidol theme' Plone theme */

View File

@@ -0,0 +1,21 @@
<div metal:define-macro="portal_footer"
i18n:domain="plone"
class="row">
<div class="cell width-full position-0">
<div id="portal-footer">
<table class="invisible" style="width=70%; margin-left:15%;">
<tr>
<td style="padding:1.8em;">
<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/deed.vi" target="_blank"><img alt="Licence Creative Commons" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-nd/3.0/88x31.png" /></a>
</td>
<td>
Trang này được phát hành theo <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/deed.vi" target="_blank">Giấy phép Creative Commons BY-NC-ND 3.0 France</a>.<br />
Copyright © 2006 by Dien Dan Forum, BP 50, 92340 Bourg-La-Reine, France. | <a href="mailto:diendan@diendan.org">diendan@diendan.org</a>
</td>
</tr>
</table>
</div>
</div>
</div>

View File

@@ -0,0 +1,55 @@
<tal:manager replace="structure provider:collage.ContentManager" />
<tal:variables define="plone_view here/@@plone;
toLocalizedTime nocall: plone_view/toLocalizedTime;
isAnon view/isAnon;
mtool view/mtool;
portal_url view/portal_url;
normalizeString view/normalizeString;
site_properties view/site_properties">
<div class="standard-topic"
tal:define="topicContents view/getContents"
tal:condition="topicContents">
<a tal:omit-tag="not: view/isAlias"
tal:attributes="href context/absolute_url">
<h2 metal:define-macro="title"
tal:define="kssview context/@@collage_kss_helper"
tal:attributes="id string:title-${kssview/getUniqueIdentifier};
class python: kssview.getKssClasses('title')"
tal:condition="here/Title">
<span metal:define-slot="inside"
tal:replace="here/Title">title</span>
</h2>
</a>
<p class="description-topic">
<span metal:define-macro="description"
tal:define="view context/@@collage_kss_helper"
tal:attributes="id string:description-${view/getUniqueIdentifier};
class python: view.getKssClasses('description')"
tal:condition="here/Description">
<span metal:define-slot="inside"
tal:replace="here/Description">description</span>
</span>
</p>
<!-- idem vue standard mais avec about -->
<tal:listing i18n:domain="plone"
define="view context/@@collage_kss_helper/getKssView;
getKssClasses python: view.getKssClasses;
templateId string:folder_summary_view;
folderContents topicContents">
<metal:listing-macro use-macro="here/folder_listing_with_about/macros/listing" />
</tal:listing>
<a tal:attributes="href here/absolute_url"
tal:condition="python:len(topicContents) == here.itemCount"
i18n:domain="plone" i18n:translate="box_morelink">More...</a>
</div>
</tal:variables>

View File

@@ -0,0 +1,81 @@
<tal:manager replace="structure provider:collage.ContentManager" />
<tal:variables define="plone_view here/@@plone;
toLocalizedTime nocall: plone_view/toLocalizedTime;
isAnon view/isAnon;
mtool view/mtool;
portal_url view/portal_url;
normalizeString view/normalizeString;
site_properties view/site_properties">
<div class="standard-topic"
tal:define="topicContents view/getContents;
dossierTTM string:thay-tren-mang;
dossierTBD string:ban-doc-va-dien-dan;
dossierLu here/getId"
tal:condition="topicContents">
<a tal:omit-tag="not: view/isAlias"
tal:attributes="href context/absolute_url">
<h2 metal:define-macro="title"
tal:define="kssview context/@@collage_kss_helper"
tal:attributes="id string:title-${kssview/getUniqueIdentifier};
class python: kssview.getKssClasses('title')"
tal:condition="here/Title">
<span metal:define-slot="inside"
tal:replace="here/Title">title</span>
</h2>
</a>
<!-- collection Thay tren mang -->
<div tal:condition="python:dossierLu == dossierTTM">
<a href="" tal:attributes="href string:${portal_url}/thay-tren-mang-moi">
Xem thư mục Thấy trên mạng</a>
</div>
<!-- collection Bạn đọc và diễn đàn -->
<div tal:condition="python:dossierLu == dossierTBD">
<a href="" tal:attributes="href string:${portal_url}/BanDocVaZD">
Xem thư mục Bạn đọc và Diễn Đàn </a>
</div>
<p class="description-topic">
<span metal:define-macro="description"
tal:define="view context/@@collage_kss_helper"
tal:attributes="id string:description-${view/getUniqueIdentifier};
class python: view.getKssClasses('description')"
tal:condition="here/Description">
<span metal:define-slot="inside"
tal:replace="here/Description">description</span>
</span>
</p>
<!-- avec description
<tal:listing i18n:domain="plone"
define="view context/@@collage_kss_helper/getKssView;
getKssClasses python: view.getKssClasses;
templateId string:folder_summary_view;
folderContents topicContents">
<metal:listing-macro use-macro="here/folder_listing/macros/listing" />
</tal:listing>
-->
<!-- idem vue standard mais sans description -->
<tal:listing i18n:domain="plone"
define="view context/@@collage_kss_helper/getKssView;
getKssClasses python: view.getKssClasses;
templateId string:folder_summary_view;
folderContents topicContents">
<metal:listing-macro use-macro="here/folder_listing_sans_desc/macros/listing" />
</tal:listing>
<!-- cacher le lien "More"
<a tal:attributes="href here/absolute_url"
tal:condition="python:len(topicContents) == here.itemCount"
i18n:domain="plone" i18n:translate="box_morelink">More...</a>
-->
</div>
</tal:variables>

View File

@@ -0,0 +1 @@
<div tal:content="view/computed_value|nothing"/>

View File

@@ -0,0 +1,2 @@
#from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
#from plone.app.layout.viewlets.common import ViewletBase

View File

@@ -0,0 +1,16 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:five="http://namespaces.zope.org/five"
xmlns:cmf="http://namespaces.zope.org/cmf"
xmlns:i18n="http://namespaces.zope.org/i18n"
i18n_domain="caotek.zidol_theme">
<!-- File System Directory Views registration -->
<cmf:registerDirectory name="caotek_zidol_images"/>
<cmf:registerDirectory name="caotek_zidol_styles"/>
<five:registerPackage package="." initialize=".initialize" />
<include package=".browser" />
<include file="profiles.zcml" />
</configure>

View File

@@ -0,0 +1,22 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
i18n_domain="caotek.zidol_theme">
<genericsetup:registerProfile
name="default"
title="caotek Zidol theme"
directory="profiles/default"
description='Extension profile for the "caotek Zidol" Plone theme.'
provides="Products.GenericSetup.interfaces.EXTENSION"
/>
<genericsetup:importStep
name="caotek.zidol_theme.various"
title="caotek Zidol theme: miscellaneous import steps"
description="Various import steps that are not handled by GS import/export handlers."
handler="caotek.zidol_theme.setuphandlers.setupVarious">
<depends name="skins"/>
</genericsetup:importStep>
</configure>

View File

@@ -0,0 +1 @@
This file is used as a marker in setuphandlers.py.

View File

@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<object name="portal_css">
<stylesheet title=""
id="styles.css"
media="all" rel="stylesheet" rendering="import"
cacheable="True" compression="safe" cookable="True"
enabled="1" expression=""/>
</object>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0"?>
<object name="portal_javascripts">
</object>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0"?>
<metadata>
<version>1000</version>
</metadata>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0"?>
<object name="portal_skins" allow_any="False" cookie_persistence="False"
default_skin="caotek Zidol theme">
<object name="caotek_zidol_images"
meta_type="Filesystem Directory View"
directory="caotek.zidol_theme:skins/caotek_zidol_images"/>
<object name="caotek_zidol_styles"
meta_type="Filesystem Directory View"
directory="caotek.zidol_theme:skins/caotek_zidol_styles"/>
<skin-path name="caotek Zidol theme" based-on="Sunburst Theme">
<layer name="caotek_zidol_images"
insert-after="custom"/>
<layer name="caotek_zidol_styles"
insert-after="caotek_zidol_images"/>
</skin-path>
</object>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<object>
<order manager="plone.portalfooter" skinname="caotek Zidol theme"
based-on="Plone Default">
<viewlet name="caotek.zidol_theme.footer"
insert-before="*" />
</order>
<hidden manager="plone.portalfooter" skinname="caotek Zidol theme">
<viewlet name="plone.footer" />
<viewlet name="plone.colophon" />
</hidden>
</object>

View File

@@ -0,0 +1,11 @@
def setupVarious(context):
# Ordinarily, GenericSetup handlers check for the existence of XML files.
# Here, we are not parsing an XML file, but we use this text file as a
# flag to check that we actually meant for this import step to be run.
# The file is found in profiles/default.
if context.readDataFile('caotek.zidol_theme_various.txt') is None:
return
# Add additional setup code here

Binary file not shown.

After

Width:  |  Height:  |  Size: 924 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -0,0 +1,2 @@
[default]
title=Dien Dan logo

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1,51 @@
title:string=In here JUST to override logoName
plone_skin:string=Sunburst Theme
logoName:string=logo-zidol.png
fontFamily:string="Helvetica Neue", Arial, FreeSans, sans-serif;
linkColor:string=#205c90
editBarColor:string=#75ad0a
compatibilityClassic:string=The below values are copied directly from the old Plone theme to make sure that products that rely on them don't break.
fontBaseSize:string=69%
fontColor:string=Black
fontSmallSize:string=90%
backgroundColor:string=White
linkActiveColor:string=Red
linkVisitedColor:string=Purple
borderWidth:string=1px
borderStyle:string=solid
borderStyleAnnotations:string=solid
globalBorderColor:string=#8cacbb
globalBackgroundColor:string=#dee7ec
globalFontColor:string=#436976
headingFontFamily:string="Lucida Grande", Verdana, Lucida, Helvetica, Arial, sans-serif
contentViewBorderColor:string=#74ae0b
contentViewBackgroundColor:string=#cde2a7
contentViewFontColor:string=#578308
inputFontColor:string=Black
textTransform:string=none
evenRowBackgroundColor:string=#eef3f5
oddRowBackgroundColor:string=transparent
notifyBorderColor:string=#ffa500
notifyBackgroundColor:string=#ffce7b
discreetColor:string=#76797c
helpBackgroundColor:string=#ffffe1
portalMinWidth:string=70em
columnOneWidth:string=16em
columnTwoWidth:string=16em

View File

@@ -0,0 +1,187 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
lang="en"
metal:use-macro="context/main_template/macros/master"
i18n:domain="plone">
<body>
<metal:content-core fill-slot="content-core">
<metal:block define-macro="content-core"
tal:define="kssClassesView context/@@kss_field_decorator_view;
getKssClasses nocall:kssClassesView/getKssClassesInlineEditable;
templateId template/getId">
<div metal:define-macro="text-field-view"
id="parent-fieldname-text" class="stx"
tal:define="kss_class python:getKssClasses('text',
templateId=templateId, macro='text-field-view');
has_text exists:context/aq_explicit/getText;
text python:has_text and here.getText() or ''"
tal:condition="text"
tal:attributes="class python:test(context.Format() in ('text/structured',
'text/x-rst', ), 'stx' + kss_class, 'plain' + kss_class)">
<div metal:define-slot="inside" tal:replace="structure text">The body</div>
</div>
<metal:listingmacro define-macro="listing">
<tal:foldercontents define="contentFilter contentFilter|request/contentFilter|nothing;
contentFilter python:contentFilter and dict(contentFilter) or {};
limit_display limit_display|request/limit_display|nothing;
limit_display python:limit_display and int(limit_display) or None;
more_url more_url|request/more_url|string:folder_contents;
is_a_topic python:context.portal_type=='Topic';
friendly_types context/@@plone_portal_state/friendly_types;
dummy python:not is_a_topic and contentFilter.setdefault('portal_type', friendly_types);
folderContents folderContents|nothing; folderContents python:folderContents or is_a_topic and context.queryCatalog(batch=True, **contentFilter) or context.getFolderContents(contentFilter, batch=True, b_size=limit_display or 100);
site_properties context/portal_properties/site_properties;
use_view_action site_properties/typesUseViewActionInListings|python:();
Batch python:modules['Products.CMFPlone'].Batch;
b_start python:request.get('b_start', 0);
batch python:isinstance(folderContents, Batch) and folderContents or Batch(folderContents, limit_display or 100, int(b_start), orphan=1);
isAnon context/@@plone_portal_state/anonymous;
normalizeString nocall: context/plone_utils/normalizeString;
toLocalizedTime nocall: context/@@plone/toLocalizedTime;
show_about python:not isAnon or site_properties.allowAnonymousViewAbout;
navigation_root_url context/@@plone_portal_state/navigation_root_url;
pas_member context/@@pas_member;
plone_view context/@@plone;">
<tal:listing condition="batch">
<dl metal:define-slot="entries">
<tal:entry tal:repeat="item batch" metal:define-macro="entries">
<tal:block tal:define="item_url item/getURL|item/absolute_url;
item_id item/getId|item/id;
item_title_or_id item/pretty_title_or_id;
item_description item/Description;
item_type item/portal_type;
item_type_title item/Type;
item_modified item/ModificationDate;
item_created item/CreationDate;
item_icon python:plone_view.getIcon(item);
item_type_class python:'contenttype-' + normalizeString(item_type);
item_wf_state item/review_state|python: context.portal_workflow.getInfoFor(item, 'review_state', '');
item_wf_state_class python:'state-' + normalizeString(item_wf_state);
item_creator item/Creator;
item_start item/start|item/StartDate|nothing;
item_end item/end|item/EndDate|nothing;
item_sametime python: item_start == item_end;
item_samedate python: (item_end - item_start &lt; 1) if item_type == 'Event' else False">
<metal:block define-slot="entry">
<dt metal:define-macro="listitem"
tal:attributes="class python:test(item_type == 'Event', 'vevent', '')">
<span class="summary">
<img tal:replace="structure item_icon/html_tag" />
<a href="#"
tal:attributes="href python:test(item_type in use_view_action, item_url+'/view', item_url);
class string:$item_type_class $item_wf_state_class url"
tal:content="item_title_or_id">
Item Title
</a>
</span>
<span class="documentByLine">
<span tal:condition="python: item_type == 'Event' and item_sametime"
i18n:translate="label_event_byline_onlyfrom">
<abbr class="dtstart"
tal:attributes="title python:item_start"
tal:content="python:toLocalizedTime(item_start,long_format=1)"
i18n:name="start">from date</abbr>
</span>
<span tal:condition="python: item_type == 'Event' and item_samedate and not item_sametime"
i18n:translate="label_event_byline_samedate">
<abbr class="dtstart"
tal:attributes="title python:item_start"
tal:content="python:toLocalizedTime(item_start)"
i18n:name="start">from date</abbr> from
<abbr class="dtstart"
tal:attributes="title python:item_start"
tal:content="python:toLocalizedTime(item_start,time_only=1)"
i18n:name="starttime">from time</abbr> to
<abbr class="dtend"
tal:attributes="title python:item_end"
tal:content="python:toLocalizedTime(item_end,time_only=1)"
i18n:name="end">to time</abbr>
</span>
<span tal:condition="python: item_type == 'Event' and not item_samedate and not item_sametime"
i18n:translate="label_event_byline">
from
<abbr class="dtstart"
tal:attributes="title python:item_start"
tal:content="python:toLocalizedTime(item_start,long_format=1)"
i18n:name="start">from date</abbr> to
<abbr class="dtend"
tal:attributes="title python:item_end"
tal:content="python:toLocalizedTime(item_end,long_format=1)"
i18n:name="end">to date</abbr>
</span>
<span tal:condition="python: item_type == 'Event' and item.location"
i18n:translate="label_event_byline_location">&mdash;
<span tal:content="string:${item/location}"
class="location"
i18n:name="location">Oslo</span>,
</span>
<tal:byline condition="show_about">
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;
<tal:name tal:condition="item_creator"
tal:define="author python:pas_member.info(item_creator);">
<span tal:content="author/name_or_id">
Bob Dobalina
</span>
</tal:name>
<tal:modified condition="python: item_type != 'Event'">
&mdash;
<tal:mod i18n:translate="box_last_modified">
last modified
</tal:mod>
<span tal:replace="python:toLocalizedTime(item_modified,long_format=0)">
August 16, 2001 at 23:35:59
</span>
</tal:modified>
<metal:description define-slot="description_slot">
<tal:comment replace="nothing">
Place custom listing info for custom types here
</tal:comment>
</metal:description>
</tal:byline>
</span>
</dt>
<!--
<dd tal:condition="item_description">
<span class="description"
tal:content="item_description">
description
</span>
</dd>
-->
</metal:block>
</tal:block>
</tal:entry>
</dl>
<div metal:use-macro="context/batch_macros/macros/navigation" />
</tal:listing>
<metal:empty metal:define-slot="no_items_in_listing">
<p class="discreet"
tal:condition="not: folderContents"
i18n:translate="description_no_items_in_folder">
There are currently no items in this folder.
</p>
</metal:empty>
</tal:foldercontents>
</metal:listingmacro>
</metal:block>
</metal:content-core>
</body>
</html>

View File

@@ -0,0 +1,193 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
lang="en"
metal:use-macro="context/main_template/macros/master"
i18n:domain="plone">
<body>
<metal:content-core fill-slot="content-core">
<metal:block define-macro="content-core"
tal:define="kssClassesView context/@@kss_field_decorator_view;
getKssClasses nocall:kssClassesView/getKssClassesInlineEditable;
templateId template/getId">
<div metal:define-macro="text-field-view"
id="parent-fieldname-text" class="stx"
tal:define="kss_class python:getKssClasses('text',
templateId=templateId, macro='text-field-view');
has_text exists:context/aq_explicit/getText;
text python:has_text and here.getText() or ''"
tal:condition="text"
tal:attributes="class python:test(context.Format() in ('text/structured',
'text/x-rst', ), 'stx' + kss_class, 'plain' + kss_class)">
<div metal:define-slot="inside" tal:replace="structure text">The body</div>
</div>
<metal:listingmacro define-macro="listing">
<tal:foldercontents define="contentFilter contentFilter|request/contentFilter|nothing;
contentFilter python:contentFilter and dict(contentFilter) or {};
limit_display limit_display|request/limit_display|nothing;
limit_display python:limit_display and int(limit_display) or None;
more_url more_url|request/more_url|string:folder_contents;
is_a_topic python:context.portal_type=='Topic';
friendly_types context/@@plone_portal_state/friendly_types;
dummy python:not is_a_topic and contentFilter.setdefault('portal_type', friendly_types);
folderContents folderContents|nothing; folderContents python:folderContents or is_a_topic and context.queryCatalog(batch=True, **contentFilter) or context.getFolderContents(contentFilter, batch=True, b_size=limit_display or 100);
site_properties context/portal_properties/site_properties;
use_view_action site_properties/typesUseViewActionInListings|python:();
Batch python:modules['Products.CMFPlone'].Batch;
b_start python:request.get('b_start', 0);
batch python:isinstance(folderContents, Batch) and folderContents or Batch(folderContents, limit_display or 100, int(b_start), orphan=1);
isAnon context/@@plone_portal_state/anonymous;
normalizeString nocall: context/plone_utils/normalizeString;
toLocalizedTime nocall: context/@@plone/toLocalizedTime;
show_about python:not isAnon or site_properties.allowAnonymousViewAbout;
navigation_root_url context/@@plone_portal_state/navigation_root_url;
pas_member context/@@pas_member;
plone_view context/@@plone;">
<tal:listing condition="batch">
<dl metal:define-slot="entries">
<tal:entry tal:repeat="item batch" metal:define-macro="entries">
<tal:block tal:define="item_url item/getURL|item/absolute_url;
item_id item/getId|item/id;
item_title_or_id item/pretty_title_or_id;
item_description item/Description;
item_type item/portal_type;
item_type_title item/Type;
item_modified item/ModificationDate;
item_created item/CreationDate;
item_icon python:plone_view.getIcon(item);
item_type_class python:'contenttype-' + normalizeString(item_type);
item_wf_state item/review_state|python: context.portal_workflow.getInfoFor(item, 'review_state', '');
item_wf_state_class python:'state-' + normalizeString(item_wf_state);
item_creator item/Creator;
item_start item/start|item/StartDate|nothing;
item_end item/end|item/EndDate|nothing;
item_sametime python: item_start == item_end;
item_samedate python: (item_end - item_start &lt; 1) if item_type == 'Event' else False">
<metal:block define-slot="entry">
<dt metal:define-macro="listitem"
tal:attributes="class python:test(item_type == 'Event', 'vevent', '')">
<span class="summary">
<img tal:replace="structure item_icon/html_tag" />
<a href="#"
tal:attributes="href python:test(item_type in use_view_action, item_url+'/view', item_url);
class string:$item_type_class $item_wf_state_class url"
tal:content="item_title_or_id">
Item Title
</a>
</span>
<span class="documentByLine">
<span tal:condition="python: item_type == 'Event' and item_sametime"
i18n:translate="label_event_byline_onlyfrom">
<abbr class="dtstart"
tal:attributes="title python:item_start"
tal:content="python:toLocalizedTime(item_start,long_format=1)"
i18n:name="start">from date</abbr>
</span>
<span tal:condition="python: item_type == 'Event' and item_samedate and not item_sametime"
i18n:translate="label_event_byline_samedate">
<abbr class="dtstart"
tal:attributes="title python:item_start"
tal:content="python:toLocalizedTime(item_start)"
i18n:name="start">from date</abbr> from
<abbr class="dtstart"
tal:attributes="title python:item_start"
tal:content="python:toLocalizedTime(item_start,time_only=1)"
i18n:name="starttime">from time</abbr> to
<abbr class="dtend"
tal:attributes="title python:item_end"
tal:content="python:toLocalizedTime(item_end,time_only=1)"
i18n:name="end">to time</abbr>
</span>
<span tal:condition="python: item_type == 'Event' and not item_samedate and not item_sametime"
i18n:translate="label_event_byline">
from
<abbr class="dtstart"
tal:attributes="title python:item_start"
tal:content="python:toLocalizedTime(item_start,long_format=1)"
i18n:name="start">from date</abbr> to
<abbr class="dtend"
tal:attributes="title python:item_end"
tal:content="python:toLocalizedTime(item_end,long_format=1)"
i18n:name="end">to date</abbr>
</span>
<span tal:condition="python: item_type == 'Event' and item.location"
i18n:translate="label_event_byline_location">&mdash;
<span tal:content="string:${item/location}"
class="location"
i18n:name="location">Oslo</span>,
</span>
<!-- <tal:byline condition="show_about"> -->
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;
<tal:name tal:condition="item_creator"
tal:define="author python:pas_member.info(item_creator);">
<span tal:content="author/name_or_id">
Bob Dobalina
</span>
</tal:name>
<tal:modified condition="python: item_type != 'Event'">
&mdash;
<tal:mod i18n:translate="box_last_modified">
last modified
</tal:mod>
<span tal:replace="python:toLocalizedTime(item_modified,long_format=0)">
August 16, 2001 at 23:35:59
</span>
</tal:modified>
<metal:description define-slot="description_slot">
<tal:comment replace="nothing">
Place custom listing info for custom types here
</tal:comment>
</metal:description>
<!-- </tal:byline> -->
</span>
</dt>
<dd tal:condition="item_description">
<span class="description"
tal:content="item_description">
description
</span>
</dd>
<dd tal:condition="python: not item_description">
<span class="description">
&nbsp;
</span>
</dd>
</metal:block>
</tal:block>
</tal:entry>
</dl>
<div metal:use-macro="context/batch_macros/macros/navigation" />
</tal:listing>
<metal:empty metal:define-slot="no_items_in_listing">
<p class="discreet"
tal:condition="not: folderContents"
i18n:translate="description_no_items_in_folder">
There are currently no items in this folder.
</p>
</metal:empty>
</tal:foldercontents>
</metal:listingmacro>
</metal:block>
</metal:content-core>
</body>
</html>

View File

@@ -0,0 +1,54 @@
## Script (Python) "getFolderContents"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=contentFilter=None,batch=False,b_size=100,full_objects=False
##title=wrapper method around to use catalog to get folder contents
##
# Modifié par Cao pour changer l'ordre de tri du dossier
mtool = context.portal_membership
cur_path = '/'.join(context.getPhysicalPath())
path = {}
if not contentFilter:
contentFilter = {}
else:
contentFilter = dict(contentFilter)
# Modification : ordre descendant de la date de publication
contentFilter['sort_on'] = "effective"
contentFilter['sort_order'] = "descending"
if not contentFilter.get('sort_on', None):
contentFilter['sort_on'] = 'getObjPositionInParent'
if contentFilter.get('path', None) is None:
path['query'] = cur_path
path['depth'] = 1
contentFilter['path'] = path
show_inactive = mtool.checkPermission('Access inactive portal content', context)
# Provide batching hints to the catalog
b_start = int(context.REQUEST.get('b_start', 0))
contentFilter['b_start'] = b_start
if batch:
contentFilter['b_size'] = b_size
# Evaluate in catalog context because some containers override queryCatalog
# with their own unrelated method (Topics)
contents = context.portal_catalog.queryCatalog(contentFilter, show_all=1,
show_inactive=show_inactive, )
if full_objects:
contents = [b.getObject() for b in contents]
if batch:
from Products.CMFPlone import Batch
batch = Batch(contents, b_size, b_start, orphan=0)
return batch
return contents

View File

@@ -0,0 +1,109 @@
/************************
Word Plone Day 2011 Theme
*************************/
body {background: #ede7db url(bg.png) repeat-x fixed;}
div.row {
background-color: white;
}
#visual-portal-wrapper {
width: 1216px;
margin: 0 auto 15px auto;
background-color: white;
border-radius: 0px 0px 10px 10px;
-moz-border-radius: 0px 0px 10px 10px;
-webkit-border-bottom-right-radius: 10px;
-webkit-border-bottom-left-radius: 10px;
-webkit-box-shadow: 0px 5px 20px ;
-moz-box-shadow: 0px 5px 20px ;
box-shadow: 0px 5px 20px ;
}
#searchGadget {
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border: 1px solid #C3C3C3;
padding: 3px;
}
/* sections */
#portal-globalnav {
clear: both;
font-size: 100%;
background: #0c7cae;
/* ensure top navigation dont touches portlets, content etc.. #10491 */
margin: 0 0 1em 0;
}
#portal-globalnav li a {
min-width: 4.5em;
background-color: #0c7cae;
color: #fff;}
#portal-globalnav li a:hover,
#portal-globalnav li.selected a,
#portal-globalnav li.selected a:hover {background-color: #ff6600;}
#collage .listingBar {display:none;}
#collage .collage-item .documentByLine {
display: block;
}
h1, h2, h3, h4, h5, h6 {
font-family: Times New Roman, Palatino, serif;
font-weight: bold;
line-height: normal;
letter-spacing: normal;
color: #227496;
}
h1 {
font-size: 160%;
color: #990000;
}
h2 {
font-size: 150%;
color: #ff6600;
}
h3 {
font-size: 125%;
}
h4 {
font-size: 110%;
}
h5 {
font-size: 100%;
}
h6 {
font-size: 85%;
}
h1 a,
h2 a,
h3 a,
h4 a,
h5 a,
h6 a {
color: #227496; ! important;
text-decoration: none;
}
table.invisible {
margin-left: auto;
margin-right: auto;
}
table.invisible td,
table.invisible th {
padding: 1em;
vertical-align: top;
}

55
caotek/zidol_theme/tests.py Executable file
View File

@@ -0,0 +1,55 @@
import unittest
#from zope.testing import doctestunit
#from zope.component import testing
from Testing import ZopeTestCase as ztc
from Products.Five import fiveconfigure
from Products.PloneTestCase import PloneTestCase as ptc
from Products.PloneTestCase.layer import PloneSite
ptc.setupPloneSite()
import caotek.zidol_theme
class TestCase(ptc.PloneTestCase):
class layer(PloneSite):
@classmethod
def setUp(cls):
fiveconfigure.debug_mode = True
ztc.installPackage(caotek.zidol_theme)
fiveconfigure.debug_mode = False
@classmethod
def tearDown(cls):
pass
def test_suite():
return unittest.TestSuite([
# Unit tests
#doctestunit.DocFileSuite(
# 'README.txt', package='caotek.zidol_theme',
# setUp=testing.setUp, tearDown=testing.tearDown),
#doctestunit.DocTestSuite(
# module='caotek.zidol_theme.mymodule',
# setUp=testing.setUp, tearDown=testing.tearDown),
# Integration tests that use PloneTestCase
#ztc.ZopeDocFileSuite(
# 'README.txt', package='caotek.zidol_theme',
# test_class=TestCase),
#ztc.FunctionalDocFileSuite(
# 'browser.txt', package='caotek.zidol_theme',
# test_class=TestCase),
])
if __name__ == '__main__':
unittest.main(defaultTest='test_suite')

1
caotek/zidol_theme/version.txt Executable file
View File

@@ -0,0 +1 @@
4.1