Skip to content

Commit

Permalink
Remove ionicons, Update icons, add basic copysupport styles
Browse files Browse the repository at this point in the history
  • Loading branch information
rnixx committed May 25, 2024
1 parent 9d7da5b commit b9b27e4
Show file tree
Hide file tree
Showing 20 changed files with 62 additions and 3,169 deletions.
19 changes: 14 additions & 5 deletions examples/cone.example/src/cone/example/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from node.behaviors import DictStorage
from node.behaviors import MappingAdopt
from node.behaviors import MappingNode
from node.behaviors import MappingOrder
from node.behaviors import NodeInit
from node.behaviors import OdictStorage
from node.utils import instance_property
Expand Down Expand Up @@ -75,6 +76,7 @@ class Translation:
Attributes,
NodeInit,
MappingNode,
MappingOrder,
OdictStorage)
class PublicationWorkflowNode:
workflow_name = 'publication'
Expand All @@ -83,15 +85,16 @@ class PublicationWorkflowNode:
(Allow, 'system.Authenticated', ['view']),
(Allow, 'role:viewer', ['view', 'list']),
(Allow, 'role:editor', [
'view', 'list', 'add', 'edit', 'cut', 'copy', 'paste'
'view', 'list', 'add', 'edit', 'cut', 'copy', 'paste',
'change_order'
]),
(Allow, 'role:admin', [
'view', 'list', 'add', 'edit', 'delete', 'cut', 'copy', 'paste',
'change_state', 'manage_permissions'
'change_order', 'change_state', 'manage_permissions'
]),
(Allow, 'role:manager', [
'view', 'list', 'add', 'edit', 'delete', 'cut', 'copy', 'paste',
'change_state', 'manage_permissions', 'manage'
'change_order', 'change_state', 'manage_permissions', 'manage'
]),
(Allow, Everyone, ['login']),
(Deny, Everyone, ALL_PERMISSIONS),
Expand All @@ -118,6 +121,7 @@ def properties(self):
props.action_add = True
props.action_list = True
props.action_sharing = True
props.action_move = True
return props

@property
Expand All @@ -131,7 +135,7 @@ def metadata(self):
@node_info(
name='entry_folder',
title=_('folder', default='Folder'),
icon='bi bi-folder',
icon='bi-folder',
addables=['folder'])
class EntryFolder(BaseContainer):

Expand All @@ -140,12 +144,17 @@ def __init__(self, name=None, parent=None):
title = self.attrs['title'] = Translation()
title['en'] = f'Folder {name[name.rfind("_") + 1:]}'
title['de'] = f'Ordner {name[name.rfind("_") + 1:]}'
for i in range(1, 21):
folder = self[f'folder_{i}'] = Folder()
title = folder.attrs['title'] = Translation()
title['en'] = f'Folder {i}'
title['de'] = f'Ordner {i}'


@node_info(
name='folder',
title=_('folder', default='Folder'),
icon='bi bi-folder',
icon='bi-folder',
addables=['folder'])
class Folder(BaseContainer):

Expand Down
3 changes: 2 additions & 1 deletion examples/cone.example/src/cone/example/publication.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
name="Publication Workflow"
state_attr="state"
initial_state="private"
content_types=".model.EntryFolder"
content_types=".model.EntryFolder
.model.Folder"
permission_checker="cone.app.workflow.permission_checker">

<state name="private"
Expand Down
14 changes: 14 additions & 0 deletions scss/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,20 @@ body {
}
}

/* copysupport */
tr.selectable td {
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}
tr.selectable.selected td {
background-color: #dfeefb;
}
.table-striped > tbody > tr.selectable.selected:nth-child(2n+1) > td {
background-color: #cfdce7;
}

/* responsive changes */
@include media-breakpoint-up(xxl) {
#header-logo {
Expand Down
10 changes: 5 additions & 5 deletions src/cone/app/browser/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def selected(self):
class ActionDelete(LinkAction):
"""Delete action."""
id = 'toolbaraction-delete'
icon = 'ion-trash-a'
icon = 'bi-trash3'
action = 'delete:NONE:NONE'
confirm = _('delete_item_confirm',
default='Do you really want to delete this Item?')
Expand All @@ -450,7 +450,7 @@ def display(self):
class ActionDeleteChildren(LinkAction):
"""Delete children action."""
id = 'toolbaraction-delete-children'
icon = 'ion-trash-a'
icon = 'bi-trash3'
action = 'delete_children:NONE:NONE'
confirm = _('delete_items_confirm',
default='Do you really want to delete selected Items?')
Expand All @@ -470,7 +470,7 @@ def enabled(self):
class ActionCut(LinkAction):
"""Cut children action."""
id = 'toolbaraction-cut'
icon = 'ion-scissors'
icon = 'bi-scissors'
text = _('action_cut', default='Cut')
bind = None

Expand All @@ -485,7 +485,7 @@ def display(self):
class ActionCopy(LinkAction):
"""Copy children action."""
id = 'toolbaraction-copy'
icon = 'ion-ios7-copy-outline'
icon = 'bi-copy'
text = _('action_copy', default='Copy')
bind = None

Expand All @@ -500,7 +500,7 @@ def display(self):
class ActionPaste(LinkAction):
"""Paste children action."""
id = 'toolbaraction-paste'
icon = 'ion-clipboard'
icon = 'bi-clipboard'
text = _('action_paste', default='Paste')
bind = None

Expand Down
2 changes: 1 addition & 1 deletion src/cone/app/browser/contextmenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class ContextMenuActionAdd(ActionAdd):

@context_menu_item(group='contextactions', name='delete')
class ContextMenuActionDelete(ActionDelete):
...
css = 'nav-link'


@tile(name='contextmenu', path='templates/contextmenu.pt', permission='view')
Expand Down
2 changes: 1 addition & 1 deletion src/cone/app/browser/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def __call__(self, factory):
@personal_tools_action(name='logout')
class LogoutAction(LinkAction):
text = _('logout', default='Logout')
icon = 'ion-log-out'
icon = 'bi-door-open'
bind = None
target = None
css = 'dropdown-item'
Expand Down
6 changes: 3 additions & 3 deletions src/cone/app/browser/referencebrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def render(self):
class ActionAddReference(ReferenceAction):
css = 'addreference'
title = _('add_reference', default='Add reference')
icon = 'glyphicon glyphicon-plus-sign'
icon = 'bi-plus-circle'

@property
def enabled(self):
Expand All @@ -158,7 +158,7 @@ def enabled(self):
class ActionRemoveReference(ReferenceAction):
css = 'removereference'
title = _('remove_reference', default='Remove reference')
icon = 'glyphicon glyphicon-minus-sign'
icon = 'bi-minus-circle'

@property
def enabled(self):
Expand Down Expand Up @@ -338,7 +338,7 @@ def reference_trigger_renderer(widget, data):
}
return data.tag(
'span',
tag('i', '', class_='ion-android-share'),
tag('i', '', class_='bi-link'),
_('browse', default='Browse'),
**attrs
)
Expand Down
14 changes: 0 additions & 14 deletions src/cone/app/browser/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,6 @@
# resource='typeahead.css'
# ))

# ionicons
ionicons_resources = wr.ResourceGroup(
name='cone.app-ionicons',
directory=os.path.join(resources_dir, 'ionicons'),
path='ionicons'
)
ionicons_resources.add(wr.StyleResource(
name='ionicons-css',
directory=os.path.join(resources_dir, 'ionicons', 'css'),
path='ionicons/css',
resource='ionicons.css'
))

# cone
cone_resources = wr.ResourceGroup(
name='cone.app-cone',
Expand Down Expand Up @@ -165,7 +152,6 @@ def initialize(cls, config, settings):
config.register_resource(jquery_resources)
config.register_resource(bootstrap_resources)
config.register_resource(typeahead_resources)
config.register_resource(ionicons_resources)
config.register_resource(cone_resources)

def register_resource(self, config, resource):
Expand Down
2 changes: 1 addition & 1 deletion src/cone/app/browser/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(self, model=None, request=None):
@personal_tools_action(name='settings')
class ViewSettingsAction(LinkAction):
text = _('settings', default='Settings')
icon = 'ion-ios7-gear'
icon = 'bi-gear'
event = 'contextchanged:#layout'
path = 'href'

Expand Down
16 changes: 16 additions & 0 deletions src/cone/app/browser/static/cone/cone.app.css
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,22 @@ body {
right: 0;
}

/* copysupport */
tr.selectable td {
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}

tr.selectable.selected td {
background-color: #dfeefb;
}

.table-striped > tbody > tr.selectable.selected:nth-child(2n+1) > td {
background-color: #cfdce7;
}

/* responsive changes */
@media (min-width: 1400px) {
#header-logo {
Expand Down
2 changes: 1 addition & 1 deletion src/cone/app/browser/static/cone/cone.app.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions src/cone/app/browser/static/ionicons/.gitignore

This file was deleted.

1,224 changes: 0 additions & 1,224 deletions src/cone/app/browser/static/ionicons/css/ionicons.css

This file was deleted.

6 changes: 0 additions & 6 deletions src/cone/app/browser/static/ionicons/css/ionicons.min.css

This file was deleted.

Binary file not shown.
Loading

0 comments on commit b9b27e4

Please sign in to comment.