Skip to content

Commit

Permalink
use new view names in templates, tests and upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
thet committed Feb 26, 2015
1 parent 58d7a77 commit 4f16676
Show file tree
Hide file tree
Showing 14 changed files with 50 additions and 50 deletions.
1 change: 0 additions & 1 deletion plone/app/contenttypes/browser/configure.zcml
Expand Up @@ -240,7 +240,6 @@
permission="zope2.View">
<browser:page name="folder_listing" template="templates/listing.pt"/>
<browser:page name="folder_full_view" template="templates/full_view.pt"/>
<browser:page name="full_view_item" template="templates/full_view_item.pt"/>
<browser:page name="folder_summary_view" template="templates/listing_summary.pt"/>
<browser:page name="folder_tabular_view" template="templates/listing_tabular.pt"/>
<browser:page name="folder_album_view" template="templates/listing_album.pt"/>
Expand Down
4 changes: 2 additions & 2 deletions plone/app/contenttypes/browser/templates/full_view.pt
Expand Up @@ -9,10 +9,10 @@

<metal:content-core fill-slot="content-core">
<metal:block define-macro="content-core">
<metal:listing use-macro="context/@@folder_listing/macros/content-core|context/@@collection_view/macros/content-core">
<metal:listing use-macro="context/@@listing_view/macros/content-core">
<!-- we don't want the dl -->
<metal:entries fill-slot="entries">
<metal:block use-macro="context/@@folder_listing/macros/entries|context/@@collection_view/macros/entries">
<metal:block use-macro="context/@@listing_view/macros/entries">
<metal:entry fill-slot="entry">
<div tal:define="obj item/getObject;" tal:replace="structure obj/@@full_view_item" />
</metal:entry>
Expand Down
6 changes: 3 additions & 3 deletions plone/app/contenttypes/browser/templates/listing_summary.pt
Expand Up @@ -8,10 +8,10 @@
<body>

<metal:content-core fill-slot="content-core">
<metal:block use-macro="context/@@folder_listing/macros/content-core|context/@@standard_view/macros/content-core">
<metal:block use-macro="context/@@listing_view/macros/content-core">

<metal:entries fill-slot="entries">
<metal:block use-macro="context/@@folder_listing/macros/entries|context/@@standard_view/macros/entries">
<metal:block use-macro="context/@@listing_view/macros/entries">
<metal:entry fill-slot="entry">

<div class="tileItem visualIEFloatFix" tal:define="obj item/getObject">
Expand All @@ -35,7 +35,7 @@
</a>
</h2>

<div metal:use-macro="context/@@folder_listing/macros/document_byline|context/@@collection_view/macros/document_byline"></div>
<div metal:use-macro="context/@@listing_view/macros/document_byline"></div>

<p class="tileBody" tal:condition="item_description">
<span class="description" tal:content="item_description">
Expand Down
2 changes: 1 addition & 1 deletion plone/app/contenttypes/migration/migration.py
Expand Up @@ -505,7 +505,7 @@ class FolderMigrator(ATCTFolderMigrator):

def beforeChange_migrate_layout(self):
if self.old.getLayout() == 'atct_album_view':
self.old.setLayout('folder_album_view')
self.old.setLayout('album_view')


def migrate_folders(portal):
Expand Down
20 changes: 10 additions & 10 deletions plone/app/contenttypes/migration/topics.py
Expand Up @@ -444,13 +444,13 @@ class TopicMigrator(InplaceCMFItemMigrator, ReferenceMigrator):
src_meta_type = 'ATTopic'
dst_portal_type = dst_meta_type = 'Collection'
view_methods_mapping = {
'folder_listing': 'standard_view',
'folder_listing': 'listing_view',
'folder_summary_view': 'summary_view',
'folder_full_view': 'all_content',
'folder_full_view': 'full_view',
'folder_tabular_view': 'tabular_view',
'atct_album_view': 'thumbnail_view',
'atct_topic_view': 'standard_view',
}
'atct_album_view': 'album_view',
'atct_topic_view': 'listing_view',
}

@property
def registry(self):
Expand Down Expand Up @@ -556,13 +556,13 @@ class FolderishTopicMigrator(InplaceCMFFolderMigrator, ReferenceMigrator):
src_meta_type = 'ATTopic'
dst_portal_type = dst_meta_type = 'Collection'
view_methods_mapping = {
'folder_listing': 'standard_view',
'folder_listing': 'listing_view',
'folder_summary_view': 'summary_view',
'folder_full_view': 'all_content',
'folder_full_view': 'full_view',
'folder_tabular_view': 'tabular_view',
'atct_album_view': 'thumbnail_view',
'atct_topic_view': 'standard_view',
}
'atct_album_view': 'album_view',
'atct_topic_view': 'listing_view',
}

@property
def registry(self):
Expand Down
6 changes: 3 additions & 3 deletions plone/app/contenttypes/profiles/default/types/Collection.xml
Expand Up @@ -27,14 +27,14 @@
</property>

<!-- View information -->
<property name="default_view">standard_view</property>
<property name="default_view">listing_view</property>
<property name="default_view_fallback">False</property>
<property name="view_methods">
<element value="listing_view"/>
<element value="summary_view"/>
<element value="full_view"/>
<element value="tabular_view"/>
<element value="full_view"/>
<element value="album_view"/>
<element value="listing_view"/>
<element value="event_listing"/>
</property>

Expand Down
6 changes: 3 additions & 3 deletions plone/app/contenttypes/profiles/default/types/Folder.xml
Expand Up @@ -12,13 +12,13 @@
<property name="filter_content_types">False</property>
<property name="allowed_content_types"/>
<property name="allow_discussion">False</property>
<property name="default_view">folder_listing</property>
<property name="default_view">listing_view</property>
<property name="view_methods">
<element value="listing_view"/>
<element value="summary_view"/>
<element value="full_view"/>
<element value="tabular_view"/>
<element value="full_view"/>
<element value="album_view"/>
<element value="listing_view"/>
<element value="event_listing"/>
</property>
<property name="default_view_fallback">False</property>
Expand Down
12 changes: 6 additions & 6 deletions plone/app/contenttypes/tests/robot/test_folderlisting.robot
Expand Up @@ -15,23 +15,23 @@ Test Teardown Close all browsers
Scenario: Test listing views
Given I am logged in as site owner

When I Go to ${PLONE_URL}/${TEST_FOLDER_ID}/folder_listing
When I Go to ${PLONE_URL}/${TEST_FOLDER_ID}/listing_view
Then Listing should list contained content

When I Go to ${PLONE_URL}/${TEST_FOLDER_ID}/folder_summary_view
When I Go to ${PLONE_URL}/${TEST_FOLDER_ID}/summary_view
Then Listing should list contained content

When I Go to ${PLONE_URL}/${TEST_FOLDER_ID}/folder_tabular_view
When I Go to ${PLONE_URL}/${TEST_FOLDER_ID}/tabular_view
Then Listing should list contained content

When I Go to ${PLONE_URL}/${TEST_FOLDER_ID}/folder_full_view
When I Go to ${PLONE_URL}/${TEST_FOLDER_ID}/full_view
Then Listing should list contained content in detail

When I Go to ${PLONE_URL}/${TEST_FOLDER_ID}/test_album/album_view
Then Album should list contained images and albums


When I Go to ${PLONE_URL}/${TEST_FOLDER_ID}/test_collection/collection_view
When I Go to ${PLONE_URL}/${TEST_FOLDER_ID}/test_collection/listing_view
Then Listing should list all content

When I Go to ${PLONE_URL}/${TEST_FOLDER_ID}/test_collection/summary_view
Expand All @@ -40,7 +40,7 @@ Scenario: Test listing views
When I Go to ${PLONE_URL}/${TEST_FOLDER_ID}/test_collection/tabular_view
Then Listing should list all content

When I Go to ${PLONE_URL}/${TEST_FOLDER_ID}/test_collection/all_content
When I Go to ${PLONE_URL}/${TEST_FOLDER_ID}/test_collection/full_view
Then Listing should list all content in detail

When I Go to ${PLONE_URL}/${TEST_FOLDER_ID}/test_collection/album_view
Expand Down
3 changes: 2 additions & 1 deletion plone/app/contenttypes/tests/test_behaviors_collection.py
Expand Up @@ -72,7 +72,8 @@ def _get_browser(self):
)
return browser

def test_collection_view(self):
def test_default_dexterity_view(self):
# Test the default dexterity view
browser = self._get_browser()
browser.open(self.portal_url + '/collectioncontainer/view')
self.assertTrue(
Expand Down
24 changes: 12 additions & 12 deletions plone/app/contenttypes/tests/test_collection.py
Expand Up @@ -145,33 +145,33 @@ def setUp(self):
self.request.set('URL', self.collection.absolute_url())
self.request.set('ACTUAL_URL', self.collection.absolute_url())

def test_view(self):
def test_collection_view(self):
view = self.collection.restrictedTraverse('@@view')
self.assertTrue(view())
self.assertEqual(view.request.response.status, 200)

def test_standard_view(self):
view = self.collection.restrictedTraverse('standard_view')
def test_collection_listing_view(self):
view = self.collection.restrictedTraverse('listing_view')
self.assertTrue(view())
self.assertEqual(view.request.response.status, 200)

def test_summary_view(self):
def test_collection_summary_view(self):
view = self.collection.restrictedTraverse('summary_view')
self.assertTrue(view())
self.assertEqual(view.request.response.status, 200)

def test_all_content(self):
view = self.collection.restrictedTraverse('all_content')
def test_collection_full_view(self):
view = self.collection.restrictedTraverse('full_view')
self.assertTrue(view())
self.assertEqual(view.request.response.status, 200)

def test_tabular_view(self):
def test_collection_tabular_view(self):
view = self.collection.restrictedTraverse('tabular_view')
self.assertTrue(view())
self.assertEqual(view.request.response.status, 200)

def test_thumbnail_view(self):
view = self.collection.restrictedTraverse('thumbnail_view')
def test_collection_album_view(self):
view = self.collection.restrictedTraverse('album_view')
self.assertTrue(view())
self.assertEqual(view.request.response.status, 200)

Expand Down Expand Up @@ -248,8 +248,8 @@ def test_collection_templates(self):
self.assertTrue("Lorem collection ipsum" in browser.contents)
self.assertTrue("Image example" in browser.contents)

# open all_content template
browser.open('%s/@@all_content' % url)
# open full_view template
browser.open('%s/@@full_view' % url)
self.assertTrue("Lorem collection ipsum" in browser.contents)
self.assertTrue("Image example" in browser.contents)

Expand All @@ -259,7 +259,7 @@ def test_collection_templates(self):
self.assertTrue("Image example" in browser.contents)

# open thumbnail_view template
browser.open('%s/@@thumbnail_view' % url)
browser.open('%s/@@album_view' % url)
self.assertTrue("Lorem collection ipsum" in browser.contents)
self.assertTrue("Image example" in browser.contents)

Expand Down
8 changes: 4 additions & 4 deletions plone/app/contenttypes/tests/test_folder.py
Expand Up @@ -131,21 +131,21 @@ def test_folder_view(self):
self.assertTrue('Document 1' in self.browser.contents)

def test_folder_summary_view(self):
self.browser.open(self.folder_url + '/folder_summary_view')
self.browser.open(self.folder_url + '/summary_view')
self.assertTrue('My Folder' in self.browser.contents)
self.assertTrue('Document 1' in self.browser.contents)

def test_folder_full_view(self):
self.browser.open(self.folder_url + '/folder_full_view')
self.browser.open(self.folder_url + '/full_view')
self.assertTrue('My Folder' in self.browser.contents)
self.assertTrue('Document 1' in self.browser.contents)

def test_folder_tabular_view(self):
self.browser.open(self.folder_url + '/folder_tabular_view')
self.browser.open(self.folder_url + '/tabular_view')
self.assertTrue('My Folder' in self.browser.contents)
self.assertTrue('Document 1' in self.browser.contents)

def test_folder_album_view(self):
self.browser.open(self.folder_url + '/folder_album_view')
self.browser.open(self.folder_url + '/album_view')
self.assertTrue('My Folder' in self.browser.contents)
self.assertTrue('Document 1' in self.browser.contents)
2 changes: 1 addition & 1 deletion plone/app/contenttypes/tests/test_migration.py
Expand Up @@ -924,7 +924,7 @@ def test_folder_is_migrated(self):
dx_folder = self.portal['folder']
self.assertTrue(IFolder.providedBy(dx_folder))
self.assertTrue(at_folder is not dx_folder)
self.assertEqual(dx_folder.getLayout(), 'folder_album_view')
self.assertEqual(dx_folder.getLayout(), 'album_view')

def test_folder_children_are_migrated(self):
from plone.app.contenttypes.migration.migration import FolderMigrator
Expand Down
2 changes: 1 addition & 1 deletion plone/app/contenttypes/tests/test_migration_topic.py
Expand Up @@ -63,7 +63,7 @@ def test_migrate_simple_topic(self):
self.run_migration()
new = ICollection(self.portal.topic)
self.assertEqual(self.portal.topic.portal_type, 'Collection')
self.assertEqual(self.portal.topic.getLayout(), 'standard_view')
self.assertEqual(self.portal.topic.getLayout(), 'listing_view')
self.assertEqual(new.sort_on, None)
self.assertEqual(new.sort_reversed, None)
self.assertEqual(new.limit, 1000)
Expand Down
4 changes: 2 additions & 2 deletions plone/app/contenttypes/upgrades.py
Expand Up @@ -87,7 +87,7 @@ def migrate_to_richtext(context):


def migrate_album_view(context):
"""Migrate atct_album_view to folder_album_view."""
"""Migrate atct_album_view to album_view."""

# TODO: Don't reload the profile. Only change the settings.
context.runImportStepFromProfile(
Expand All @@ -100,7 +100,7 @@ def migrate_album_view(context):
obj = brain.getObject()
current = context.getLayout()
if current == 'atct_album_view':
obj.setLayout('folder_album_view')
obj.setLayout('album_view')


# def enable_shortname_behavior(context):
Expand Down

0 comments on commit 4f16676

Please sign in to comment.