<commit_before># Copyright (c) 2007-2011 gocept gmbh & co. kg
# See also LICENSE.txt

from zeit.cms.i18n import MessageFactory as _
import zeit.cms.browser.menu


class EditContentsMenuItem(zeit.cms.browser.menu.ContextViewsMenu):

    sort = -1
    viewURL = "@@edit.html"
    title = _("Edit contents")
    activeCSS = 'edit_contents selected'
    inActiveCSS = 'edit_contents'

    @property
    def selected(self):
        selected = self.request.getURL().endswith('@@edit.html')
        return selected<commit_msg>Fixes #11930: Show edit menu item only inside workingcopy<commit_after># Copyright (c) 2007-2011 gocept gmbh & co. kg
# See also LICENSE.txt

from zeit.cms.i18n import MessageFactory as _
from zeit.cms.repository.interfaces import IRepositoryContent
import zeit.cms.browser.menu


class EditContentsMenuItem(zeit.cms.browser.menu.ContextViewsMenu):

    sort = -1
    viewURL = "@@edit.html"
    title = _("Edit contents")
    activeCSS = 'edit_contents selected'
    inActiveCSS = 'edit_contents'

    @property
    def selected(self):
        selected = self.request.getURL().endswith('@@edit.html')
        return selected

    def render(self):
        if IRepositoryContent.providedBy(self.context):
            return ''
        return super(EditContentsMenuItem, self).render()
{'fraction_non_alphanumeric': 0.10667689946277821, 'fraction_numerical': 0.02072141212586339, 'mean_word_length': 3.5121107266435985, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '791729', 'n_tokens_mistral': 421, 'n_tokens_neox': 384, 'n_words': 97}