Skip to content
This repository has been archived by the owner on Oct 24, 2018. It is now read-only.

Commit

Permalink
icon -> fa_icon
Browse files Browse the repository at this point in the history
  • Loading branch information
inkhey committed Jun 12, 2018
1 parent aa0accc commit 61dbfe7
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 43 deletions.
4 changes: 2 additions & 2 deletions tracim/lib/webdav/design.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def designPage(content: data.Content, content_revision: data.ContentRevisionRO)
<td>%s</td>
</tr>
''' % ('warning' if event.id == content_revision.revision_id else '',
event.type.icon,
event.type.fa_icon,
label,
date,
event.owner.display_name,
Expand Down Expand Up @@ -282,7 +282,7 @@ def designThread(content: data.Content, content_revision: data.ContentRevisionRO
</div>
</div>
''' % ('warning' if t.id == content_revision.revision_id else '',
t.type.icon,
t.type.fa_icon,
t.owner.display_name,
t.create_readable_date(),
label,
Expand Down
14 changes: 7 additions & 7 deletions tracim/models/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ def __init__(
self,
label: str,
slug: str,
icon: str,
fa_icon: str,
hexcolor: str,
is_active: bool,
config: typing.Dict[str, str],
main_route: str,
) -> None:
self.label = label
self.slug = slug
self.icon = icon
self.fa_icon = fa_icon
self.hexcolor = hexcolor
self.is_active = is_active
self.config = config
Expand All @@ -29,7 +29,7 @@ def __init__(
calendar = Application(
label='Calendar',
slug='calendar',
icon='calendar-alt',
fa_icon='calendar-alt',
hexcolor='#757575',
is_active=True,
config={},
Expand All @@ -39,7 +39,7 @@ def __init__(
thread = Application(
label='Threads',
slug='contents/threads',
icon='comments-o',
fa_icon='comments-o',
hexcolor='#ad4cf9',
is_active=True,
config={},
Expand All @@ -50,7 +50,7 @@ def __init__(
_file = Application(
label='Files',
slug='contents/files',
icon='paperclip',
fa_icon='paperclip',
hexcolor='#FF9900',
is_active=True,
config={},
Expand All @@ -60,7 +60,7 @@ def __init__(
markdownpluspage = Application(
label='Markdown Plus Documents', # TODO - G.M - 24-05-2018 - Check label
slug='contents/markdownpluspage',
icon='file-code',
fa_icon='file-code',
hexcolor='#f12d2d',
is_active=True,
config={},
Expand All @@ -70,7 +70,7 @@ def __init__(
htmlpage = Application(
label='Text Documents', # TODO - G.M - 24-05-2018 - Check label
slug='contents/htmlpage',
icon='file-text-o',
fa_icon='file-text-o',
hexcolor='#3f52e3',
is_active=True,
config={},
Expand Down
17 changes: 9 additions & 8 deletions tracim/models/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class UserRoleInWorkspace(DeclarativeBase):
#
#
# @property
# def icon(self):
# def fa_icon(self):
# return UserRoleInWorkspace.ICON[self.role]
#
# @property
Expand Down Expand Up @@ -200,7 +200,7 @@ class RoleType(object):
def __init__(self, role_id):
self.role_type_id = role_id
# TODO - G.M - 10-04-2018 - [Cleanup] Drop this
# self.icon = UserRoleInWorkspace.ICON[role_id]
# self.fa_icon = UserRoleInWorkspace.ICON[role_id]
# self.role_label = UserRoleInWorkspace.LABEL[role_id]
# self.css_style = UserRoleInWorkspace.STYLE[role_id]

Expand Down Expand Up @@ -265,11 +265,12 @@ class ActionDescription(object):
def __init__(self, id):
assert id in ActionDescription.allowed_values()
self.id = id
# FIXME - G.M - 17-04-2018 - Label and icon needed for webdav
# FIXME - G.M - 17-04-2018 - Label and fa_icon needed for webdav
# design template,
# find a way to not rely on this.
self.label = self.id
self.icon = ActionDescription._ICONS[id]
self.fa_icon = ActionDescription._ICONS[id]
#self.icon = self.fa_icon
# TODO - G.M - 10-04-2018 - [Cleanup] Drop this
# self.label = ActionDescription._LABELS[id]

Expand Down Expand Up @@ -343,7 +344,7 @@ def __init__(self,
self.id = id
self.label = self.id
# TODO - G.M - 10-04-2018 - [Cleanup] Drop this
# self.icon = ContentStatus._ICONS[id]
# self.fa_icon = ContentStatus._ICONS[id]
# self.css = ContentStatus._CSS[id]
#
# if type==ContentType.Thread:
Expand Down Expand Up @@ -520,7 +521,7 @@ def type(self):
def __init__(self, type):
self.id = type
# TODO - G.M - 10-04-2018 - [Cleanup] Drop this
# self.icon = ContentType._CSS_ICONS[type]
# self.fa_icon = ContentType._CSS_ICONS[type]
# self.color = ContentType._CSS_COLORS[type] # deprecated
# self.css = ContentType._CSS_COLORS[type]
# self.label = ContentType._LABEL[type]
Expand All @@ -530,7 +531,7 @@ def toDict(self):
return dict(id=self.type,
type=self.type,
# TODO - G.M - 10-04-2018 - [Cleanup] Drop this
# icon=self.icon,
# fa_icon=self.fa_icon,
# color=self.color,
# label=self.label,
priority=self.priority)
Expand Down Expand Up @@ -1457,7 +1458,7 @@ def __init__(self, id, created, owner, type, label, content, ref_object):
assert hasattr(type, 'id')
# TODO - G.M - 10-04-2018 - [Cleanup] Drop this
# assert hasattr(type, 'css')
# assert hasattr(type, 'icon')
# assert hasattr(type, 'fa_icon')
# assert hasattr(type, 'label')

def created_as_delta(self, delta_from_datetime:datetime=None):
Expand Down
10 changes: 5 additions & 5 deletions tracim/models/workspace_menu_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,29 @@ def __init__(
self,
label: str,
slug: str,
icon: str,
fa_icon: str,
hexcolor: str,
route: str,
) -> None:
self.slug = slug
self.label = label
self.route = route
self.hexcolor = hexcolor
self.icon = icon
self.fa_icon = fa_icon

dashboard_menu_entry = WorkspaceMenuEntry(
slug='dashboard',
label='Dashboard',
route='/#/workspaces/{workspace_id}/dashboard',
hexcolor='#252525',
icon="",
fa_icon="",
)
all_content_menu_entry = WorkspaceMenuEntry(
slug="contents/all",
label="All Contents",
route="/#/workspaces/{workspace_id}/contents",
hexcolor="#fdfdfd",
icon="",
fa_icon="",
)

# TODO - G.M - 08-06-2018 - This is hardcoded default menu entry,
Expand All @@ -57,7 +57,7 @@ def default_workspace_menu_entry(
slug=app.slug,
label=app.label,
hexcolor=app.hexcolor,
icon=app.icon,
fa_icon=app.fa_icon,
route=app.main_route
)
menu_entries.append(new_entry)
Expand Down
10 changes: 5 additions & 5 deletions tracim/tests/functional/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,35 +26,35 @@ def test_api__get_applications__ok_200__nominal_case(self):
application = res[0]
assert application['label'] == "Text Documents"
assert application['slug'] == 'contents/htmlpage'
assert application['icon'] == 'file-text-o'
assert application['fa_icon'] == 'file-text-o'
assert application['hexcolor'] == '#3f52e3'
assert application['is_active'] is True
assert 'config' in application
application = res[1]
assert application['label'] == "Markdown Plus Documents"
assert application['slug'] == 'contents/markdownpluspage'
assert application['icon'] == 'file-code'
assert application['fa_icon'] == 'file-code'
assert application['hexcolor'] == '#f12d2d'
assert application['is_active'] is True
assert 'config' in application
application = res[2]
assert application['label'] == "Files"
assert application['slug'] == 'contents/files'
assert application['icon'] == 'paperclip'
assert application['fa_icon'] == 'paperclip'
assert application['hexcolor'] == '#FF9900'
assert application['is_active'] is True
assert 'config' in application
application = res[3]
assert application['label'] == "Threads"
assert application['slug'] == 'contents/threads'
assert application['icon'] == 'comments-o'
assert application['fa_icon'] == 'comments-o'
assert application['hexcolor'] == '#ad4cf9'
assert application['is_active'] is True
assert 'config' in application
application = res[4]
assert application['label'] == "Calendar"
assert application['slug'] == 'calendar'
assert application['icon'] == 'calendar-alt'
assert application['fa_icon'] == 'calendar-alt'
assert application['hexcolor'] == '#757575'
assert application['is_active'] is True
assert 'config' in application
Expand Down
14 changes: 7 additions & 7 deletions tracim/tests/functional/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,49 +37,49 @@ def test_api__get_user_workspaces__ok_200__nominal_case(self):
assert sidebar_entry['label'] == 'Dashboard'
assert sidebar_entry['route'] == '/#/workspaces/1/dashboard' # nopep8
assert sidebar_entry['hexcolor'] == "#252525"
assert sidebar_entry['icon'] == ""
assert sidebar_entry['fa_icon'] == ""

sidebar_entry = workspace['sidebar_entries'][1]
assert sidebar_entry['slug'] == 'contents/all'
assert sidebar_entry['label'] == 'All Contents'
assert sidebar_entry['route'] == "/#/workspaces/1/contents" # nopep8
assert sidebar_entry['hexcolor'] == "#fdfdfd"
assert sidebar_entry['icon'] == ""
assert sidebar_entry['fa_icon'] == ""

sidebar_entry = workspace['sidebar_entries'][2]
assert sidebar_entry['slug'] == 'contents/htmlpage'
assert sidebar_entry['label'] == 'Text Documents'
assert sidebar_entry['route'] == '/#/workspaces/1/contents?type=htmlpage' # nopep8
assert sidebar_entry['hexcolor'] == "#3f52e3"
assert sidebar_entry['icon'] == "file-text-o"
assert sidebar_entry['fa_icon'] == "file-text-o"

sidebar_entry = workspace['sidebar_entries'][3]
assert sidebar_entry['slug'] == 'contents/markdownpluspage'
assert sidebar_entry['label'] == 'Markdown Plus Documents'
assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=markdownpluspage" # nopep8
assert sidebar_entry['hexcolor'] == "#f12d2d"
assert sidebar_entry['icon'] == "file-code"
assert sidebar_entry['fa_icon'] == "file-code"

sidebar_entry = workspace['sidebar_entries'][4]
assert sidebar_entry['slug'] == 'contents/files'
assert sidebar_entry['label'] == 'Files'
assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=file" # nopep8
assert sidebar_entry['hexcolor'] == "#FF9900"
assert sidebar_entry['icon'] == "paperclip"
assert sidebar_entry['fa_icon'] == "paperclip"

sidebar_entry = workspace['sidebar_entries'][5]
assert sidebar_entry['slug'] == 'contents/threads'
assert sidebar_entry['label'] == 'Threads'
assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=thread" # nopep8
assert sidebar_entry['hexcolor'] == "#ad4cf9"
assert sidebar_entry['icon'] == "comments-o"
assert sidebar_entry['fa_icon'] == "comments-o"

sidebar_entry = workspace['sidebar_entries'][6]
assert sidebar_entry['slug'] == 'calendar'
assert sidebar_entry['label'] == 'Calendar'
assert sidebar_entry['route'] == "/#/workspaces/1/calendar" # nopep8
assert sidebar_entry['hexcolor'] == "#757575"
assert sidebar_entry['icon'] == "calendar-alt"
assert sidebar_entry['fa_icon'] == "calendar-alt"

def test_api__get_user_workspaces__err_403__unallowed_user(self):
"""
Expand Down
14 changes: 7 additions & 7 deletions tracim/tests/functional/test_workspaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,49 +38,49 @@ def test_api__get_workspace__ok_200__nominal_case(self) -> None:
assert sidebar_entry['label'] == 'Dashboard'
assert sidebar_entry['route'] == '/#/workspaces/1/dashboard' # nopep8
assert sidebar_entry['hexcolor'] == "#252525"
assert sidebar_entry['icon'] == ""
assert sidebar_entry['fa_icon'] == ""

sidebar_entry = workspace['sidebar_entries'][1]
assert sidebar_entry['slug'] == 'contents/all'
assert sidebar_entry['label'] == 'All Contents'
assert sidebar_entry['route'] == "/#/workspaces/1/contents" # nopep8
assert sidebar_entry['hexcolor'] == "#fdfdfd"
assert sidebar_entry['icon'] == ""
assert sidebar_entry['fa_icon'] == ""

sidebar_entry = workspace['sidebar_entries'][2]
assert sidebar_entry['slug'] == 'contents/htmlpage'
assert sidebar_entry['label'] == 'Text Documents'
assert sidebar_entry['route'] == '/#/workspaces/1/contents?type=htmlpage' # nopep8
assert sidebar_entry['hexcolor'] == "#3f52e3"
assert sidebar_entry['icon'] == "file-text-o"
assert sidebar_entry['fa_icon'] == "file-text-o"

sidebar_entry = workspace['sidebar_entries'][3]
assert sidebar_entry['slug'] == 'contents/markdownpluspage'
assert sidebar_entry['label'] == 'Markdown Plus Documents'
assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=markdownpluspage" # nopep8
assert sidebar_entry['hexcolor'] == "#f12d2d"
assert sidebar_entry['icon'] == "file-code"
assert sidebar_entry['fa_icon'] == "file-code"

sidebar_entry = workspace['sidebar_entries'][4]
assert sidebar_entry['slug'] == 'contents/files'
assert sidebar_entry['label'] == 'Files'
assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=file" # nopep8
assert sidebar_entry['hexcolor'] == "#FF9900"
assert sidebar_entry['icon'] == "paperclip"
assert sidebar_entry['fa_icon'] == "paperclip"

sidebar_entry = workspace['sidebar_entries'][5]
assert sidebar_entry['slug'] == 'contents/threads'
assert sidebar_entry['label'] == 'Threads'
assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=thread" # nopep8
assert sidebar_entry['hexcolor'] == "#ad4cf9"
assert sidebar_entry['icon'] == "comments-o"
assert sidebar_entry['fa_icon'] == "comments-o"

sidebar_entry = workspace['sidebar_entries'][6]
assert sidebar_entry['slug'] == 'calendar'
assert sidebar_entry['label'] == 'Calendar'
assert sidebar_entry['route'] == "/#/workspaces/1/calendar" # nopep8
assert sidebar_entry['hexcolor'] == "#757575"
assert sidebar_entry['icon'] == "calendar-alt"
assert sidebar_entry['fa_icon'] == "calendar-alt"

def test_api__get_workspace__err_403__unallowed_user(self) -> None:
"""
Expand Down
4 changes: 2 additions & 2 deletions tracim/views/core_api/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class WorkspaceMenuEntrySchema(marshmallow.Schema):
label = marshmallow.fields.String()
route = marshmallow.fields.String()
hexcolor = marshmallow.fields.String()
icon = marshmallow.fields.String()
fa_icon = marshmallow.fields.String()


class WorkspaceDigestSchema(marshmallow.Schema):
Expand Down Expand Up @@ -101,7 +101,7 @@ class ApplicationConfigSchema(marshmallow.Schema):
class ApplicationSchema(marshmallow.Schema):
label = marshmallow.fields.String()
slug = marshmallow.fields.String()
icon = marshmallow.fields.String()
fa_icon = marshmallow.fields.String()
hexcolor = marshmallow.fields.String()
is_active = marshmallow.fields.Boolean()
config = marshmallow.fields.Nested(
Expand Down

0 comments on commit 61dbfe7

Please sign in to comment.