<commit_before>==========
Centerpage
==========

>>> import z3c.etestbrowser.testing
>>> browser = z3c.etestbrowser.testing.ExtendedTestBrowser()
>>> browser.xml_strict = True
>>> browser.addHeader('Authorization', 'Basic user:userpw')
>>> browser.open('http://localhost/++skin++cms/repository/online/2007/01')

>>> menu = browser.getControl(name='add_menu')
>>> menu.displayValue = ['CenterPage']
>>> browser.open(menu.value[0])

>>> browser.getControl('File name').value = 'island'
>>> browser.getControl('Title').value = 'Auf den Spuren der Elfen'
>>> browser.getControl('Ressort').displayValue = ['Reisen']
>>> browser.getControl('Daily newsletter').selected = True
>>> browser.getControl(name='form.authors.0.').value = '<NAME>'
>>> browser.getControl('CP type').displayOptions
['Archiv-Print-Volume', 'Archiv-Print-Year', 'Centerpage', 'Homepage', 'Themenseite']
>>> browser.getControl('CP type').displayValue = ['Themenseite']
>>> browser.getControl('Header image').value = 'http://xml.zeit.de/2006/DSC00109_2.JPG'
>>> browser.getControl('CAP title').value = 'cap cap cap'
>>> browser.getControl(name="form.actions.add").click()

>>> browser.url
'http://localhost/++skin++cms/workingcopy/zope.user/island/@@view.html'
>>> print browser.contents
<?xml...
<!DOCTYPE...
...Title...Auf den Spuren der Elfen...
...CAP title...cap cap cap...
...CP type...Themenseite...
...Header image...DSC00109_2.JPG...

There is an asset tab:

>>> browser.getLink('Edit assets').click()
>>> print browser.title.strip()
Auf den Spuren der Elfen – Edit assets

We can edit the metadata on the edit tab:

>>> browser.getLink('Edit metadata').click()
>>> browser.getControl('Title').value
'Auf den Spuren der Elfen'

The view is only available after checkin:

>>> browser.getLink('View metadata')
Traceback (most recent call last):
    ...
LinkNotFoundError

>>> browser.getLink('Checkin').click()
>>> print browser.contents
<...
...Title...Auf den Spuren der Elfen...
...CP type...Themenseite...
...Header image...DSC00109_2.JPG...
>>> browser.getLink('View metadata').click()
>>> print browser.title.strip()
Auf den Spuren der Elfen – View centerpage metadata


Editor
======

The center page editor requires a lot of javascript, so we're only checking a
few views here.

Check the CP out again, and go to the edit view:

>>> browser.getLink('Checkout').click()
>>> browser.getLink('Edit contents').click()
>>> print browser.title.strip()
Auf den Spuren der Elfen – Edit


The inital page doens't contain much:

>>> print browser.contents
<?xml ...
 <div id="content">
     <div id="cp-content">
       <div id="cp-content-inner">
       </div>
     </div>
     <div id="cp-forms">
     </div>
     ...
 </div>
 ...


The contents of cp-content is loaded via javascript:

>>> browser.open('contents')
>>> contents_url = browser.url
>>> print browser.contents
<...
  <div ...class="...editable-area..."...id="lead"...
  <div ...class="...editable-area..."...id="informatives"...
  <div ...class="...editable-region..."...id="teaser-mosaic"...

Blocks are added via drag and drop from the block library. The library is
explained in detail in library.txt.


Sorting
+++++++

Blocks can be sorted. There is an ``updateOrder`` view doing this.

>>> browser.open(contents_url)
>>> browser.getLink('Add area', index=3).click()
>>> browser.open(contents_url)
>>> browser.getLink('Add area', index=3).click()
>>> browser.open(contents_url)
>>> bar_divs = browser.etree.xpath(
...     '//div[@id="teaser-mosaic"]//div[contains(@class, "type-area")]')
>>> bar_ids = original_ids = [bar.get('id') for bar in bar_divs]
>>> bar_ids<commit_msg>Re VIV-611: Fix doctest to expect new css classes (belongs to commit:4c161e605656)<commit_after>==========
Centerpage
==========

>>> import z3c.etestbrowser.testing
>>> browser = z3c.etestbrowser.testing.ExtendedTestBrowser()
>>> browser.xml_strict = True
>>> browser.addHeader('Authorization', 'Basic user:userpw')
>>> browser.open('http://localhost/++skin++cms/repository/online/2007/01')

>>> menu = browser.getControl(name='add_menu')
>>> menu.displayValue = ['CenterPage']
>>> browser.open(menu.value[0])

>>> browser.getControl('File name').value = 'island'
>>> browser.getControl('Title').value = 'Auf den Spuren der Elfen'
>>> browser.getControl('Ressort').displayValue = ['Reisen']
>>> browser.getControl('Daily newsletter').selected = True
>>> browser.getControl(name='form.authors.0.').value = '<NAME>'
>>> browser.getControl('CP type').displayOptions
['Archiv-Print-Volume', 'Archiv-Print-Year', 'Centerpage', 'Homepage', 'Themenseite']
>>> browser.getControl('CP type').displayValue = ['Themenseite']
>>> browser.getControl('Header image').value = 'http://xml.zeit.de/2006/DSC00109_2.JPG'
>>> browser.getControl('CAP title').value = 'cap cap cap'
>>> browser.getControl(name="form.actions.add").click()

>>> browser.url
'http://localhost/++skin++cms/workingcopy/zope.user/island/@@view.html'
>>> print browser.contents
<?xml...
<!DOCTYPE...
...Title...Auf den Spuren der Elfen...
...CAP title...cap cap cap...
...CP type...Themenseite...
...Header image...DSC00109_2.JPG...

There is an asset tab:

>>> browser.getLink('Edit assets').click()
>>> print browser.title.strip()
Auf den Spuren der Elfen – Edit assets

We can edit the metadata on the edit tab:

>>> browser.getLink('Edit metadata').click()
>>> browser.getControl('Title').value
'Auf den Spuren der Elfen'

The view is only available after checkin:

>>> browser.getLink('View metadata')
Traceback (most recent call last):
    ...
LinkNotFoundError

>>> browser.getLink('Checkin').click()
>>> print browser.contents
<...
...Title...Auf den Spuren der Elfen...
...CP type...Themenseite...
...Header image...DSC00109_2.JPG...
>>> browser.getLink('View metadata').click()
>>> print browser.title.strip()
Auf den Spuren der Elfen – View centerpage metadata


Editor
======

The center page editor requires a lot of javascript, so we're only checking a
few views here.

Check the CP out again, and go to the edit view:

>>> browser.getLink('Checkout').click()
>>> browser.getLink('Edit contents').click()
>>> print browser.title.strip()
Auf den Spuren der Elfen – Edit


The inital page doens't contain much:

>>> print browser.contents
<?xml ...
 <div id="content">
     <div id="cp-content">
       <div id="cp-content-inner">
       </div>
     </div>
     <div id="cp-forms">
     </div>
     ...
 </div>
 ...


The contents of cp-content is loaded via javascript:

>>> browser.open('contents')
>>> contents_url = browser.url
>>> print browser.contents
<...
  <div ...class="...editable-area..."...id="lead"...
  <div ...class="...editable-area..."...id="informatives"...
  <div ...class="...editable-area..."...id="teaser-mosaic"...

Blocks are added via drag and drop from the block library. The library is
explained in detail in library.txt.


Sorting
+++++++

Blocks can be sorted. There is an ``updateOrder`` view doing this.

>>> browser.open(contents_url)
>>> browser.getLink('Add area', index=3).click()
>>> browser.open(contents_url)
>>> browser.getLink('Add area', index=3).click()
>>> browser.open(contents_url)
>>> bar_divs = browser.etree.xpath(
...     '//div[@id="teaser-mosaic"]//div[contains(@class, "type-area")]')
>>> bar_ids = original_ids = [bar.get('id') for bar in bar_divs]
>>> bar_ids
{'fraction_non_alphanumeric': 0.2059750582431136, 'fraction_numerical': 0.011100452240646841, 'mean_word_length': 4.209136331192005, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 285, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1674322', 'n_tokens_mistral': 2384, 'n_tokens_neox': 2283, 'n_words': 566}