From ce06bc9d681e011c95abcc86958078762aa8feef Mon Sep 17 00:00:00 2001 From: flashwave Date: Thu, 10 Nov 2016 23:32:45 +0100 Subject: [PATCH] getting somewhere --- .../Settings/NotificationsController.php | 24 -- .../assets/less/yuuno/bem/friend-box.less | 34 +++ resources/assets/less/yuuno/bem/input.less | 13 + resources/assets/less/yuuno/bem/settings.less | 61 ++++ .../less/yuuno/bem/sidepanel-table.less | 16 ++ resources/assets/less/yuuno/legacy.less | 265 +----------------- resources/assets/less/yuuno/main.less | 3 + .../assets/typescript/Sakura/Changelog.ts | 9 +- .../views/yuuno/elements/indexPanel.twig | 15 +- resources/views/yuuno/forum/index.twig | 24 +- resources/views/yuuno/manage/master.twig | 8 +- resources/views/yuuno/meta/faq.twig | 8 +- resources/views/yuuno/profile/friends.twig | 12 +- .../views/yuuno/settings/account/details.twig | 6 +- .../views/yuuno/settings/account/profile.twig | 6 +- .../yuuno/settings/account/signature.twig | 10 +- .../yuuno/settings/account/userpage.twig | 10 +- .../yuuno/settings/advanced/deactivate.twig | 4 +- .../yuuno/settings/advanced/sessions.twig | 41 +-- resources/views/yuuno/settings/master.twig | 14 +- .../yuuno/settings/notifications/history.twig | 59 ---- .../yuuno/settings/notifications/master.twig | 3 - resources/views/yuuno/user/profile.twig | 2 +- routes.php | 9 - 24 files changed, 220 insertions(+), 436 deletions(-) delete mode 100644 app/Controllers/Settings/NotificationsController.php create mode 100644 resources/assets/less/yuuno/bem/friend-box.less create mode 100644 resources/assets/less/yuuno/bem/settings.less create mode 100644 resources/assets/less/yuuno/bem/sidepanel-table.less delete mode 100644 resources/views/yuuno/settings/notifications/history.twig delete mode 100644 resources/views/yuuno/settings/notifications/master.twig diff --git a/app/Controllers/Settings/NotificationsController.php b/app/Controllers/Settings/NotificationsController.php deleted file mode 100644 index 4653140..0000000 --- a/app/Controllers/Settings/NotificationsController.php +++ /dev/null @@ -1,24 +0,0 @@ - - */ -class NotificationsController extends Controller -{ - /** - * Get the notification history. - * @return string - */ - public function history() - { - return view('settings/notifications/history'); - } -} diff --git a/resources/assets/less/yuuno/bem/friend-box.less b/resources/assets/less/yuuno/bem/friend-box.less new file mode 100644 index 0000000..81c64ff --- /dev/null +++ b/resources/assets/less/yuuno/bem/friend-box.less @@ -0,0 +1,34 @@ +.friend-box { + display: inline-block; + color: #000; + border: 1px solid #9475B2; + text-align: center; + width: 200px; + margin: 4px 0; + border-radius: 3px; + box-shadow: inset 0 0 1px #9475B2; + background: #E4CFFF; + text-decoration: none !important; + transition: background .2s, box-shadow .2s; + + &:hover { + background: #C2AFFE; + box-shadow: inset 0 0 2px #9475B2; + } + + &:active { + color: inherit; + } + + &__name { + font-size: 1.2em; + line-height: 1.5em; + padding-bottom: 4px; + } + + &__avatar { + width: 150px; + height: 150px; + display: inline-block; + } +} diff --git a/resources/assets/less/yuuno/bem/input.less b/resources/assets/less/yuuno/bem/input.less index 499ec64..e3f98ce 100644 --- a/resources/assets/less/yuuno/bem/input.less +++ b/resources/assets/less/yuuno/bem/input.less @@ -23,6 +23,19 @@ background: linear-gradient(0deg, #A586C3, #D3BFFF); } + &--danger { + background: repeating-linear-gradient(-45deg, #B33, #B33 10px, #B00 10px, #B00 20px); + color: #fff; + border: 1px solid #C00; + box-shadow: 0 0 3px #C00, inset 0 0 3px #C00; + + &:hover, + &:active { + color: #fff !important; + background: repeating-linear-gradient(-45deg, #B00, #B00 10px, #B33 10px, #B33 20px) !important; + } + } + &:hover { color: #306; background: linear-gradient(0deg, #9475B2 30%, #C2AFFE 70%); diff --git a/resources/assets/less/yuuno/bem/settings.less b/resources/assets/less/yuuno/bem/settings.less new file mode 100644 index 0000000..a94d743 --- /dev/null +++ b/resources/assets/less/yuuno/bem/settings.less @@ -0,0 +1,61 @@ +.settings { + &--left { + width: 850px; + } + + &--right { + width: 174px; + text-align: right; + } + + &__navigation { + &-header { + background: #C2AFFE; + padding: 4px; + margin: -1px -2px; + font-weight: 700; + display: block; + font-size: 17px; + } + + &-link { + display: block; + font-size: 14px; + line-height: 25px; + padding: 0 10px; + } + } + + &__explanation { + font-size: 11px; + line-height: 18px; + padding: 7px; + border-bottom: 1px solid #C2AFFE; + margin-bottom: 7px; + } + + &__table { + width: 100%; + border-spacing: 0; + + &-head { + font-size: 17px; + background: #C2AFFE; + padding: 4px; + margin: -1px -2px; + font-weight: 700; + } + + &-column { + border-top: 1px solid #C2AFFE; + } + + &-row { + text-align: center; + + &--current { + background: #B39EED; + } + } + } +} diff --git a/resources/assets/less/yuuno/bem/sidepanel-table.less b/resources/assets/less/yuuno/bem/sidepanel-table.less new file mode 100644 index 0000000..4415a37 --- /dev/null +++ b/resources/assets/less/yuuno/bem/sidepanel-table.less @@ -0,0 +1,16 @@ +.sidepanel-table { + width: 100%; + font-size: .8em; + line-height: 1.5em; + border-spacing: 1px; + + &__head { + background: #9475B2; + color: #306; + } + + &__column { + padding: 0 2px; + text-align: center; + } +} diff --git a/resources/assets/less/yuuno/legacy.less b/resources/assets/less/yuuno/legacy.less index 0035b70..882030c 100644 --- a/resources/assets/less/yuuno/legacy.less +++ b/resources/assets/less/yuuno/legacy.less @@ -1,222 +1,6 @@ -/* - * Friends section - */ -.profile-friends { - text-align: center; -} - -.profile-friends > div:not(:last-child) { - display: inline-block; - border: 1px solid #9475B2; - text-align: center; - width: 200px; - margin: 4px 0; - border-radius: 3px; - box-shadow: inset 0 0 1px #9475B2; - background: #E4CFFF; - transition: background .2s, box-shadow .2s; -} - -.profile-friends > div:not(:last-child):hover { - background: #C2AFFE; - box-shadow: inset 0 0 2px #9475B2; -} - -.profile-friends > div > .friends-list-data { - display: block; -} - -.profile-friends > div > .friends-list-data > .friends-list-name { - font-size: 1.2em; - line-height: 1.5em; - padding-bottom: 4px; -} - -/* - * Panel table - */ -.panelTable { - width: 100%; - font-size: .8em; - line-height: 1.5em; - border-spacing: 1px; -} - -.panelTable th { - background: #9475B2; - color: #306; -} - -.panelTable td:first-child { - padding: 0 2px; - text-align: center; -} - -.panelTable .warning td { - background: #A22; - color: #FFF; -} - -.panelTable .silence td { - background: #A22; - color: #FFF; -} - -.panelTable .restriction td { - background: #822; - color: #FFF; -} - -.panelTable .ban td { - background: #444; - color: #FFF; -} - -.panelTable .abyss td { - background: #888; -} - /* * Settings page styling */ -.settings ul > li { - margin-left: 2em; - list-style: square; -} -.settings .content-left { - width: 850px; -} -.settings .content-right { - width: 174px; - text-align: right; -} -.settings .right-menu-nav > div { - background: #C2AFFE; - padding: 4px; - margin: -1px -2px; - font-weight: 700; - display: block; - font-size: 17px; -} - -.settings .right-menu-nav > a { - display: block; - font-size: 14px; - line-height: 25px; - color: #22E; - text-decoration: none; - padding: 0 10px; -} - -.settings .right-menu-nav > a:hover { - color: #22E; - text-decoration: underline; -} - -.settings .right-menu-nav > a:active { - color: #E22; - text-decoration: underline; -} - -.settings .settings-explanation { - font-size: 11px; - line-height: 18px; - padding: 7px; - border-bottom: 1px solid #C2AFFE; - margin-bottom: 7px; -} - -.settings .settings-table { - width: 100%; - border-spacing: 0; -} - -.settings .settings-table tr > th { - font-size: 17px; - background: #C2AFFE; - padding: 4px; - margin: -1px -2px; - font-weight: 700; -} - -.settings .settings-table tr > td { - text-align: center; -} - -.settings .settings-table > tbody > tr:not(:last-child) > td { - border-bottom: 1px solid #C2AFFE; -} - -.settings .settings-table tr.current-session > td { - background: #B39EED; -} - -.settings .profile-field { - width: 100%; -} - -.settings .profile-save { - text-align: center; - padding: 10px; -} - -.settings .background-frame { - max-width: 600px; - max-height: 400px; - border: 3px solid #EEE; - background: #EEE; - box-shadow: 0 3px 7px #888; - border-radius: 3px; - margin: 5px; -} - -.settings form { - overflow: auto; -} - -.settings .notification-history > a { - border: 1px solid #507; - margin: 5px; - background: rgba(113, 74, 150, .3); - display: block; -} - -.settings .notification-history > a > .notif-hist-icon { - float: left; - width: 80px; - height: 80px; - line-height: 80px; - text-align: center; - background: rgba(0, 0, 0, .5); - display: block; - color: #FFF; -} - -.settings .notification-history > a > .notif-hist-icon > .font-icon { - margin: .34em 0; -} - -.settings .notification-history > a > .notif-hist-content > .notif-hist-time { - font-style: italic; - text-align: right; - float: right; - margin-right: 6px; - font-size: .8em; -} - -.settings .notification-history > a > .notif-hist-content > .notif-hist-inside { - float: left; - margin-left: 2px; - padding-left: 8px; -} - -.settings .notification-history > a > .notif-hist-content > .notif-hist-inside > .notif-hist-title { - font-family: "Open Sans", sans-serif; - font-weight: 300; - font-size: 1.7em; - margin-top: 1em; -} - .settings .friends-list { text-align: center; } @@ -324,7 +108,6 @@ } @media (max-width: 1064px) { - .settings .friends-list > div:not(:last-child) { margin-bottom: 6px; } @@ -333,11 +116,9 @@ margin-bottom: 4px; } - .settings .friends-list > div > .friends-list-actions, - .settings .friends-list > form > .friends-list-actions { + .settings .friends-list .friends-list-actions { display: block; } - } /* @@ -376,7 +157,6 @@ } @media (min-width: 1064px) { - .support .featureBox.final { width: 818px; } @@ -384,11 +164,9 @@ .support .featureBox.final .featureBoxDesc { font-size: 1.3em; } - } @media (max-width: 840px) { - .support .featureBox, .support .featureBox.final { width: 380px; @@ -401,7 +179,6 @@ .support .featureBox .right { display: none; } - } .support .featureBoxIcon.right { @@ -437,46 +214,6 @@ margin: 0 1px; } -.support table { - width: 100%; - border-spacing: 0; - margin: 3px auto; -} - -.support table td, -.support table th { - padding: 4px 8px; -} - -.support table td { - padding: 4px 8px; - background: #C2AFFE; -} - -.support table th:nth-child(1) { - width: 25%; -} - -.support table th:nth-child(2) { - width: 10%; -} - -.support table td:nth-child(2) { - text-align: center; -} - -.support table th:nth-child(3) { - width: 65%; -} - -.support thead th { - background: linear-gradient(0deg, #C2AFFE, transparent); -} - -.support tfoot th { - background: linear-gradient(180deg, #C2AFFE, transparent); -} - /* * Forum Styling */ diff --git a/resources/assets/less/yuuno/main.less b/resources/assets/less/yuuno/main.less index c5cbe4f..0d36317 100644 --- a/resources/assets/less/yuuno/main.less +++ b/resources/assets/less/yuuno/main.less @@ -17,6 +17,7 @@ @import "bem/dialogue"; @import "bem/dropdown"; @import "bem/footer"; +@import "bem/friend-box"; @import "bem/header"; @import "bem/header-login"; @import "bem/input"; @@ -24,6 +25,8 @@ @import "bem/members"; @import "bem/news"; @import "bem/profile"; +@import "bem/settings"; +@import "bem/sidepanel-table"; @import "bem/uploader"; @import "bem/user"; diff --git a/resources/assets/typescript/Sakura/Changelog.ts b/resources/assets/typescript/Sakura/Changelog.ts index f5d139c..d04b560 100644 --- a/resources/assets/typescript/Sakura/Changelog.ts +++ b/resources/assets/typescript/Sakura/Changelog.ts @@ -18,7 +18,7 @@ namespace Sakura public static Build(target: HTMLElement) { this.Client = new AJAX; - this.Element = DOM.Create('table', 'changelog panelTable'); + this.Element = DOM.Create('table', 'changelog sidepanel-table'); this.Element.style.borderSpacing = '0 1px'; @@ -55,7 +55,7 @@ namespace Sakura private static Add(changelog: IChangelogDate) { var header: HTMLTableRowElement = DOM.Create('tr', 'changelog__row changelog__row--header'), - headerInner: HTMLTableHeaderCellElement = DOM.Create('th', 'changelog__header'); + headerInner: HTMLTableHeaderCellElement = DOM.Create('th', 'changelog__header sidepanel-table__head'); headerInner.innerText = changelog.date; headerInner.style.fontSize = '1.2em'; @@ -68,8 +68,8 @@ namespace Sakura { var change: IChangelogChange = changelog.changes[_i], row: HTMLTableRowElement = DOM.Create('tr', 'changelog__row'), - action: HTMLTableCellElement = DOM.Create('td', 'changelog__column'), - message: HTMLTableCellElement = DOM.Create('td', 'changelog__column'); + action: HTMLTableCellElement = DOM.Create('td', 'changelog__column sidepanel-table__column'), + message: HTMLTableCellElement = DOM.Create('td', 'changelog__column sidepanel-table__column'); action.innerText = change.action.name; action.style.backgroundColor = this.Colours[change.action.id]; @@ -77,6 +77,7 @@ namespace Sakura message.innerText = change.message; message.style.borderBottom = '1px solid ' + this.Colours[change.action.id]; + message.style.textAlign = 'left'; DOM.Append(row, action); DOM.Append(row, message); diff --git a/resources/views/yuuno/elements/indexPanel.twig b/resources/views/yuuno/elements/indexPanel.twig index 25838a0..cb6f7a1 100644 --- a/resources/views/yuuno/elements/indexPanel.twig +++ b/resources/views/yuuno/elements/indexPanel.twig @@ -18,9 +18,20 @@
Online Users
{% if stats.onlineUsers %} All active users in the past 2 minutes - +
{% for amount,onlineUser in stats.onlineUsers %} - + + + + {% endfor %}
{{ onlineUser.username }}
+ + {{ onlineUser.username }} + + + +
{% else %} diff --git a/resources/views/yuuno/forum/index.twig b/resources/views/yuuno/forum/index.twig index 32c7105..64a7af5 100644 --- a/resources/views/yuuno/forum/index.twig +++ b/resources/views/yuuno/forum/index.twig @@ -7,36 +7,40 @@
Popular topics
- +
- - + + {% for _t in activeTopics %} - - + {% endfor %}
TitleLast replyTitleLast reply
+ {{ _t.title }}
Latest posts
- +
- - + + {% for _p in latestPosts %} - - + {% endfor %}
Title & userPostedTitle & userPosted
+ {{ _p.subject }} by {{ _p.poster.username }} + +
diff --git a/resources/views/yuuno/manage/master.twig b/resources/views/yuuno/manage/master.twig index 41f5826..6d462b6 100644 --- a/resources/views/yuuno/manage/master.twig +++ b/resources/views/yuuno/manage/master.twig @@ -8,18 +8,18 @@
Navigation
-
+
{% for name, links in navigation %} -
{{ name }}
+
{{ name }}
{% for name,link in links %} - {{ name }} + {{ name }} {% endfor %} {% endfor %}
{{ title }}
-
{{ block('description') }}
+
{{ block('description') }}
{{ block('manageContent') }}
diff --git a/resources/views/yuuno/meta/faq.twig b/resources/views/yuuno/meta/faq.twig index 691d622..2cb3e05 100644 --- a/resources/views/yuuno/meta/faq.twig +++ b/resources/views/yuuno/meta/faq.twig @@ -8,10 +8,10 @@
Frequently Asked Questions
-
- {% for question in page.questions %} - {{ question.faq_question }} - {% endfor %} +
+ {% for question in page.questions %} + {{ question.faq_question }} + {% endfor %}
diff --git a/resources/views/yuuno/profile/friends.twig b/resources/views/yuuno/profile/friends.twig index 3c10310..f317519 100644 --- a/resources/views/yuuno/profile/friends.twig +++ b/resources/views/yuuno/profile/friends.twig @@ -9,12 +9,12 @@
{% if friends|length > 0 %} {% for friend in friends[get.page|default(1) - 1] %} - + +
+
+ {{ friend.username }} +
+
{% endfor %}
{% else %} diff --git a/resources/views/yuuno/settings/account/details.twig b/resources/views/yuuno/settings/account/details.twig index 152ccec..b6c555f 100644 --- a/resources/views/yuuno/settings/account/details.twig +++ b/resources/views/yuuno/settings/account/details.twig @@ -28,9 +28,7 @@

Password

-
- - -
+ + {% endblock %} diff --git a/resources/views/yuuno/settings/account/profile.twig b/resources/views/yuuno/settings/account/profile.twig index 37dd2f2..7fe8096 100644 --- a/resources/views/yuuno/settings/account/profile.twig +++ b/resources/views/yuuno/settings/account/profile.twig @@ -141,9 +141,7 @@
-
- - -
+ + {% endblock %} diff --git a/resources/views/yuuno/settings/account/signature.twig b/resources/views/yuuno/settings/account/signature.twig index 570c967..43ea69d 100644 --- a/resources/views/yuuno/settings/account/signature.twig +++ b/resources/views/yuuno/settings/account/signature.twig @@ -10,12 +10,12 @@
{{ user.signature()|raw|nl2br }}

-
-
- - - +
+
+ + + {% include 'settings/account/_preview.twig' %} {% endblock %} diff --git a/resources/views/yuuno/settings/account/userpage.twig b/resources/views/yuuno/settings/account/userpage.twig index 7f69e18..cc040ac 100644 --- a/resources/views/yuuno/settings/account/userpage.twig +++ b/resources/views/yuuno/settings/account/userpage.twig @@ -10,12 +10,12 @@
{{ user.userPage()|raw|nl2br }}

-
-
- - - +
+
+ + + {% include 'settings/account/_preview.twig' %} {% endblock %} diff --git a/resources/views/yuuno/settings/advanced/deactivate.twig b/resources/views/yuuno/settings/advanced/deactivate.twig index 3bcd76c..aa86cb3 100644 --- a/resources/views/yuuno/settings/advanced/deactivate.twig +++ b/resources/views/yuuno/settings/advanced/deactivate.twig @@ -15,8 +15,8 @@

Enter your password to continue

-
- +
+
{% endblock %} diff --git a/resources/views/yuuno/settings/advanced/sessions.twig b/resources/views/yuuno/settings/advanced/sessions.twig index afc1bb4..c378d8c 100644 --- a/resources/views/yuuno/settings/advanced/sessions.twig +++ b/resources/views/yuuno/settings/advanced/sessions.twig @@ -9,29 +9,34 @@ {% endblock %} {% block settingsContent %} - - - - - - - +
IPUseragentCountryLogin time
IPUseragentCountryLogin time
+ {% for elem in ['thead', 'tfoot'] %} + <{{ elem }}> + + + + + + + + + {% endfor %} {% for usession in sessions %} - - + - - - -
IPUseragentCountryLogin time
+
{{ usession.ip }} + {{ usession.agent }} + {{ usession.country }} {{ usession.country(true) }} + +
@@ -41,10 +46,8 @@ {% endfor %}
-
- - - - -
+
+ + +
{% endblock %} diff --git a/resources/views/yuuno/settings/master.twig b/resources/views/yuuno/settings/master.twig index 8ca4119..962cb8d 100644 --- a/resources/views/yuuno/settings/master.twig +++ b/resources/views/yuuno/settings/master.twig @@ -48,22 +48,22 @@ {% block content %}
-
+
Navigation
-
+
{% for name, links in navigation %} -
{{ name }}
- {% for name, link in links %} - {{ name }} +
{{ name }}
+ {% for name,link in links %} + {{ name }} {% endfor %} {% endfor %}
-
+
{{ title }}
-
{{ block('description') }}
+
{{ block('description') }}
{{ block('settingsContent') }}
diff --git a/resources/views/yuuno/settings/notifications/history.twig b/resources/views/yuuno/settings/notifications/history.twig deleted file mode 100644 index 7d7437e..0000000 --- a/resources/views/yuuno/settings/notifications/history.twig +++ /dev/null @@ -1,59 +0,0 @@ -{% extends 'settings/notifications/master.twig' %} - -{% set mode = 'History' %} - -{% block description %} -

The history of notifications that have been sent to you.

-{% endblock %} - -{% set alerts = user.notifications(0, false)|batch(10) %} - -{% set paginationPages = alerts %} -{% set paginationUrl %}{{ route('settings.notifications.history') }}{% endset %} - -{% block css %} - -{% endblock %} - -{% block settingsContent %} - {% if alerts %} - - {% if alerts|length > 1 %} -
- {% include 'elements/pagination.twig' %} -
- {% endif %} - {% else %} -

You don't have any notifications in your history!

- {% endif %} -{% endblock %} diff --git a/resources/views/yuuno/settings/notifications/master.twig b/resources/views/yuuno/settings/notifications/master.twig deleted file mode 100644 index 7af531f..0000000 --- a/resources/views/yuuno/settings/notifications/master.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% extends 'settings/master.twig' %} - -{% set category = 'Notifications' %} diff --git a/resources/views/yuuno/user/profile.twig b/resources/views/yuuno/user/profile.twig index f073539..558864f 100644 --- a/resources/views/yuuno/user/profile.twig +++ b/resources/views/yuuno/user/profile.twig @@ -239,7 +239,7 @@ {% if user.id == profile.id %} {% else %} - {% if user.isFriends(profile.id) != 0 %}{% endif %} + {% if user.isFriends(profile.id) != 0 %}{% endif %} {% endif %} diff --git a/routes.php b/routes.php index 6e4e149..76f51f5 100644 --- a/routes.php +++ b/routes.php @@ -225,15 +225,6 @@ Router::group(['before' => 'maintenance'], function () { Router::get('/requests', 'Settings.FriendsController@requests', 'settings.friends.requests'); }); - // Notifications section - Router::group(['prefix' => 'notifications'], function () { - Router::get('/', function () { - redirect(route('settings.account.history')); - }); - - Router::get('/history', 'Settings.NotificationsController@history', 'settings.notifications.history'); - }); - // Advanced section Router::group(['prefix' => 'advanced'], function () { Router::get('/', function () {