This commit is contained in:
flash 2015-06-19 16:12:44 +00:00
parent 6bb9643df1
commit 8f5b7066c3
25 changed files with 388 additions and 40 deletions

View file

@ -19,7 +19,8 @@
"20150529", "20150529",
"20150530", "20150530",
"20150602", "20150602",
"20150604" "20150604",
"20150619"
] ]
@ -1251,6 +1252,15 @@
"change": "Add /header to profile for spooky things." "change": "Add /header to profile for spooky things."
} }
],
"20150619": [
{
"type": "ADD",
"change": "Added notification history section contents to settings panel."
}
] ]
} }

View file

View file

@ -8,7 +8,7 @@
namespace Sakura; namespace Sakura;
// Define Sakura version // Define Sakura version
define('SAKURA_VERSION', '20150604'); define('SAKURA_VERSION', '20150619');
define('SAKURA_VLABEL', 'Eminence'); define('SAKURA_VLABEL', 'Eminence');
define('SAKURA_VTYPE', 'Development'); define('SAKURA_VTYPE', 'Development');
define('SAKURA_COLOUR', '#6C3082'); define('SAKURA_COLOUR', '#6C3082');

View file

@ -1,4 +1,4 @@
{% if newsPosts|length > 1 %}<a href="/news/{{ newsPost.id }}" class="news-head" id="{{ newsPost.id }}">{{ newsPost.title }}</a>{% endif %} {% if newsPosts|length > 1 %}<a href="/news/{{ newsPost.id }}" class="news-head" id="n{{ newsPost.id }}">{{ newsPost.title }}</a>{% endif %}
<div class="news-body"> <div class="news-body">
<a class="no-underline" href="/u/{{ newsPost.uid }}"> <a class="no-underline" href="/u/{{ newsPost.uid }}">
<div class="news-poster"> <div class="news-poster">

View file

@ -16,7 +16,7 @@
<a href="/settings/background">Background</a> <a href="/settings/background">Background</a>
<a href="/settings/page">Profile Page</a> <a href="/settings/page">Profile Page</a>
<div>Account</div> <div>Account</div>
<a href="/settings/email">E-Mail Address</a> <a href="/settings/email">E-mail Address</a>
<a href="/settings/username">Username</a> <a href="/settings/username">Username</a>
<a href="/settings/usertitle">User Title</a> <a href="/settings/usertitle">User Title</a>
<a href="/settings/password">Password</a> <a href="/settings/password">Password</a>

View file

@ -61,25 +61,16 @@
function initHeaderLoginForm() { function initHeaderLoginForm() {
var headerLoginForm = document.getElementById('headerLoginForm'); var headerLoginForm = document.getElementById('headerLoginForm');
var headerLoginLink = document.getElementById('headerLoginLink');
var createInput = document.createElement('input'); var createInput = document.createElement('input');
var submit = headerLoginForm.querySelector('[type="submit"]');
createInput.setAttribute('name', 'ajax'); createInput.setAttribute('name', 'ajax');
createInput.setAttribute('value', 'true'); createInput.setAttribute('value', 'true');
createInput.setAttribute('type', 'hidden'); createInput.setAttribute('type', 'hidden');
headerLoginForm.appendChild(createInput); headerLoginForm.appendChild(createInput);
headerLoginLink.setAttribute('href', 'javascript:void(0);'); submit.setAttribute('type', 'button');
headerLoginLink.setAttribute('onclick', 'toggleLoginForm();'); submit.setAttribute('onclick', 'submitPost(\'headerLoginForm\', true, \'Logging in...\');');
}
// Toggling the dynamic login form
function toggleLoginForm() {
var headerLoginForm = document.getElementById('headerLoginForm');
headerLoginForm.className = (headerLoginForm.className == 'hidden' ? '' : 'hidden');
} }
@ -200,8 +191,7 @@
{% if sakura.lockauth %} {% if sakura.lockauth %}
<div class="menu-item" style="padding-left: 10px; padding-right: 10px;">Authentication is locked</div> <div class="menu-item" style="padding-left: 10px; padding-right: 10px;">Authentication is locked</div>
{% else %} {% else %}
<a class="menu-item" id="headerLoginLink" href="//{{ sakura.urls.main }}/login" title="Login to Flashii">Login</a> <a class="menu-item" href="//{{ sakura.urls.main }}/authenticate" title="Login to Flashii">Login or Register</a>
<a class="menu-item" href="//{{ sakura.urls.main }}/register" title="Create an account">Register</a>
{% endif %} {% endif %}
{% endif %} {% endif %}
</div> </div>
@ -213,8 +203,8 @@
</div> </div>
<div id="contentwrapper"> <div id="contentwrapper">
<div id="notifications"></div> <div id="notifications"></div>
{% if not user.checklogin %} {% if not user.checklogin and php.self != '/authenticate.php' %}
<form method="post" action="/authenticate" class="hidden" id="headerLoginForm" onkeydown="formEnterCatch(event, 'headerLoginButton');"> <form method="post" action="/authenticate" id="headerLoginForm" onkeydown="formEnterCatch(event, 'headerLoginButton');">
<input type="hidden" name="redirect" value="{{ sakura.currentpage }}" /> <input type="hidden" name="redirect" value="{{ sakura.currentpage }}" />
<input type="hidden" name="session" value="{{ php.sessionid }}" /> <input type="hidden" name="session" value="{{ php.sessionid }}" />
<input type="hidden" name="time" value="{{ php.time }}" /> <input type="hidden" name="time" value="{{ php.time }}" />
@ -232,7 +222,7 @@
<label for="headerLoginRemember">Remember me</label> <label for="headerLoginRemember">Remember me</label>
</div> </div>
<div> <div>
<input type="button" onclick="submitPost('headerLoginForm', true, 'Logging in...');" id="headerLoginButton" name="submit" class="inputStyling small" value="Login" /> <input type="submit" id="headerLoginButton" name="submit" class="inputStyling small" value="Login" />
</div> </div>
</form> </form>
{% endif %} {% endif %}

View file

@ -0,0 +1,18 @@
{% include 'global/header.tpl' %}
<div class="content settings messages">
<div class="content-right content-column">
{% include 'elements/settingsNav.tpl' %}
</div>
<div class="content-left content-column">
<div class="head">
{{ page.title }}
</div>
<div class="settings-explanation">
<div>Your avatar which is displayed all over the site and on your profile.</div>
<div>Maximum image size is 500x500, minimum image size is 20x20, maximum file size is 10 MB.</div>
</div>
</div>
<div class="clear"></div>
</div>
{% include 'global/footer.tpl' %}

View file

@ -0,0 +1,18 @@
{% include 'global/header.tpl' %}
<div class="content settings messages">
<div class="content-right content-column">
{% include 'elements/settingsNav.tpl' %}
</div>
<div class="content-left content-column">
<div class="head">
{{ page.title }}
</div>
<div class="settings-explanation">
<div>The background that is displayed on your profile.</div>
<div>Maximum image size is 2560x1440, minimum image size is 20x20, maximum file size is 10 MB.</div>
</div>
</div>
<div class="clear"></div>
</div>
{% include 'global/footer.tpl' %}

View file

@ -0,0 +1,17 @@
{% include 'global/header.tpl' %}
<div class="content settings messages">
<div class="content-right content-column">
{% include 'elements/settingsNav.tpl' %}
</div>
<div class="content-left content-column">
<div class="head">
{{ page.title }}
</div>
<div class="settings-explanation">
You can deactivate your account here if you want to leave :(.
</div>
</div>
<div class="clear"></div>
</div>
{% include 'global/footer.tpl' %}

View file

@ -0,0 +1,17 @@
{% include 'global/header.tpl' %}
<div class="content settings messages">
<div class="content-right content-column">
{% include 'elements/settingsNav.tpl' %}
</div>
<div class="content-left content-column">
<div class="head">
{{ page.title }}
</div>
<div class="settings-explanation">
You e-mail address is used for password recovery and stuff like that, we won't spam you ;).
</div>
</div>
<div class="clear"></div>
</div>
{% include 'global/footer.tpl' %}

View file

@ -5,7 +5,7 @@
</div> </div>
<div class="content-left content-column"> <div class="content-left content-column">
<div class="head"> <div class="head">
General / Home {{ page.title }}
</div> </div>
<div class="settings-explanation"> <div class="settings-explanation">
Welcome to the Settings Panel. From here you can monitor, view and update your profile and preferences. Welcome to the Settings Panel. From here you can monitor, view and update your profile and preferences.

View file

@ -0,0 +1,17 @@
{% include 'global/header.tpl' %}
<div class="content settings messages">
<div class="content-right content-column">
{% include 'elements/settingsNav.tpl' %}
</div>
<div class="content-left content-column">
<div class="head">
{{ page.title }}
</div>
<div class="settings-explanation">
This is an error.
</div>
<h1 class="stylised" style="margin: 2em auto; text-align: center;">Could not find what you were looking for.</h1>
</div>
<div class="clear"></div>
</div>
{% include 'global/footer.tpl' %}

View file

@ -0,0 +1,46 @@
{% include 'global/header.tpl' %}
<div class="content settings messages">
<div class="content-right content-column">
{% include 'elements/settingsNav.tpl' %}
</div>
<div class="content-left content-column">
<div class="head">
{{ page.title }}
</div>
<div class="settings-explanation">
This is the history of notifications that have been sent to you.
</div>
<div class="notification-history">
{% for notif in notifs %}
<div id="notif-hist-{{ notif.id }}" class="{% if notif.notif_read %}read{% endif %}">
<div class="notif-hist-icon">
{% if 'FONT:' in notif.notif_img %}
<div class="font-icon fa {{ notif.notif_img|replace({'FONT:': ''}) }} fa-4x"></div>
{% else %}
<img src="{{ notif.notif_img }}" alt="Notification" />
{% endif %}
</div>
<div class="notif-hist-content">
<div class="notif-hist-time">
{{ notif.timestamp|date("r") }}
</div>
<div class="notif-hist-inside">
<div class="notif-hist-title">
{{ notif.notif_title }}
</div>
<div class="notif-hist-text">
{{ notif.notif_text }}
{% if notif.notif_link %}
| <a href="{{ notif.notif_link }}" class="default">Go</a>
{% endif %}
</div>
</div>
</div>
<div class="clear"></div>
</div>
{% endfor %}
</div>
</div>
<div class="clear"></div>
</div>
{% include 'global/footer.tpl' %}

View file

@ -0,0 +1,18 @@
{% include 'global/header.tpl' %}
<div class="content settings messages">
<div class="content-right content-column">
{% include 'elements/settingsNav.tpl' %}
</div>
<div class="content-left content-column">
<div class="head">
{{ page.title }}
</div>
<div class="settings-explanation">
<div>The custom text that is displayed on your profile.</div>
<div><a href="/r/typography" class="default">Click here if you don't know how to markdown!</a></div>
</div>
</div>
<div class="clear"></div>
</div>
{% include 'global/footer.tpl' %}

View file

@ -0,0 +1,17 @@
{% include 'global/header.tpl' %}
<div class="content settings messages">
<div class="content-right content-column">
{% include 'elements/settingsNav.tpl' %}
</div>
<div class="content-left content-column">
<div class="head">
{{ page.title }}
</div>
<div class="settings-explanation">
Used to authenticate with the site and certain related services.
</div>
</div>
<div class="clear"></div>
</div>
{% include 'global/footer.tpl' %}

View file

@ -0,0 +1,17 @@
{% include 'global/header.tpl' %}
<div class="content settings messages">
<div class="content-right content-column">
{% include 'elements/settingsNav.tpl' %}
</div>
<div class="content-left content-column">
<div class="head">
{{ page.title }}
</div>
<div class="settings-explanation">
These are the external account links etc. on your profile, shouldn't need any additional explanation for this one.
</div>
</div>
<div class="clear"></div>
</div>
{% include 'global/footer.tpl' %}

View file

@ -0,0 +1,17 @@
{% include 'global/header.tpl' %}
<div class="content settings messages">
<div class="content-right content-column">
{% include 'elements/settingsNav.tpl' %}
</div>
<div class="content-left content-column">
<div class="head">
{{ page.title }}
</div>
<div class="settings-explanation">
Manage what ranks you're in and what is set as your main rank. Your main rank is highlighted. You get the permissions of all of the ranks you're in combined.
</div>
</div>
<div class="clear"></div>
</div>
{% include 'global/footer.tpl' %}

View file

@ -0,0 +1,17 @@
{% include 'global/header.tpl' %}
<div class="content settings messages">
<div class="content-right content-column">
{% include 'elements/settingsNav.tpl' %}
</div>
<div class="content-left content-column">
<div class="head">
{{ page.title }}
</div>
<div class="settings-explanation">
Sometimes we activate the registration key system which means that users can only register using your "referer" keys, this means we can keep unwanted people from registering. Each user can generate 5 of these keys, bans and deactivates render these keys useless.
</div>
</div>
<div class="clear"></div>
</div>
{% include 'global/footer.tpl' %}

View file

@ -0,0 +1,19 @@
{% include 'global/header.tpl' %}
<div class="content settings messages">
<div class="content-right content-column">
{% include 'elements/settingsNav.tpl' %}
</div>
<div class="content-left content-column">
<div class="head">
{{ page.title }}
</div>
<div class="settings-explanation">
Session keys are a way of identifying yourself with the system without keeping your password in memory.
If someone finds one of your session keys they could possibly compromise your account, if you see any sessions here that shouldn't be here hit the Kill button to kill the selected session.
If you get logged out after clicking one you've most likely killed your current session, to make it easier to avoid this from happening your current session is highlighted.
</div>
</div>
<div class="clear"></div>
</div>
{% include 'global/footer.tpl' %}

View file

@ -0,0 +1,18 @@
{% include 'global/header.tpl' %}
<div class="content settings messages">
<div class="content-right content-column">
{% include 'elements/settingsNav.tpl' %}
</div>
<div class="content-left content-column">
<div class="head">
{{ page.title }}
</div>
<div class="settings-explanation">
<div>Probably the biggest part of your identity on a site.</div>
<div style="font-weight: bold;">You can only change this once every 30 days so choose wisely.</div>
</div>
</div>
<div class="clear"></div>
</div>
{% include 'global/footer.tpl' %}

View file

@ -0,0 +1,17 @@
{% include 'global/header.tpl' %}
<div class="content settings messages">
<div class="content-right content-column">
{% include 'elements/settingsNav.tpl' %}
</div>
<div class="content-left content-column">
<div class="head">
{{ page.title }}
</div>
<div class="settings-explanation">
That little piece of text displayed under your username on your profile.
</div>
</div>
<div class="clear"></div>
</div>
{% include 'global/footer.tpl' %}

View file

@ -10,6 +10,7 @@
@import url('//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css'); @import url('//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css');
/* Import Segoe UI */ /* Import Segoe UI */
@import url('/fonts/segoeui/font.css');
@import url('/fonts/segoeui-light/font.css'); @import url('/fonts/segoeui-light/font.css');
/* Import markdown specific style */ /* Import markdown specific style */
@ -182,7 +183,7 @@ h3,
h4, h4,
h5, h5,
h6 { h6 {
font-family: "SegoeUI-Light", "Segoe UI", sans-serif; font-family: "SegoeUI-Light", "SegoeUI", "Segoe UI", sans-serif;
font-weight: 100; font-weight: 100;
margin: 5px 0; margin: 5px 0;
} }
@ -407,7 +408,7 @@ a.gotop.exit {
min-width: 200px; min-width: 200px;
border: 2px solid #9475B2; border: 2px solid #9475B2;
float: left; float: left;
font-family: "Segoe UI", sans-serif; font-family: "SegoeUI", "Segoe UI", sans-serif;
text-align: left; text-align: left;
margin: 0 2px; margin: 0 2px;
transition: background .5s; transition: background .5s;
@ -452,28 +453,42 @@ a.gotop.exit {
} }
#headerLoginForm { #headerLoginForm {
background: #9475B2; background: rgba(211, 191, 255, .8);
border-bottom: 2px solid #9475B2; border: 1px solid #9475B2;
box-shadow: 0 0 5px #8364A1; box-shadow: 0 0 3px #8364A1;
text-align: center; text-align: center;
max-width: 1024px;
margin: 10px auto 0;
padding: 6px 3px;
border-radius: 3px;
} }
#headerLoginForm > div { #headerLoginForm > div {
display: inline-block; display: inline-block;
} }
#headerLoginForm input[type="submit"],
#headerLoginForm input[type="button"] {
display: inline-block;
border-radius: 3px;
}
@media (max-width: 640px) { @media (max-width: 640px) {
#headerLoginForm > div { #headerLoginForm > div {
display: block; display: block;
}
#headerLoginForm label {
text-align: right; text-align: right;
padding-right: 2px; min-width: 80px;
display: inline-block;
} }
} }
#headerLoginForm label { #headerLoginForm label {
font-family: "Segoe UI", sans-serif; font-family: "SegoeUI", "Segoe UI", sans-serif;
font-weight: 100; font-weight: 100;
font-size: 15px; font-size: 15px;
} }
@ -515,7 +530,7 @@ a.gotop.exit {
width: auto; width: auto;
display: inline-block; display: inline-block;
text-decoration: none; text-decoration: none;
font: 100 70px/80px "SegoeUI-Light", "Segoe UI", sans-serif; font: 100 70px/80px "SegoeUI-Light", "SegoeUI", "Segoe UI", sans-serif;
color: #B06AC4; color: #B06AC4;
transition: color .2s, text-shadow .2s; transition: color .2s, text-shadow .2s;
} }
@ -532,7 +547,7 @@ a.gotop.exit {
@media (max-width: 768px) { @media (max-width: 768px) {
.header .logo { .header .logo {
font: 100 50px/60px "SegoeUI-Light", "Segoe UI", sans-serif; font: 100 50px/60px "SegoeUI-Light", "SegoeUI", "Segoe UI", sans-serif;
} }
} }
@ -673,7 +688,7 @@ a.gotop.exit {
.headerNotify { .headerNotify {
margin: 10px auto; margin: 10px auto;
padding: 10px; padding: 2px 3px;
width: auto; width: auto;
max-width: 1024px; max-width: 1024px;
border: 1px solid #9475B2; border: 1px solid #9475B2;
@ -922,7 +937,7 @@ a.gotop.exit {
bottom: 5px; bottom: 5px;
right: 5px; right: 5px;
z-index: 3; z-index: 3;
font-family: "Segoe UI", sans-serif; font-family: "SegoeUI", "Segoe UI", sans-serif;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
max-height: 510px; max-height: 510px;
@ -1267,6 +1282,48 @@ a.gotop.exit {
overflow: auto; overflow: auto;
} }
.settings .notification-history > div {
border: 1px solid #507;
margin: 5px;
background: rgba(113, 74, 150, .3);
}
.settings .notification-history > div > .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 > div > .notif-hist-icon > .font-icon {
margin: .34em 0;
}
.settings .notification-history > div > .notif-hist-content > .notif-hist-time {
font-style: italic;
text-align: right;
float: right;
margin-right: 6px;
font-size: .8em;
}
.settings .notification-history > div > .notif-hist-content > .notif-hist-inside {
float: left;
margin-left: 2px;
padding-left: 8px;
}
.settings .notification-history > div > .notif-hist-content > .notif-hist-inside > .notif-hist-title {
font-family: "SegoeUI", "Segoe UI", sans-serif;
font-weight: 300;
font-size: 1.7em;
margin-top: 1em;
}
/* /*
* Donation page Styling * Donation page Styling
*/ */

View file

@ -17,8 +17,8 @@ Options +FollowSymLinks -Indexes
RewriteRule ^feedback/?$ https://github.com/circlestorm/Sakura/issues RewriteRule ^feedback/?$ https://github.com/circlestorm/Sakura/issues
RewriteRule ^credits/?$ credits.php RewriteRule ^credits/?$ credits.php
RewriteRule ^index/?$ index.php RewriteRule ^index/?$ index.php
RewriteRule ^login/?$|logout?/?$|activate?/?$|register?/?$|forgotpassword?/?|authenticate?/?$ authenticate.php RewriteRule ^login/?$|^logout/?$|^activate/?$|^register/?$|^forgotpassword/?|^authenticate/?$ authenticate.php
RewriteRule ^donate/?$|support?/?$ donate.php RewriteRule ^donate/?$|^support/?$ donate.php
RewriteRule ^contact/?$ infopage.php?r=contact RewriteRule ^contact/?$ infopage.php?r=contact
RewriteRule ^changelog/?$ changelog.php RewriteRule ^changelog/?$ changelog.php
RewriteRule ^faq/?$ faq.php RewriteRule ^faq/?$ faq.php

View file

@ -27,7 +27,7 @@ if(isset($_GET['m'])) {
$bannedAvatar = ROOT .'content/images/banned-av.png'; $bannedAvatar = ROOT .'content/images/banned-av.png';
// If ?u= isn't set or if it isn't numeric // If ?u= isn't set or if it isn't numeric
if(!isset($_GET['u']) || !is_numeric($_GET['u'])) { if(!isset($_GET['u']) || !is_numeric($_GET['u']) || $_GET['u'] == 0) {
$serveImage = $noAvatar; $serveImage = $noAvatar;
break; break;
} }

View file

@ -56,16 +56,34 @@ $pages = [
'avatar' => ['Aesthetics', 'Avatar'], 'avatar' => ['Aesthetics', 'Avatar'],
'background' => ['Aesthetics', 'Background'], 'background' => ['Aesthetics', 'Background'],
'page' => ['Aesthetics', 'Profile Page'], 'page' => ['Aesthetics', 'Profile Page'],
'email' => ['Account', 'E-Mail Address'], 'email' => ['Account', 'E-mail Address'],
'username' => ['Account', 'Username'], 'username' => ['Account', 'Username'],
'usertitle' => ['Account', 'User Title'], 'usertitle' => ['Account', 'User Title'],
'password' => ['Account', 'Password'], 'password' => ['Account', 'Password'],
'ranks' => ['Account', 'Ranks'], 'ranks' => ['Account', 'Ranks'],
'sessions' => ['Danger zone', 'Sessions'], 'sessions' => ['Danger zone', 'Sessions'],
'regkeys' => ['Danger zone', 'Registration Keys'], 'regkeys' => ['Danger zone', 'Registration Keys'],
'deactivate' => ['Danger zone', 'Deactivate Account'] 'deactivate' => ['Danger zone', 'Deactivate Account'],
'notfound' => ['Settings', '404']
]; ];
$currentPage = isset($_GET['mode']) && array_key_exists($_GET['mode'], $pages) ? $_GET['mode'] : key($pages);
// Current settings page
$currentPage = isset($_GET['mode']) ? (array_key_exists($_GET['mode'], $pages) ? $_GET['mode'] : 'notfound') : 'home';
// Render data
$renderData['page'] = [
'title' => $pages[$currentPage][0] .' / '. $pages[$currentPage][1]
];
// Section specific
switch($currentPage) {
// Notification history
case 'notifications':
$renderData['notifs'] = array_reverse(Users::getNotifications(null, 0, false, true));
break;
}
// Print page contents // Print page contents
print Templates::render('settings/'. $currentPage .'.tpl', $renderData); print Templates::render('settings/'. $currentPage .'.tpl', $renderData);