Permalink
Browse files

Forgot to commit a bunch of changes.

  • Loading branch information...
1 parent ffcc4ee commit 1e80a6eaaea18167bfae49fbce94f9fe44c9db8e @kaerumy kaerumy committed Mar 26, 2012
View
24 README.txt
@@ -1,6 +1,28 @@
Introduction
============
+An dexterity content add-on for Plone to track Corruption Issues
+Due to the lack of opposition, corruption is now entrenched in the
+Malaysian system. Abuse of funds, conflict of interests in project
+awards, bribery and kick backs are rampant. Despite being highlighted in
+yearly government audits by the Auditor General, most of these cases are
+never investigated and the practice of corruption continues. Citizens of
+Malaysian want better accountability for reported corruption cases to
+make more informed decisions when voting for the right representatives
+for government.
-This product may contain traces of nuts.
+
+* Find and track the current resolution of reported corruption issues.
+ Was action taken? Was it verified? Were those involved persecuted?
+ Was the sentence acceptable?
+* See reports about the financial impact of corruption costs.
+* See breakdown of different issues eg. financial, abuse of
+ power
+* Find the people involved and how many cases have been
+ reported against them
+* Find out under which government
+ (coalitions/political parties) the corruption issues
+ happened
+* Follow issues of interest, and be notified when status of a case has
+ changed
View
29 buildout.cfg
@@ -1,9 +1,30 @@
[buildout]
-develop = .
-parts = scripts test
-extends = http://dist.plone.org/release/4.1.4/versions.cfg
+develop = .
+parts = scripts test omelette zopepy
+extends = http://good-py.appspot.com/release/dexterity/1.2?plone=4.1.4
versions = versions
+[instance]
+recipe = plone.recipe.zope2instance
+user = admin:admin
+http-address = 8080
+debug-mode = on
+verbose-security = on
+eggs = Plone
+ Pillow
+ sinar.corruptiontracker
+zcml =
+
+[omelette]
+recipe = collective.recipe.omelette
+eggs = ${instance:eggs}
+
+[zopepy]
+recipe = zc.recipe.egg
+eggs = ${instance:eggs}
+interpreter = zopepy
+scripts = zopepy
+
[scripts]
recipe = zc.recipe.egg
eggs =
@@ -14,4 +35,4 @@ eggs =
recipe = zc.recipe.testrunner
eggs =
sinar.corruptiontracker
- defaults = ['--exit-with-status', '--auto-color', '--auto-progress']
+defaults = ['--exit-with-status', '--auto-color', '--auto-progress']
View
3 src/sinar/corruptiontracker/__init__.py
@@ -1,4 +1,7 @@
# -*- extra stuff goes here -*-
+from zope.i18nmessageid import MessageFactory
+
+_ = MessageFactory("sinar.corruptiontracker")
def initialize(context):
View
3 src/sinar/corruptiontracker/configure.zcml
@@ -8,8 +8,9 @@
<!-- Include configuration for dependencies listed in setup.py -->
<includeDependencies package="." />
+ <include package="five.grok" />
+ <grok:grok package="." />
- <five:registerPackage package="." initialize=".initialize" />
<!-- -*- extra stuff goes here -*- -->
<!-- Register an extension profile to make the product installable -->
View
88 src/sinar/corruptiontracker/issue.py
@@ -14,63 +14,78 @@
from plone.indexer import indexer
from sinar.corruptiontracker import _
-
+from sinar.corruptiontracker.person import IPerson
class IIssue(form.Schema):
"""A Corrruption Issue
"""
-
- details = RichText(
- title=_(u"Corruption Details"),
- required=True,
- )
+
+ issue_start = schema.Date(
+ title=_(u"Date Issue Occurred/Started"),
+ required=False,
+ )
+
+ issue_end = schema.Date(
+ title=_(u"Date Issue Ended"),
+ description=_(u"When it stopped happening, if not single occurence."),
+ required=False,
+ )
+
+
financial_cost = schema.Int(
title=_(u"Financial Cost"),
description=_(u"Total financial cost of this corruption issue in RM"),
required=False,
)
+
+ details = RichText(
+ title=_(u"Corruption Details"),
+ required=True,
+ )
+ persons_directly_implicated = RelationList(
+ title =_(u"Persons directly implicated"),
+ description=_(u"Persons directly implicated ie. with name or should be charged with corruption. One per line."),
+ default=[],
+ value_type=RelationChoice(title=_(u"Related Persons"),
+ source= ObjPathSourceBinder(object_provides=IPerson.__identifier__)),
+ required=False,
+ )
- form.widget(persons_directly_implicated=TextLinesFieldWidget)
- persons_directly_implicated = schema.List(
- title =_(u"Persons directly implicated"),
- description=_(u"Persons directly implicated ie. with name or should be charged with corruption. One per line."),
- value_type=schema.TextLine(),
- required=False,
- )
- form.widget(persons_indirectly_implicated=TextLinesFieldWidget)
- persons_indirectly_implicated = schema.List(
+ persons_indirectly_implicated = RelationList(
title =_(u"Persons indirectly implicated. "),
- description =_(u"eg. minister or superior who approved loan or awarded tender. One per line."),
- value_type = schema.TextLine(),
+ description =_(u"eg. minister or superior who approved loan or awarded tender."),
+ value_type=RelationChoice(title=_(u"Related Persons"),
+ source= ObjPathSourceBinder(object_provides=IPerson.__identifier__)),
required=False
)
- form.widget(persons_disclosing=TextLinesFieldWidget)
- persons_disclosing = schema.List(
- title = _(u"Persons disclosing"),
- description = _(u"Persons who public disclosed this issue. One per line."),
- value_type = schema.TextLine(),
- required=False
- )
- form.widget(persons_supporting=TextLinesFieldWidget)
- persons_supporting= schema.List(
+
+ persons_disclosing = RelationList(
+ title = _(u"Persons disclosing"),
+ description = _(u"Persons who public disclosed this issue."),
+ value_type=RelationChoice(title=_(u"Related Persons"),
+ source= ObjPathSourceBinder(object_provides=IPerson.__identifier__)),
+ required=False
+ )
+ persons_supporting= RelationList(
title = _(u"Persons supporting"),
- description = _(u"Persons who support persons implicated such as defending their actions or defending that this is not an issue of corruption. One per line."),
- value_type = schema.TextLine(),
+ description = _(u"Persons who support persons implicated such as defending their actions or defending that this is not an issue of corruption."),
+ value_type=RelationChoice(title=_(u"Related Persons"),
+ source= ObjPathSourceBinder(object_provides=IPerson.__identifier__)),
required=False
)
- form.widget(persons_against=TextLinesFieldWidget)
- persons_against= schema.List(
+ persons_against= RelationList(
title = _(u"Persons against"),
- description = _(u"Persons who are against this action per line."),
- value_type = schema.TextLine(),
+ description = _(u"Persons who are against this action."),
+ value_type=RelationChoice(title=_(u"Related Persons"),
+ source= ObjPathSourceBinder(object_provides=IPerson.__identifier__)),
required=False
)
related_issues = RelationList(
title=u"Related Issues",
default=[],
value_type=RelationChoice(title=_(u"Related"),
- source=ObjPathSourceBinder()),
+ source=ObjPathSourceBinder(object_provides="sinar.corruptiontracker.issue.IIssue")),
required=False,
)
@@ -79,10 +94,3 @@ def searchableIndexer(obj):
return "%s %s %s" % (obj.title, obj.description, obj.details.output)
grok.global_adapter(searchableIndexer, name='SearchableText')
-@indexer(IIssue)
-def indexer_persons_directly_implicated(obj):
- if obj.persons_directly_implicated:
- return tuple(obj.persons_directly_implicated)
-grok.global_adapter(indexer_persons_directly_implicated, name='persons_directly_implicated')
-
-
View
2 src/sinar/corruptiontracker/person.py
@@ -29,7 +29,7 @@ class IPerson(form.Schema):
details = RichText(
title=_(u"Details"),
- required=True,
+ required=False,
)
View
18 src/sinar/corruptiontracker/person_templates/view.pt
@@ -22,7 +22,11 @@
<div tal:content="structure view/w/details/render" />
- <h2 tal:condition="python: view.directly_implicated()">Issues directl
+
+ <div tal:condition="python: view.directly_implicated()">
+ <h2 tal:condition="python: view.directly_implicated()">Issues
+ directly Implicated</h2>
+
<dl tal:repeat="obj python: view.directly_implicated()">
<dt><a tal:attributes="href obj/absolute_url">
<span tal:replace="obj/Title" /></a>
@@ -34,8 +38,14 @@
Financial Cost (MYR): <span tal:replace="obj/financial_cost" />
</dd>
</dl>
+ </div>
+ <div tal:condition="python: view.indirectly_implicated()">
<h2 tal:condition="python: view.indirectly_implicated()">Issues indirectly implicated</h2>
+ <p>Issues in which this person indirectly implicated, such as
+ personally or on a board allowing this issue to happen,
+ conflict of interest or benefitting in some way as a result of
+ this issue.<p>
<dl tal:repeat="obj python: view.indirectly_implicated()">
<dt><a tal:attributes="href obj/absolute_url">
<span tal:replace="obj/Title" /></a>
@@ -47,8 +57,11 @@
Financial Cost (MYR): <span tal:replace="obj/financial_cost" />
</dd>
</dl>
+ </div>
+ <div tal:condition="python: view.against()">
<h2 tal:condition="python: view.against()">Issues Against</h2>
+ <p>Issues for which this person has stated publicly or
<dl tal:repeat="obj python: view.against()">
<dt><a tal:attributes="href obj/absolute_url">
<span tal:replace="obj/Title" /></a>
@@ -60,7 +73,9 @@
Financial Cost (MYR): <span tal:replace="obj/financial_cost" />
</dd>
</dl>
+ </div>
+ <div tal:condition="python: view.supporting()">
<h2 tal:condition="python: view.supporting()">Issues Support</h2>
<dl tal:repeat="obj python: view.supporting()">
<dt><a tal:attributes="href obj/absolute_url">
@@ -73,6 +88,7 @@
Financial Cost (MYR): <span tal:replace="obj/financial_cost" />
</dd>
</dl>
+ </div>
View
25 src/sinar/corruptiontracker/profiles/default/catalog.xml
@@ -6,29 +6,4 @@
</index>
<column value="financial_cost" />
- <index name="persons_directly_implicated" meta_type="KeywordIndex">
- <indexed_attr value="persons_directly_implicated"/>
- </index>
- <column value="persons_indirectly_implicated"/>
-
- <index name="persons_indirectly_implicated" meta_type="KeywordIndex">
- <indexed_attr value="persons_indirectly_implicated"/>
- </index>
- <column value="persons_indirectly_implicated"/>
-
- <index name="persons_disclosing" meta_type="KeywordIndex">
- <indexed_attr value="persons_disclosing"/>
- </index>
- <column value="persons_disclosing"/>
-
- <index name="persons_supporting" meta_type="KeywordIndex">
- <indexed_attr value="persons_supporting"/>
- </index>
- <column value="persons_supporting"/>
-
- <index name="persons_against" meta_type="KeywordIndex">
- <indexed_attr value="persons_against"/>
- </index>
- <column value="persons_against"/>
-
</object>
View
1 src/sinar/corruptiontracker/profiles/default/types.xml
@@ -1,3 +1,4 @@
<object name="portal_types">
<object name="sinar.corruptiontracker.issue" meta_type="Dexterity FTI" />
+ <object name="sinar.corruptiontracker.person" meta_type="Dexterity FTI" />
</object>
View
2 src/sinar/corruptiontracker/profiles/default/types/sinar.corruptiontracker.issue.xml
@@ -25,6 +25,8 @@
<element value="plone.app.content.interfaces.INameFromTitle" />
<element value="plone.app.dexterity.behaviors.metadata.IDublinCore"
/>
+ <element
+ value="plone.app.dexterity.behaviors.metadata.IRelatedItems" />
</property>
<!-- View information -->

0 comments on commit 1e80a6e

Please sign in to comment.