now with journalism!

This commit is contained in:
flash 2018-04-16 02:33:54 +02:00
parent afa9495f29
commit 1415272ff4
48 changed files with 709 additions and 291 deletions

View file

@ -1,4 +1,4 @@
.mio__avatar {
.avatar {
flex-shrink: 0;
background-color: #fbeeff;
background-size: cover;

View file

@ -1,16 +1,31 @@
.mio__container {
.container {
border: 1px solid #9475b2;
background-color: #fbeeff;
margin: 2px 0;
&__title {
display: block;
text-decoration: none;
background-color: #9475b2;
color: #306;
font-size: 1.17em;
font-weight: 700;
padding: 3px;
font-family: @mio-font-heading;
&--link:hover {
text-decoration: underline;
}
&__link {
color: inherit;
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
}
&__content {

View file

@ -1,4 +1,4 @@
.mio__footer {
.footer {
text-align: center;
font-size: .9em;
line-height: 1.5em;

View file

@ -1,6 +1,6 @@
@mio-forum-listing-mobile: 500px;
.mio__forum__listing {
.forum__listing {
&__forums {
margin: 0;
}

View file

@ -1,6 +1,6 @@
@mio-header-mobile: 700px;
.mio__header {
.header {
display: flex;
margin: 4px 0;
@ -26,6 +26,7 @@
@media (max-width: @mio-header-mobile) {
max-width: 200px;
max-height: 100px;
margin-bottom: 4px;
}
}
}

View file

@ -1,4 +1,4 @@
.mio__heading {
.heading {
&--1 {
line-height: 1.2em;
}

View file

@ -1,4 +1,4 @@
.mio__input__button {
.input__button {
font-family: 'visitor1';
font-size: 20px;
line-height: 1.25em;

View file

@ -1,4 +1,4 @@
.mio__input__text {
.input__text {
border: 1px solid #aaa;
padding: 1px;
background: #fff;
@ -9,7 +9,7 @@
}
}
.mio--dark .mio__input__text {
.mio--dark .input__text {
background: #111;
color: #fff;
}

View file

@ -1,4 +1,4 @@
.mio__input__textarea {
.input__textarea {
border: 1px solid #aaa;
padding: 1px;
vertical-align: bottom;
@ -10,7 +10,7 @@
}
}
.mio--dark .mio__input__textarea {
.mio--dark .input__textarea {
background: #111;
color: #fff;
}

View file

@ -1,7 +1,7 @@
.mio__input__upload {
.input__upload {
display: none;
&__label {
.mio__input__button();
.input__button();
}
}

View file

@ -1,6 +1,6 @@
@mio-navigation-mobile: 1000px;
.mio__navigation {
.navigation {
margin: 5px 0;
width: 100%;
display: flex;
@ -22,7 +22,7 @@
border-bottom-width: 1px;
align-items: flex-end;
.mio__navigation__option {
.navigation__option {
border-top-width: 1px;
border-bottom-width: 0;
@ -68,7 +68,7 @@
}
@media (min-width: @mio-navigation-mobile) {
.mio__navigation__link {
.navigation__link {
padding: 3px 1em;
}
}
@ -94,20 +94,20 @@
}
.mio--dark {
.mio__navigation,
.mio__navigation__option {
.navigation,
.navigation__option {
border-color: #9475b2;
}
.mio__navigation__option {
.navigation__option {
background-color: #462e55;
}
.mio__navigation__option--selected {
.navigation__option--selected {
background-color: #23172a;
}
.mio__navigation__link {
.navigation__link {
color: #9475b2;
&:hover {

View file

@ -0,0 +1,18 @@
@mio-news-mobile: 700px;
.news__container {
margin: 0;
&:not(:last-child) {
margin-bottom: 2px;
}
&__content {
margin: 2px;
display: flex;
@media (max-width: @mio-news-mobile) {
flex-direction: column;
}
}
}

View file

@ -0,0 +1,28 @@
.news__list {
margin: 0;
margin-bottom: 2px;
&__item {
text-decoration: none;
color: inherit;
display: block;
&:hover {
text-decoration: underline;
}
&--kvp {
display: flex;
}
}
&__name {
flex-shrink: 1;
flex-grow: 1;
}
&__value {
flex-shrink: 0;
flex-grow: 0;
}
}

View file

@ -0,0 +1,40 @@
.news__pagination {
border: 1px solid #9475b2;
list-style: none;
display: flex;
justify-content: space-between;
padding: 1px;
&__option {
background: #9475b2;
height: 20px;
width: 20px;
@media (max-width: @mio-news-mobile) {
height: 30px;
width: 30px;
font-size: 1.5em;
line-height: 1.5em;
}
}
&__link {
display: block;
width: 100%;
height: 100%;
text-align: center;
text-decoration: none;
color: #306;
&--prev,
&--next,
&--active,
&:hover {
font-weight: bold;
}
}
&__separator {
display: none;
}
}

View file

@ -0,0 +1,67 @@
.news__post {
&__content {
margin: 2px;
display: flex;
@media (max-width: @mio-news-mobile) {
flex-direction: column;
}
}
&__text {
margin-left: 2px;
flex-grow: 1;
flex-shrink: 1;
}
&__details {
width: 200px;
@media (max-width: @mio-news-mobile) {
width: 100%;
}
}
&__detail {
border: 1px solid #9475b2;
padding: 1px;
&:not(:last-child) {
margin-bottom: 2px;
}
}
&__user {
display: flex;
align-items: center;
text-decoration: none;
color: inherit;
}
&__avatar {
text-align: right;
width: 50px;
height: 50px;
}
&__username {
flex-grow: 1;
flex-shrink: 1;
font-weight: 700;
font-size: 1.5em;
line-height: 1.2em;
text-align: center;
}
&__info {
display: flex;
justify-content: space-between;
padding: 1px 4px;
text-decoration: none;
color: inherit;
&:hover {
text-decoration: underline;
}
}
}

View file

@ -0,0 +1,45 @@
.news__preview {
margin: 0;
&:not(:last-child) {
margin-bottom: 2px;
}
&__listing {
flex-grow: 1;
flex-shrink: 1;
}
&__content {
display: flex;
margin: 2px;
}
&__text {
flex-grow: 1;
flex-shrink: 1;
margin-left: 2px;
}
&__info {
text-align: right;
flex-grow: 0;
flex-shrink: 0;
}
&__user {
text-decoration: none;
color: inherit;
display: inline-flex;
&__name {
font-weight: 700;
}
&__avatar {
height: 20px;
width: 20px;
margin-left: 4px;
}
}
}

View file

@ -0,0 +1,12 @@
.news__sidebar {
width: 300px;
flex-grow: 0;
flex-shrink: 0;
margin-left: 2px;
@media (max-width: @mio-news-mobile) {
margin: 0;
width: 100%;
margin-top: 2px;
}
}

View file

@ -1,6 +1,6 @@
@mio-profile-mobile: 700px;
.mio__profile {
.profile {
&__avatar {
width: 200px;
height: 200px;

View file

@ -1,9 +1,14 @@
@mio-settings-account-mobile: 800px;
.mio__settings__account {
.settings__account {
display: flex;
flex-direction: column;
&__disabled {
text-align: center;
padding: 5px;
}
&__row {
width: 100%;
display: flex;
@ -24,11 +29,17 @@
&__column {
flex-grow: 1;
&:not(.mio__settings__account__column--no-margin) {
&:not(.settings__account__column--no-margin) {
margin: 1px;
border: 1px solid #9475b2;
border-top-width: 0;
}
@media (min-width: @mio-settings-account-mobile) {
&--disabled {
max-width: 400px;
}
}
}
&__title {

View file

@ -1,6 +1,6 @@
@mio-settings-avatar-mobile: 700px;
.mio__settings__avatar {
.settings__avatar {
display: flex;
min-height: 200px;
justify-content: space-between;

View file

@ -1,4 +1,4 @@
.mio__settings__content {
.settings__content {
&--account,
&--sessions,
&--login-history {

View file

@ -1,4 +1,4 @@
.mio__settings__description {
.settings__description {
font-size: .9em;
padding: 1px 4px;
border-bottom: 1px solid #9475b2;

View file

@ -1,4 +1,4 @@
.mio__settings__errors {
.settings__errors {
margin-left: 1.2em;
list-style: square;
}

View file

@ -1,4 +1,4 @@
.mio__settings__login-history {
.settings__login-history {
&__country {
vertical-align: middle;
}

View file

@ -1,6 +1,6 @@
@mio-settings-sessions-mobile: 1000px;
.mio__settings__sessions {
.settings__sessions {
&__country {
vertical-align: middle;
}

View file

@ -61,5 +61,13 @@ body {
@import "classes/settings/login-history";
@import "classes/settings/sessions";
// News
@import "classes/news/container";
@import "classes/news/list";
@import "classes/news/pagination";
@import "classes/news/preview";
@import "classes/news/sidebar";
@import "classes/news/post"; // post needs to be able to override sidebar
// Forums
@import "classes/forum/listing";

View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
ASSETS_PATH='./assets'
ASSETS_LESS="$ASSETS_PATH/less"

View file

@ -1,4 +1,8 @@
<?php
use Misuzu\News\NewsPost;
require_once __DIR__ . '/../misuzu.php';
echo $app->templating->render('home.landing');
$featured_news = NewsPost::where('is_featured', true)->orderBy('created_at', 'desc')->take(3)->get();
echo $app->templating->render('home.landing', compact('featured_news'));

View file

@ -4,8 +4,9 @@ use Misuzu\News\NewsPost;
require_once __DIR__ . '/../misuzu.php';
$category_id = empty($_GET['c']) ? null : (int)$_GET['c'];
$post_id = empty($_GET['n']) ? null : (int)$_GET['n'];
$category_id = isset($_GET['c']) ? (int)$_GET['c'] : null;
$post_id = isset($_GET['n']) ? (int)$_GET['n'] : null;
$page_id = (int)($_GET['p'] ?? 1);
if ($post_id !== null) {
$post = NewsPost::find($post_id);
@ -29,13 +30,26 @@ if ($category_id !== null) {
return;
}
$posts = $category->posts()->orderBy('created_at', 'desc')->paginate(5);
$featured = $category->where('is_featured', 1)->orderBy('created_at', 'desc')->take(10);
echo $app->templating->render('news.category', compact('category', 'posts', 'featured'));
$posts = $category->posts()->orderBy('created_at', 'desc')->paginate(5, ['*'], 'p', $page_id);
if (!is_valid_page($posts, $page_id)) {
http_response_code(404);
echo $app->templating->render('errors.404');
return;
}
$featured = $category->posts()->where('is_featured', 1)->orderBy('created_at', 'desc')->take(10)->get();
echo $app->templating->render('news.category', compact('category', 'posts', 'featured', 'page_id'));
return;
}
$categories = NewsCategory::where('is_hidden', false)->get();
$posts = NewsPost::where('is_featured', true)->paginate(5);
$posts = NewsPost::where('is_featured', true)->orderBy('created_at', 'desc')->paginate(5, ['*'], 'p', $page_id);
echo $app->templating->render('news.index', compact('categories', 'posts'));
if (!is_valid_page($posts, $page_id)) {
http_response_code(404);
echo $app->templating->render('errors.404');
return;
}
echo $app->templating->render('news.index', compact('categories', 'posts', 'page_id'));

View file

@ -4,6 +4,7 @@ namespace Misuzu\News;
use Illuminate\Database\Eloquent\SoftDeletes;
use Misuzu\Users\User;
use Misuzu\Model;
use Parsedown;
final class NewsPost extends Model
{
@ -12,6 +13,11 @@ final class NewsPost extends Model
protected $table = 'news_posts';
protected $primaryKey = 'post_id';
public function getHtml(): string
{
return (new Parsedown)->text($this->post_text);
}
public function user()
{
return $this->belongsTo(User::class, 'user_id');

View file

@ -212,3 +212,8 @@ function first_paragraph(string $text, string $delimiter = "\n"): string
$index = mb_strpos($text, $delimiter);
return $index === false ? $text : mb_substr($text, 0, $index);
}
function is_valid_page(\Illuminate\Pagination\LengthAwarePaginator $paginator, int $attemptedPage): bool
{
return $attemptedPage >= 1 && $attemptedPage <= $paginator->lastPage();
}

View file

@ -17,7 +17,7 @@
{% macro paginate(paginator, base_url, className, alwaysRender) %}
{% set alwaysRender = alwaysRender|default(false) %}
{% if alwaysRender or paginator.hasMorePages %}
{% if alwaysRender or paginator.lastPage > 1 %}
{% set separator = '%3F' in base_url|default('')|url_encode ? '&' : '?' %}
{% set base_url = base_url ~ separator %}

View file

@ -2,9 +2,9 @@
{% from '@mio/macros.twig' import navigation %}
{% block content %}
<div class="mio__container">
<div class="mio__container__title">Error {{ error_code }}{{ error_text is defined ? ' - ' ~ error_text : '' }}</div>
<div class="mio__container__content">
<div class="container">
<div class="container__title">Error {{ error_code }}{{ error_text is defined ? ' - ' ~ error_text : '' }}</div>
<div class="container__content">
{% block error_message %}
<p>Try again later, perhaps.</p>
{% endblock %}

View file

@ -1,24 +1,27 @@
{% extends '@mio/home/master.twig' %}
{% from '@mio/macros.twig' import navigation, link %}
{% from '@mio/news/macros.twig' import news_preview %}
{% set canonical_url = '/' %}
{% block content %}
<div class="mio__container">
<div class="mio__container__title">Welcome!</div>
<div class="mio__container__content">
<p>Welcome to Flashii, the site is still heavily in development. You can follow us on {{ link('https://twitter.com/flashiinet', 'Twitter') }} where we'll post updates every so often, we'll also announce when the site is ready for public use there!</p>
{% if app.session == null %}
<p>You can <a href="/auth.php?m=register">create an account</a> already though, if you'd like!</p>
{% else %}
<p>If you want a custom avatar, let me (flash) know and I'll set it for you. The settings page doesn't exist yet..</p>
{% endif %}
{% if app.session != null %}
<div class="container">
<div class="container__title">Welcome</div>
<div class="container__content">
<p>You have 0 new messages because the PM system doesn't exist yet, have a nice day.</p>
</div>
</div>
<div class="mio__container__title">What happened to the previous design?</div>
<div class="mio__container__content">
<p>I decided to shelve it for a bit. I'm working on this all by myself and I'm not a designer, so coming up with good designs that flow nicely together isn't easy for me.</p>
<p>This layout is a LOT simpler to work with than the other one, so this'll be the main design until later.</p>
<p>A dark mode will also be available at a later date and for those that grow attached this to javascript light style, you will eventually be able to switch to this design whenever you like from your settings!</p>
{% endif %}
<div class="container news__container">
<a class="container__title container__title--link" href="/news.php">Featured News</a>
<div class="container__content news__container__content">
<div class="news__preview__listing">
{% for post in featured_news %}
{{ news_preview(post) }}
{% endfor %}
</div>
</div>
</div>

View file

@ -9,9 +9,79 @@
{% set current = current|default(null) %}
{% set fmt = fmt|default('%s') %}
<ul class="mio__navigation{% if top %} mio__navigation--top{% endif %}">
<ul class="navigation{% if top %} navigation--top{% endif %}">
{% for name, url in links %}
<li class="mio__navigation__option{% if url == current or name == current %} mio__navigation__option--selected{% endif %}"><a href="{{ fmt|format(url) }}" class="mio__navigation__link">{{ name }}</a></li>
<li class="navigation__option{% if url == current or name == current %} navigation__option--selected{% endif %}"><a href="{{ fmt|format(url) }}" class="navigation__link">{{ name }}</a></li>
{% endfor %}
</ul>
{% endmacro %}
{% macro pagination_segment(url_window, base_url, currentPage, classPrefix) %}
{% for page, url in url_window %}
<li class="{{ classPrefix }}pagination__option{{ currentPage == page ? ' ' ~ classPrefix ~ 'pagination__option--active' : '' }}">
<a href="{{ base_url ~ url|slice(2) }}" class="{{ classPrefix }}pagination__link{{ currentPage == page ? ' ' ~ classPrefix ~ 'pagination__link--active' : '' }}">
{{ page }}
</a>
</li>
{% endfor %}
{% endmacro %}
{% macro paginate(paginator, base_url, classPrefix, alwaysRender) %}
{% set alwaysRender = alwaysRender|default(false) %}
{% if alwaysRender or paginator.lastPage > 1 %}
{% set classPrefix = classPrefix|default('') %}
{% set separator = '%3F' in base_url|default('')|url_encode ? '&' : '?' %}
{% set base_url = base_url ~ separator %}
<ul class="{{ classPrefix }}pagination">
{% if paginator.onFirstPage %}
<li class="{{ classPrefix }}pagination__option {{ classPrefix }}pagination__option--prev">
<span class="{{ classPrefix }}pagination__link {{ classPrefix }}pagination__link--prev">
&laquo;
</span>
</li>
{% else %}
<li class="{{ classPrefix }}pagination__option {{ classPrefix }}pagination__option--prev">
<a href="{{ base_url ~ paginator.previousPageUrl|slice(2) }}" class="{{ classPrefix }}pagination__link {{ classPrefix }}pagination__link--prev" rel="prev">
&laquo;
</a>
</li>
{% endif %}
<li class="{{ classPrefix }}pagination__separator"></li>
{% from _self import pagination_segment %}
{% set url_window = paginator|create_pagination %}
{% if url_window.first is iterable %}
{{ pagination_segment(url_window.first, base_url, paginator.currentPage, classPrefix) }}
<li class="{{ classPrefix }}pagination__separator"></li>
{% endif %}
{% if url_window.slider is iterable %}
{{ pagination_segment(url_window.slider, base_url, paginator.currentPage, classPrefix) }}
<li class="{{ classPrefix }}pagination__separator"></li>
{% endif %}
{% if url_window.last is iterable %}
{{ pagination_segment(url_window.last, base_url, paginator.currentPage, classPrefix) }}
<li class="{{ classPrefix }}pagination__separator"></li>
{% endif %}
{% if paginator.hasMorePages %}
<li class="{{ classPrefix }}pagination__option {{ classPrefix }}pagination__option--next">
<a href="{{ base_url ~ paginator.nextPageUrl|slice(2) }}" class="{{ classPrefix }}pagination__link {{ classPrefix }}pagination__link--next" rel="next">
&raquo;
</a>
</li>
{% else %}
<li class="{{ classPrefix }}pagination__option {{ classPrefix }}pagination__option--next">
<span class="{{ classPrefix }}pagination__link {{ classPrefix }}pagination__link--next">
&raquo;
</span>
</li>
{% endif %}
</ul>
{% endif %}
{% endmacro %}

View file

@ -18,39 +18,39 @@
</head>
<body class="mio">
<div class="mio__wrapper">
<nav class="mio__header">
<div class="mio__header__logo">
<a href="/" class="mio__header__logo__link">
<img class="mio__header__logo__image" src="https://static.flash.moe/logos/logo-exo.png" alt="Flashii">
<nav class="header">
<div class="header__logo">
<a href="/" class="header__logo__link">
<img class="header__logo__image" src="https://static.flash.moe/logos/logo-exo.png" alt="Flashii">
</a>
</div>
<div class="mio__header__menu">
<div class="header__menu">
{% if app.session is not null %}
<div class="mio__container mio__header__user">
<div class="mio__container__title">Hey, {{ app.session.user.username }}!</div>
<div class="mio__container__content mio__header__user__content">
<a href="/settings.php?m=avatar" class="mio__avatar mio__header__user__avatar" style="background-image:url('/profile.php?u={{ app.session.user.user_id }}&amp;m=avatar');"></a>
<div class="mio__header__user__links__container">
<ul class="mio__header__user__links">
<li class="mio__header__user__option"><a class="mio__header__user__link" href="/profile.php?u={{ app.session.user.user_id }}">Profile</a></li>
<li class="mio__header__user__option"><a class="mio__header__user__link" href="/settings.php">Settings</a></li>
<li class="mio__header__user__option"><a class="mio__header__user__link" href="{{ manage_link|default('/manage/index.php') }}">Manage</a></li>
<li class="mio__header__user__option"><a class="mio__header__user__link" href="/auth.php?m=logout&amp;s={{ csrf_token() }}">Logout</a></li>
<div class="container header__user">
<div class="container__title">Hey, {{ app.session.user.username }}!</div>
<div class="container__content header__user__content">
<a href="/settings.php?m=avatar" class="avatar header__user__avatar" style="background-image:url('/profile.php?u={{ app.session.user.user_id }}&amp;m=avatar');"></a>
<div class="header__user__links__container">
<ul class="header__user__links">
<li class="header__user__option"><a class="header__user__link" href="/profile.php?u={{ app.session.user.user_id }}">Profile</a></li>
<li class="header__user__option"><a class="header__user__link" href="/settings.php">Settings</a></li>
<li class="header__user__option"><a class="header__user__link" href="{{ manage_link|default('/manage/index.php') }}">Manage</a></li>
<li class="header__user__option"><a class="header__user__link" href="/auth.php?m=logout&amp;s={{ csrf_token() }}">Logout</a></li>
</ul>
</div>
</div>
</div>
{% else %}
<a href="/auth.php" class="mio__input__button">Login/Register</a>
<a href="/auth.php" class="input__button">Login/Register</a>
{% endif %}
</div>
</nav>
{% block content %}
<div class="mio__container">
<div class="mio__container__title">Hello!</div>
<div class="mio__container__content">
<div class="container">
<div class="container__title">Hello!</div>
<div class="container__content">
This page has no content!
</div>
</div>
@ -58,18 +58,18 @@
{{ navigation(mio_navigation) }}
{% endblock %}
<footer class="mio__footer">
<div class="mio__footer__copyright">
{{ link('https://flash.moe', 'flash.moe', 'mio__footer__copyright__link') }} 2013-{{
<footer class="footer">
<div class="footer__copyright">
{{ link('https://flash.moe', 'flash.moe', 'footer__copyright__link') }} 2013-{{
''|date('Y') }} /
{{ link('https://github.com/flashwave/misuzu/tree/' ~ git_branch(), git_branch(), 'mio__footer__copyright__link') }} # {{ link('https://github.com/flashwave/misuzu/commit/' ~ git_hash(true), git_hash(), 'mio__footer__copyright__link') }}
{{ link('https://github.com/flashwave/misuzu/tree/' ~ git_branch(), git_branch(), 'footer__copyright__link') }} # {{ link('https://github.com/flashwave/misuzu/commit/' ~ git_hash(true), git_hash(), 'footer__copyright__link') }}
</div>
<div class="mio__footer__links">
{{ link('#', 'Terms of Service', 'mio__footer__links__link') }} |
{{ link('#', 'Rules', 'mio__footer__links__link') }} |
{{ link('#', 'Contact', 'mio__footer__links__link') }} |
{{ link('#', 'Status', 'mio__footer__links__link') }} |
{{ link('https://twitter.com/flashiinet', 'Twitter', 'mio__footer__links__link') }}
<div class="footer__links">
{{ link('#', 'Terms of Service', 'footer__links__link') }} |
{{ link('#', 'Rules', 'footer__links__link') }} |
{{ link('#', 'Contact', 'footer__links__link') }} |
{{ link('#', 'Status', 'footer__links__link') }} |
{{ link('https://twitter.com/flashiinet', 'Twitter', 'footer__links__link') }}
</div>
</footer>
</div>

View file

@ -1,38 +1,45 @@
{% extends '@mio/news/master.twig' %}
{% from '@mio/macros.twig' import paginate %}
{% from '@mio/news/macros.twig' import news_preview %}
{% set title = category.category_name ~ ' :: News' %}
{% set canonical_url = '/news.php?c=' ~ category.category_id %}
{% set canonical_url = '/news.php?c=' ~ category.category_id ~ (page_id > 1 ? '&p=' ~ page_id : '') %}
{% block news_content %}
<div class="mio__container">
<div class="mio__container__title">News » {{ category.category_name }}</div>
<div class="mio__container__content">
<div class="mio__news__category__posts">
<div class="container news__container">
<div class="container__title news__container__title">News » {{ category.category_name }}</div>
<div class="container__content news__container__content">
<div class="news__preview__listing">
{% for post in posts %}
<div class="mio__container mio__news__preview">
<div class="mio__container__title mio__news__preview__title">
{{ post.post_title }}
</div>
<div class="mio__container__content mio__news__preview__content">
<div class="mio__news__preview__text">
{{ post.post_text|first_paragraph }}
</div>
<div class="mio__news__preview__info">
Posted on {{ post.created_at }} by {{ post.user.username }}
</div>
</div>
</div>
{{ news_preview(post) }}
{% endfor %}
</div>
<div class="mio__news__category__menu">
<div class="mio__news__category__listing">
{% for featured_post in featured %}
<a href="/news.php?n={{ featured_post.post_id }}">{{ featured_post.post_title }}</a>
{% endfor %}
</div>
<div class="mio__news__category__pagination">
pagination here
</div>
<div class="news__sidebar">
{% if category.category_description|length > 0 %}
<div class="container news__container">
<div class="container__title">
Description
</div>
<div class="container__content">
{{ category.category_description }}
</div>
</div>
{% endif %}
{% if featured|length > 0 %}
<div class="container news__list">
<div class="container__title">
Featured Posts
</div>
<div class="container__content">
{% for featured_post in featured %}
<a class="news__list__item" href="/news.php?n={{ featured_post.post_id }}">{{ featured_post.post_title }}</a>
{% endfor %}
</div>
</div>
{% endif %}
{{ paginate(posts, '?c=' ~ category.category_id, 'news__') }}
</div>
</div>
</div>

View file

@ -1,38 +1,44 @@
{% extends '@mio/news/master.twig' %}
{% from '@mio/macros.twig' import paginate %}
{% from '@mio/news/macros.twig' import news_preview %}
{% set title = 'News' %}
{% set canonical_url = '/news.php' %}
{% set canonical_url = '/news.php' ~ (page_id > 1 ? '?p=' ~ page_id : '') %}
{% block news_content %}
<div class="mio__container">
<div class="mio__container__title">News</div>
<div class="mio__container__content">
<div class="mio__news__category__posts">
<div class="container news__container">
<div class="container__title news__container__title">News</div>
<div class="container__content news__container__content">
<div class="news__preview__listing">
{% for post in posts %}
<div class="mio__container mio__news__preview">
<div class="mio__container__title mio__news__preview__title">
{{ post.post_title }}
</div>
<div class="mio__container__content mio__news__preview__content">
<div class="mio__news__preview__text">
{{ post.post_text|first_paragraph }}
</div>
<div class="mio__news__preview__info">
Posted on {{ post.created_at }} by {{ post.user.username }}
</div>
</div>
</div>
{{ news_preview(post) }}
{% endfor %}
</div>
<div class="mio__news__category__menu">
<div class="mio__news__category__listing">
{% for category in categories %}
<a href="/news.php?c={{ category.category_id }}">{{ category.category_name }}</a>
{% endfor %}
</div>
<div class="mio__news__category__pagination">
pagination here
<div class="news__sidebar">
<div class="container news__list">
<div class="container__title">
Categories
</div>
<div class="container__content">
{% for category in categories %}
{% set post_count = category.posts.count %}
{% if post_count > 0 %}
<a class="news__list__item news__list__item--kvp" href="/news.php?c={{ category.category_id }}">
<div class="news__list__name">
{{ category.category_name }}
</div>
<div class="news__list__value">
{{ post_count }} post{{ post_count == 1 ? '' : 's' }}
</div>
</a>
{% endif %}
{% endfor %}
</div>
</div>
{{ paginate(posts, '', 'news__') }}
</div>
</div>
</div>

View file

@ -0,0 +1,22 @@
{% macro news_preview(post) %}
<div class="container news__preview">
<a href="/news.php?n={{ post.post_id }}" class="container__title container__title--link news__preview__title">
{{ post.post_title }}
</a>
<div class="container__content news__preview__content">
<div class="news__preview__text">
{{ post.html|first_paragraph|raw }}
<p><b><i><a href="/news.php?n={{ post.post_id }}">View full post</a></i></b></p>
</div>
<div class="news__preview__info">
<div class="news__preview__date">
{{ post.created_at }}
</div>
<a class="news__preview__user" href="/profile.php?u={{ post.user.user_id }}">
<div class="news__preview__user__name">{{ post.user.username }}</div>
<div class="avatar news__preview__user__avatar" style="background-image:url('/profile.php?u={{ post.user.user_id }}&amp;m=avatar')"></div>
</a>
</div>
</div>
</div>
{% endmacro %}

View file

@ -3,9 +3,9 @@
{% block content %}
{% block news_content %}
<div class="mio__container">
<div class="mio__container__title">News!</div>
<div class="mio__container__content">
<div class="container">
<div class="container__title">News!</div>
<div class="container__content">
<p>Welcome to News, the news is still heavily in development. You can follow us on News where we'll post news every so often, we'll also announce when the news is ready for public use there!</p>
</div>
</div>

View file

@ -4,26 +4,60 @@
{% set canonical_url = '/news.php?n=' ~ post.post_id %}
{% block news_content %}
<div class="mio__container">
<div class="mio__container__title">{{ post.category.category_name }} » {{ post.post_title }}</div>
<div class="mio__container__content">
<div class="mio__news__post__text">
{{ post.post_text|raw }}
<div class="container news__post">
<div class="container__title">
<a href="/news.php?c={{ post.category.category_id }}" class="container__title__link">{{ post.category.category_name }}</a> »
{{ post.post_title }}
</div>
<div class="container__content news__post__content">
<div class="news__post__text">
{{ post.html|raw }}
</div>
<div class="mio__news__post__info">
<div class="mio__news__post__user">
<div class="mio__news__post__username">
{{ post.user.username }}
<div class="news__sidebar news__post__details">
<a class="news__post__detail news__post__user" href="/profile.php?u={{ post.user.user_id }}">
<div class="news__post__username">{{ post.user.username }}</div>
<div class="avatar news__post__avatar" style="background-image:url('/profile.php?u={{ post.user.user_id }}&amp;m=avatar');"></div>
</a>
<a class="news__post__detail news__post__info" href="/news.php?c={{ post.category.category_id }}">
<div class="news__post__info__name">
Category
</div>
<div class="news__post__info__value">
{{ post.category.category_name }}
</div>
</a>
<div class="news__post__detail news__post__info">
<div class="news__post__info__name">
Posted
</div>
<div class="news__post__info__value">
{{ post.created_at }}
</div>
<div class="mio__news__post__avatar" style="background-image:url('/profile.php?u={{ post.user.user_id }}&amp;m=avatar');"></div>
</div>
<div class="mio__news__post__info">
Category: <a href="/news.php?c={{ post.category.category_id }}">{{ post.category.category_name }}</a>
</div>
<div class="mio__news__post__info">
Posted: {{ post.created_at }}
</div>
{# TODO: make this work
{% if post.updated_at is defined %}
<div class="news__post__detail news__post__info">
<div class="news__post__info__name">
Updated
</div>
<div class="news__post__info__value">
{{ post.updated_at }}
</div>
</div>
{% endif %} #}
</div>
</div>
</div>
<div class="container">
<div class="container__title">Comments</div>
<div class="container__content">
Eventually&trade;
</div>
</div>
{% endblock %}

View file

@ -1,103 +1,105 @@
{% extends '@mio/settings/master.twig' %}
{% block settings_content %}
<form method="post" action="?m=account" class="mio__settings__account">
<div class="mio__settings__account__row">
<div class="mio__settings__account__column">
<div class="mio__settings__account__title">Profile</div>
<form method="post" action="?m=account" class="settings__account">
<div class="settings__account__row">
<div class="settings__account__column">
<div class="settings__account__title">Profile</div>
{% for name, props in settings_profile_fields %}
<label class="mio__settings__account__input mio__settings__account__input--{{ name }}">
<div class="mio__settings__account__input__name">
<label class="settings__account__input settings__account__input--{{ name }}">
<div class="settings__account__input__name">
{{ props.name }}
</div>
<div class="mio__settings__account__input__value">
<input type="{{ props.type|default('text') }}" name="profile[{{ name }}]" value="{{ settings_user['user_' ~ name] }}" class="mio__input__text mio__settings__account__input__value__text">
<div class="settings__account__input__value">
<input type="{{ props.type|default('text') }}" name="profile[{{ name }}]" value="{{ settings_user['user_' ~ name] }}" class="input__text settings__account__input__value__text">
</div>
</label>
{% endfor %}
</div>
<div class="mio__settings__account__column mio__settings__account__column--no-margin">
{% if prevent_registration %}
<div class="mio__settings__account__row">
<div class="mio__settings__account__column">
<div class="mio__settings__account__title">E-mail and Password changing</div>
<div style="text-align: center; padding: 5px;"> <!-- PUT CSS IN CSS FILE -->
<a class="mio__input__button" href="https://flashii.net/settings.php?m=account">visit main site</a>
{% if prevent_registration %}
<div class="settings__account__column settings__account__column--no-margin settings__account__column--disabled">
<div class="settings__account__row">
<div class="settings__account__column">
<div class="settings__account__title">E-mail and Password changing</div>
<div class="settings__account__disabled">
<a class="input__button" href="https://flashii.net/settings.php?m=account">visit main site</a>
</div>
</div>
</div>
{% else %}
<div class="mio__settings__account__row">
<div class="mio__settings__account__column">
<div class="mio__settings__account__title">E-mail</div>
</div>
{% else %}
<div class="settings__account__column settings__account__column--no-margin">
<div class="settings__account__row">
<div class="settings__account__column">
<div class="settings__account__title">E-mail</div>
<label class="mio__settings__account__input">
<div class="mio__settings__account__input__name">
<label class="settings__account__input">
<div class="settings__account__input__name">
New E-mail Address
</div>
<div class="mio__settings__account__input__value">
<input type="text" name="email[new]" class="mio__input__text mio__settings__account__input__value__text">
<div class="settings__account__input__value">
<input type="text" name="email[new]" class="input__text settings__account__input__value__text">
</div>
</label>
<label class="mio__settings__account__input">
<div class="mio__settings__account__input__name">
<label class="settings__account__input">
<div class="settings__account__input__name">
Confirmation
</div>
<div class="mio__settings__account__input__value">
<input type="text" name="email[confirm]" class="mio__input__text mio__settings__account__input__value__text">
<div class="settings__account__input__value">
<input type="text" name="email[confirm]" class="input__text settings__account__input__value__text">
</div>
</label>
</div>
</div>
<div class="mio__settings__account__row">
<div class="mio__settings__account__column">
<div class="mio__settings__account__title">Password</div>
<div class="settings__account__row">
<div class="settings__account__column">
<div class="settings__account__title">Password</div>
<label class="mio__settings__account__input">
<div class="mio__settings__account__input__name">
<label class="settings__account__input">
<div class="settings__account__input__name">
New Password
</div>
<div class="mio__settings__account__input__value">
<input type="password" name="password[new]" class="mio__input__text mio__settings__account__input__value__text">
<div class="settings__account__input__value">
<input type="password" name="password[new]" class="input__text settings__account__input__value__text">
</div>
</label>
<label class="mio__settings__account__input">
<div class="mio__settings__account__input__name">
<label class="settings__account__input">
<div class="settings__account__input__name">
Confirmation
</div>
<div class="mio__settings__account__input__value">
<input type="password" name="password[confirm]" class="mio__input__text mio__settings__account__input__value__text">
<div class="settings__account__input__value">
<input type="password" name="password[confirm]" class="input__text settings__account__input__value__text">
</div>
</label>
</div>
</div>
<div class="mio__settings__account__row">
<div class="mio__settings__account__column">
<div class="mio__settings__account__title">Confirmation</div>
<div class="settings__account__row">
<div class="settings__account__column">
<div class="settings__account__title">Confirmation</div>
<label class="mio__settings__account__input">
<div class="mio__settings__account__input__name">
<label class="settings__account__input">
<div class="settings__account__input__name">
Current Password
</div>
<div class="mio__settings__account__input__value">
<input type="password" name="current_password" placeholder="only needed for e-mail and password updating" class="mio__input__text mio__settings__account__input__value__text">
<div class="settings__account__input__value">
<input type="password" name="current_password" placeholder="only needed for e-mail and password updating" class="input__text settings__account__input__value__text">
</div>
</label>
</div>
</div>
{% endif %}
</div>
</div>
{% endif %}
</div>
<div class="mio__settings__account__row mio__settings__account__row--buttons">
<button class="mio__input__button" name="csrf" value="{{ csrf_token() }}">Update</button>
<button class="mio__input__button" type="reset">Reset</button>
<div class="settings__account__row settings__account__row--buttons">
<button class="input__button" name="csrf" value="{{ csrf_token() }}">Update</button>
<button class="input__button" type="reset">Reset</button>
</div>
</form>
{% endblock %}

View file

@ -1,10 +1,10 @@
{% extends '@mio/settings/master.twig' %}
{% block settings_content %}
<div class="mio__settings__avatar">
<div class="mio__settings__avatar__sections">
<div class="mio__settings__avatar__requirements">
<ul class="mio__settings__avatar__requirements__list">
<div class="settings__avatar">
<div class="settings__avatar__sections">
<div class="settings__avatar__requirements">
<ul class="settings__avatar__requirements__list">
<li>Your avatar may not be larger than <strong>{{ avatar_max_width }}x{{ avatar_max_height }}</strong>.</li>
<li>The avatar will be centre cropped to be <strong>200x200</strong>.</li>
<li>Your avatar may not exceed the <strong>{{ avatar_max_filesize|byte_symbol(true) }}</strong> filesize limit.</li>
@ -12,26 +12,26 @@
<li>Keep things sane and suitable for all ages.</li>
</ul>
</div>
<div class="mio__settings__avatar__forms">
<form class="mio__settings__avatar__form" method="post" action="?m=avatar" enctype="multipart/form-data">
<div class="settings__avatar__forms">
<form class="settings__avatar__form" method="post" action="?m=avatar" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="{{ avatar_max_filesize }}">
<label class="mio__input__upload__label">
<input accept="image/png,image/jpeg,image/gif" type="file" name="avatar" class="mio__input__upload" id="avatar-selection">
<label class="input__upload__label">
<input accept="image/png,image/jpeg,image/gif" type="file" name="avatar" class="input__upload" id="avatar-selection">
Pick file...
</label>
<button class="mio__input__button" name="upload" value="{{ csrf_token() }}">Upload</button>
<button class="input__button" name="upload" value="{{ csrf_token() }}">Upload</button>
</form>
<form class="mio__settings__avatar__form" method="post" action="?m=avatar">
<form class="settings__avatar__form" method="post" action="?m=avatar">
{% if user_has_avatar %}
<button class="mio__input__button" name="delete" value="{{ csrf_token() }}">Delete</button>
<button class="input__button" name="delete" value="{{ csrf_token() }}">Delete</button>
{% else %}
<button class="mio__input__button" name="import" value="{{ csrf_token() }}">Import old avatar</button>
<button class="input__button" name="import" value="{{ csrf_token() }}">Import old avatar</button>
{% endif %}
</form>
</div>
</div>
<div class="mio__settings__avatar__preview__container">
<div class="mio__avatar mio__settings__avatar__preview" id="avatar-preview" style="background-image:url('/profile.php?u={{ settings_user.user_id }}&amp;m=avatar')"></div>
<div class="settings__avatar__preview__container">
<div class="avatar settings__avatar__preview" id="avatar-preview" style="background-image:url('/profile.php?u={{ settings_user.user_id }}&amp;m=avatar')"></div>
</div>
</div>
<script>

View file

@ -1,46 +1,46 @@
{% extends '@mio/settings/master.twig' %}
{% block settings_content %}
<div class="mio__settings__description">
<div class="settings__description">
<p>These are all the login attempts to your account. If any attempt that you don't recognise is marked as successful your account may be compromised, ask a staff member for advice in this case.</p>
</div>
<div class="mio__settings__login-history">
<div class="settings__login-history">
{% for attempt in user_login_attempts %}
<div class="mio__settings__login-history__entry" id="attempt-{{ attempt.attempt_id }}">
<div class="mio__settings__login-history__column mio__settings__login-history__column--ip">
<div class="mio__settings__login-history__column__name">
<div class="settings__login-history__entry" id="attempt-{{ attempt.attempt_id }}">
<div class="settings__login-history__column settings__login-history__column--ip">
<div class="settings__login-history__column__name">
IP
</div>
<div class="mio__settings__login-history__column__value">
<div class="settings__login-history__column__value">
{{ attempt.attempt_ip.string }}
{% if attempt.attempt_country != 'XX' %}
<img class="mio__settings__login-history__country" src="https://static.flash.moe/flags/fff/{{ attempt.attempt_country|lower }}.png" alt="{{ attempt.attempt_country }}" title="{{ attempt.attempt_country|country_name }}">
<img class="settings__login-history__country" src="https://static.flash.moe/flags/fff/{{ attempt.attempt_country|lower }}.png" alt="{{ attempt.attempt_country }}" title="{{ attempt.attempt_country|country_name }}">
{% endif %}
</div>
</div>
<div class="mio__settings__login-history__column mio__settings__login-history__column--success">
<div class="mio__settings__login-history__column__name">
<div class="settings__login-history__column settings__login-history__column--success">
<div class="settings__login-history__column__name">
Was Successful?
</div>
<div class="mio__settings__login-history__column__value mio__settings__login-history__column__value--{{ attempt.was_successful ? 'successful' : 'failed' }}">
<div class="settings__login-history__column__value settings__login-history__column__value--{{ attempt.was_successful ? 'successful' : 'failed' }}">
{{ attempt.was_successful ? 'Yes' : 'No' }}
</div>
</div>
<div class="mio__settings__login-history__column mio__settings__login-history__column--created" onmouseenter="this.children[1].textContent = '{{ attempt.created_at }}';" onmouseleave="this.children[1].textContent = '{{ attempt.created_at.diffForHumans }}';">
<div class="mio__settings__login-history__column__name">
<div class="settings__login-history__column settings__login-history__column--created" onmouseenter="this.children[1].textContent = '{{ attempt.created_at }}';" onmouseleave="this.children[1].textContent = '{{ attempt.created_at.diffForHumans }}';">
<div class="settings__login-history__column__name">
Attempted
</div>
<div class="mio__settings__login-history__column__value">
<div class="settings__login-history__column__value">
{{ attempt.created_at.diffForHumans }}
</div>
</div>
{% if attempt.user_agent|length > 0 %}
<div class="mio__settings__login-history__column mio__settings__login-history__column--user_agent">
<div class="mio__settings__login-history__column__name">
<div class="settings__login-history__column settings__login-history__column--user_agent">
<div class="settings__login-history__column__name">
User Agent
</div>
<div class="mio__settings__login-history__column__value">
<div class="settings__login-history__column__value">
{{ attempt.user_agent }}
</div>
</div>

View file

@ -8,21 +8,21 @@
{% block settings_container %}
{% if settings_errors is defined and settings_errors|length > 0 %}
<div class="mio__container">
<div class="mio__container__title">Information</div>
<div class="mio__container__content">
<ul class="mio__settings__errors">
<div class="container">
<div class="container__title">Information</div>
<div class="container__content">
<ul class="settings__errors">
{% for error in settings_errors %}
<li class="mio__settings__errors__entry">{{ error }}</li>
<li class="settings__errors__entry">{{ error }}</li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
<div class="mio__container mio__settings mio__settings--{{ settings_mode }}">
<div class="mio__container__title mio__settings__title mio__settings__title--{{ settings_mode }}">{{ title }}</div>
<div class="mio__container__content mio__settings__content mio__settings__content--{{ settings_mode }}">
<div class="container settings settings--{{ settings_mode }}">
<div class="container__title settings__title settings__title--{{ settings_mode }}">{{ title }}</div>
<div class="container__content settings__content settings__content--{{ settings_mode }}">
{% block settings_content %}
This is a blank settings page.
{% endblock %}

View file

@ -1,54 +1,54 @@
{% extends '@mio/settings/master.twig' %}
{% block settings_content %}
<div class="mio__settings__description">
<div class="settings__description">
<p>These are the active logins to your account, clicking the Kill button will force a logout on that session. Your current login is highlighted with a darker purple so you don't accidentally force yourself to logout.</p>
</div>
<div class="mio__settings__sessions">
<div class="settings__sessions">
{% for session in user_sessions %}
<div class="mio__settings__sessions__entry{% if session.session_id == settings_session.session_id %} mio__settings__sessions__entry--current{% endif %}" id="session-{{ session.session_id }}">
<div class="mio__settings__sessions__column mio__settings__sessions__column--ip">
<div class="mio__settings__sessions__column__name">
<div class="settings__sessions__entry{% if session.session_id == settings_session.session_id %} settings__sessions__entry--current{% endif %}" id="session-{{ session.session_id }}">
<div class="settings__sessions__column settings__sessions__column--ip">
<div class="settings__sessions__column__name">
IP
</div>
<div class="mio__settings__sessions__column__value">
<div class="settings__sessions__column__value">
{{ session.session_ip.string }}
{% if session.session_country != 'XX' %}
<img class="mio__settings__sessions__country" src="https://static.flash.moe/flags/fff/{{ session.session_country|lower }}.png" alt="{{ session.session_country }}" title="{{ session.session_country|country_name }}">
<img class="settings__sessions__country" src="https://static.flash.moe/flags/fff/{{ session.session_country|lower }}.png" alt="{{ session.session_country }}" title="{{ session.session_country|country_name }}">
{% endif %}
</div>
</div>
<div class="mio__settings__sessions__column mio__settings__sessions__column--created" onmouseenter="this.children[1].textContent = '{{ session.created_at }}';" onmouseleave="this.children[1].textContent = '{{ session.created_at.diffForHumans }}';">
<div class="mio__settings__sessions__column__name">
<div class="settings__sessions__column settings__sessions__column--created" onmouseenter="this.children[1].textContent = '{{ session.created_at }}';" onmouseleave="this.children[1].textContent = '{{ session.created_at.diffForHumans }}';">
<div class="settings__sessions__column__name">
Created
</div>
<div class="mio__settings__sessions__column__value">
<div class="settings__sessions__column__value">
{{ session.created_at.diffForHumans }}
</div>
</div>
<div class="mio__settings__sessions__column mio__settings__sessions__column--expires" onmouseenter="this.children[1].textContent = '{{ session.expires_on }}';" onmouseleave="this.children[1].textContent = '{{ session.expires_on.diffForHumans }}';">
<div class="mio__settings__sessions__column__name">
<div class="settings__sessions__column settings__sessions__column--expires" onmouseenter="this.children[1].textContent = '{{ session.expires_on }}';" onmouseleave="this.children[1].textContent = '{{ session.expires_on.diffForHumans }}';">
<div class="settings__sessions__column__name">
Expires
</div>
<div class="mio__settings__sessions__column__value">
<div class="settings__sessions__column__value">
{{ session.expires_on.diffForHumans }}
</div>
</div>
{% if session.user_agent|length > 0 %}
<div class="mio__settings__sessions__column mio__settings__sessions__column--user_agent">
<div class="mio__settings__sessions__column__name">
<div class="settings__sessions__column settings__sessions__column--user_agent">
<div class="settings__sessions__column__name">
User Agent
</div>
<div class="mio__settings__sessions__column__value">
<div class="settings__sessions__column__value">
{{ session.user_agent }}
</div>
</div>
{% endif %}
<form class="mio__settings__sessions__column mio__settings__sessions__column--options" method="post" action="?m=sessions">
<form class="settings__sessions__column settings__sessions__column--options" method="post" action="?m=sessions">
<input type="hidden" name="csrf" value="{{ csrf_token() }}">
<input type="hidden" name="session" value="{{ session.session_id }}">
<button class="mio__input__button mio__settings__sessions__button">Kill</button>
<button class="input__button settings__sessions__button">Kill</button>
</form>
</div>
{% endfor %}

View file

@ -4,9 +4,9 @@
{% set title = 'User not found!' %}
{% block content %}
<div class="mio__container">
<div class="mio__container__title">User not found!</div>
<div class="mio__container__content">
<div class="container">
<div class="container__title">User not found!</div>
<div class="container__content">
<p>Check the url and try again.</p>
</div>
</div>

View file

@ -64,29 +64,29 @@
{% block content %}
{{ navigation(mio_navigation, false, true) }}
<div class="mio__profile">
<div class="mio__container mio__profile__header">
<div class="mio__container__title">Profile of {{ profile.username }}</div>
<div class="mio__container__content mio__profile__header__content">
<div class="mio__profile__info">
<div class="mio__profile__info__section">
<div class="mio__profile__info__block">
<div class="mio__profile__info__row">
<div class="mio__profile__info__column mio__profile__info__column--icons">
<img class="mio__profile__icon" src="https://static.flash.moe/flags/fff/{{ profile.user_country|lower }}.png" alt="{{ profile.user_country }}">
<div class="profile">
<div class="container profile__header">
<div class="container__title">Profile of {{ profile.username }}</div>
<div class="container__content profile__header__content">
<div class="profile__info">
<div class="profile__info__section">
<div class="profile__info__block">
<div class="profile__info__row">
<div class="profile__info__column profile__info__column--icons">
<img class="profile__icon" src="https://static.flash.moe/flags/fff/{{ profile.user_country|lower }}.png" alt="{{ profile.user_country }}">
</div>
<div class="mio__profile__info__column mio__profile__info__column--country">
<div class="profile__info__column profile__info__column--country">
{{ profile.user_country|country_name }}
</div>
</div>
</div>
<div class="mio__profile__info__block">
<div class="mio__profile__info__row" title="{{ profile.created_at.format('r') }}">
<div class="mio__profile__info__column mio__profile__info__column--heading">
<div class="profile__info__block">
<div class="profile__info__row" title="{{ profile.created_at.format('r') }}">
<div class="profile__info__column profile__info__column--heading">
Joined
</div>
<div class="mio__profile__info__column">
<div class="profile__info__column">
{{ profile.created_at.diffForHumans }}
</div>
</div>
@ -95,18 +95,18 @@
{% if app.session != null %}
{% spaceless %}
<div class="mio__profile__info__section">
<div class="mio__profile__info__block mio__profile__info__block--links">
<div class="profile__info__section">
<div class="profile__info__block profile__info__block--links">
{% for name, data in profile_fields %}
{% if (data.display is defined ? data.display : true) and data.value|length > 0 %}
<div class="mio__profile__info__row mio__profile__info__row--field-{{ name }}">
<div class="mio__profile__info__column mio__profile__info__column--heading">
<div class="profile__info__row profile__info__row--field-{{ name }}">
<div class="profile__info__column profile__info__column--heading">
{{ data.title }}
</div>
<div class="mio__profile__info__column">
<div class="profile__info__column">
{% set profile_field_value = (data.format is defined ? data.format : '%s')|format(data.value) %}
{% if data.link is defined %}
{{ link(data.link|format(data.value), profile_field_value, 'mio__profile__account-link') }}
{{ link(data.link|format(data.value), profile_field_value, 'profile__account-link') }}
{% else %}
{{ profile_field_value }}
{% endif %}
@ -119,7 +119,7 @@
{% endspaceless %}
{% endif %}
</div>
<div class="mio__avatar mio__profile__avatar" style="background-image:url('{{ image }}');"></div>
<div class="avatar profile__avatar" style="background-image:url('{{ image }}');"></div>
</div>
</div>
</div>