From d460ce328c091902e2ce705092baeeddb7aecfe8 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 13 Jun 2019 09:54:59 -0400 Subject: [PATCH] refactor: theme changes for buildAvatar (nodebb/nodebb#7681) * fix: using new avatar helper * fix: using helper in flag details page * feat: using new avatar helper * fix: more changes to use buildAvatar * fix: bump nbbpm.compatibility to exclude 1.12.x --- less/account.less | 4 --- less/category.less | 11 +++--- less/topic.less | 6 ++-- less/users.less | 12 ++----- package.json | 2 +- templates/account/info.tpl | 22 +++--------- templates/flags/detail.tpl | 38 +++------------------ templates/flags/list.tpl | 6 +--- templates/groups/details.tpl | 12 ++----- templates/partials/categories/lastpost.tpl | 8 +---- templates/partials/chats/message.tpl | 8 +---- templates/partials/chats/user.tpl | 8 +---- templates/partials/groups/list.tpl | 8 +---- templates/partials/groups/memberlist.tpl | 8 +---- templates/partials/menu.tpl | 6 +--- templates/partials/modals/votes_modal.tpl | 16 ++------- templates/partials/posts_list.tpl | 8 +---- templates/partials/quick-search-results.tpl | 34 ++++++++---------- templates/partials/slideout-menu.tpl | 6 +--- templates/partials/topic/post.tpl | 13 ++----- templates/partials/topic/quickreply.tpl | 6 +--- templates/partials/topics_list.tpl | 20 ++--------- templates/partials/users_list.tpl | 8 +---- templates/search.tpl | 8 +---- templates/users.tpl | 2 +- 25 files changed, 59 insertions(+), 221 deletions(-) diff --git a/less/account.less b/less/account.less index 92460d7..45b119c 100644 --- a/less/account.less +++ b/less/account.less @@ -398,10 +398,6 @@ margin-bottom: 1rem; } - .timestamp { - font-weight: bold; - } - .expiry { font-size: 1.25rem; font-style: italic; diff --git a/less/category.less b/less/category.less index cf6767b..6b86ab0 100644 --- a/less/category.less +++ b/less/category.less @@ -39,13 +39,14 @@ } .fa-check { - padding: 14px; + padding: 14.5px; /* 14.5*2 + 15 + 2px border = 46px */ border-radius: 50%; position: absolute; font-size: 15px; opacity: 0; top: 0px; left: 0px; + border: 1px solid transparent; &:before { .pointer; @@ -56,11 +57,11 @@ } } - .user-img, .user-icon { + .avatar { opacity: 1; } - .fa-check, .user-img, .user-icon { + .fa-check, .avatar { .transition(.2s ease-in-out all); } @@ -68,7 +69,7 @@ } .avatar .select:hover { - .user-img, .user-icon { + .avatar { opacity: 0; } @@ -80,7 +81,7 @@ } &.selected { - .select .user-img, .select .user-icon { + .select .avatar { opacity: 0; } diff --git a/less/topic.less b/less/topic.less index 862cbc0..5a170ca 100644 --- a/less/topic.less +++ b/less/topic.less @@ -86,9 +86,8 @@ } } - img, .user-icon { + .avatar { margin-right: 15px; - .user-icon-style(46px, 2.4rem, 50%); } } @@ -349,9 +348,8 @@ } } - img, .user-icon { + .avatar { margin-right: 15px; - .user-icon-style(46px, 2.4rem, 50%); } } diff --git a/less/users.less b/less/users.less index 37a59ed..e105e56 100644 --- a/less/users.less +++ b/less/users.less @@ -43,10 +43,6 @@ vertical-align: top; width: 104px; - img, .user-icon { - .user-icon-style(80px, 4rem, 50%); - } - a { max-width: 94px; text-overflow: ellipsis; @@ -70,10 +66,8 @@ vertical-align: middle; } - .anon-user { - .user-icon { - background: @gray-lighter; - color: white; - } + .anon-user .avatar { + background: @gray-lighter; + color: white; } } \ No newline at end of file diff --git a/package.json b/package.json index 4a473cd..6a0c3ce 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "nodebb-theme-persona", "version": "9.1.38", "nbbpm": { - "compatibility": "^1.12.0" + "compatibility": "^1.13.0" }, "description": "Persona theme for NodeBB", "main": "theme.less", diff --git a/templates/account/info.tpl b/templates/account/info.tpl index 3094b20..0b1a9de 100644 --- a/templates/account/info.tpl +++ b/templates/account/info.tpl @@ -122,13 +122,10 @@
  • - - - - - {history.bans.user.icon:text} - - + {buildAvatar(history.bans.user, "sm", true)} + + + — {../timestampReadable}
    [[user:info.banned-until, {../untilReadable}]]
    @@ -160,17 +157,8 @@


    - -
    + {buildAvatar(moderationNotes.user, "sm", true)} diff --git a/templates/flags/detail.tpl b/templates/flags/detail.tpl index 2cbc77c..88a6500 100644 --- a/templates/flags/detail.tpl +++ b/templates/flags/detail.tpl @@ -16,13 +16,7 @@

    {target.user.username}

    @@ -34,13 +28,7 @@

    {target.username}

    @@ -65,11 +53,7 @@
    - - {reporter.username} - -
    {reporter.icon:text}
    - + {buildAvatar(reporter, "sm", false, "media-object")} {reporter.username}
    @@ -122,13 +106,7 @@

    @@ -171,13 +149,7 @@

    diff --git a/templates/flags/list.tpl b/templates/flags/list.tpl index 05e340e..2cc7338 100644 --- a/templates/flags/list.tpl +++ b/templates/flags/list.tpl @@ -51,11 +51,7 @@ - - - -
    {../reporter.icon:text}
    - + {buildAvatar(../reporter, "sm")} {../reporter.username} diff --git a/templates/groups/details.tpl b/templates/groups/details.tpl index 2b1c9e7..85ee201 100644 --- a/templates/groups/details.tpl +++ b/templates/groups/details.tpl @@ -73,11 +73,7 @@ - - - -
    {group.pending.icon:text}
    - + {buildAvatar(group.pending, "sm", true)} {group.pending.username} @@ -125,11 +121,7 @@ - - - -
    {group.invited.icon:text}
    - + {buildAvatar(group.invited, "sm", true)} {group.invited.username} diff --git a/templates/partials/categories/lastpost.tpl b/templates/partials/categories/lastpost.tpl index 3becf19..764e63f 100644 --- a/templates/partials/categories/lastpost.tpl +++ b/templates/partials/categories/lastpost.tpl @@ -3,13 +3,7 @@

    - - - {../user.username} - - {../user.icon:text} - - + {buildAvatar(posts.user, "sm", true)} diff --git a/templates/partials/chats/message.tpl b/templates/partials/chats/message.tpl index 369f6ba..cd4832d 100644 --- a/templates/partials/chats/message.tpl +++ b/templates/partials/chats/message.tpl @@ -1,12 +1,6 @@

  • - - - - -
    {messages.fromUser.icon:text}
    - -
    + {buildAvatar(messages.fromUser, "md", true, "not-responsive")} {messages.fromUser.username} [[user:banned]] diff --git a/templates/partials/chats/user.tpl b/templates/partials/chats/user.tpl index 851f3c6..9c7ccaf 100644 --- a/templates/partials/chats/user.tpl +++ b/templates/partials/chats/user.tpl @@ -1,7 +1 @@ - - - - -
    {rooms.users.icon:text}
    - -
    \ No newline at end of file +{buildAvatar(rooms.users, "sm", true)} \ No newline at end of file diff --git a/templates/partials/groups/list.tpl b/templates/partials/groups/list.tpl index 669405d..3397350 100644 --- a/templates/partials/groups/list.tpl +++ b/templates/partials/groups/list.tpl @@ -8,13 +8,7 @@