Browse Source

update profile module

main
ghost 1 year ago
parent
commit
2eb0a30ed2
  1. 15
      src/app/controller/module/profile.php
  2. 43
      src/app/view/theme/default/module/profile.phtml
  3. 5
      src/public/assets/theme/default/css/framework.css

15
src/app/controller/module/profile.php

@ -35,11 +35,20 @@ class AppControllerModuleProfile
$comments = $this->_database->findUserPageCommentsDistinctTotal($user->userId); $comments = $this->_database->findUserPageCommentsDistinctTotal($user->userId);
$editions = 0; // @TODO $this->_database->findUserPageEditionsDistinctTotal($user->userId); $editions = 0; // @TODO $this->_database->findUserPageEditionsDistinctTotal($user->userId);
$identicon = false; // @TODO $this->_database->getIdenticon(24);
$public = $user->public;
$address = $user->address; $address = $user->address;
$icon = new Jdenticon\Identicon();
$icon->setValue($user->address);
$icon->setSize(16);
$icon->setStyle(
[
'backgroundColor' => 'rgba(255, 255, 255, 0)',
]
);
$identicon = $icon->getImageDataUri('webp');
include __DIR__ . '../../../view/theme/default/module/profile.phtml'; include __DIR__ . '../../../view/theme/default/module/profile.phtml';
} }
} }

43
src/app/view/theme/default/module/profile.phtml

@ -1,13 +1,16 @@
<div class="margin-y-8 padding-y-8 position-fixed width-180-px margin-l--196 background-color-night border-radius-3"> <div class="margin-y-8 position-fixed width-180-px margin-l--196 background-color-night border-radius-3">
<!-- @TODO <div class="padding-x-16 padding-y-12 border-bottom-default">
<div class="padding-8 margin-b-8 border-bottom-default"> <a href="profile">
<?php if ($public) { ?> <img class="border-radius-50 vertical-align-middle" src="<?php echo $identicon ?>" alt="identicon" />
<img class="border-radius-50 border-color-green border-width-2 margin-r-8 vertical-align-middle" src="<?php echo $identicon ?>" alt="identicon" /> <?php echo _('anon') ?>
<?php } else { ?> </a>
<img class="border-radius-50 border-color-pink border-width-2 margin-r-8 vertical-align-middle" src="<?php echo $identicon ?>" alt="identicon" /> <a class="text-color-default float-right" href="profile/setting" title="<?php echo _('Settings') ?>">
<?php } ?> <svg class="vertical-align-middle" xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-gear-fill" viewBox="0 0 16 16">
<path d="M9.405 1.05c-.413-1.4-2.397-1.4-2.81 0l-.1.34a1.464 1.464 0 0 1-2.105.872l-.31-.17c-1.283-.698-2.686.705-1.987 1.987l.169.311c.446.82.023 1.841-.872 2.105l-.34.1c-1.4.413-1.4 2.397 0 2.81l.34.1a1.464 1.464 0 0 1 .872 2.105l-.17.31c-.698 1.283.705 2.686 1.987 1.987l.311-.169a1.464 1.464 0 0 1 2.105.872l.1.34c.413 1.4 2.397 1.4 2.81 0l.1-.34a1.464 1.464 0 0 1 2.105-.872l.31.17c1.283.698 2.686-.705 1.987-1.987l-.169-.311a1.464 1.464 0 0 1 .872-2.105l.34-.1c1.4-.413 1.4-2.397 0-2.81l-.34-.1a1.464 1.464 0 0 1-.872-2.105l.17-.31c.698-1.283-.705-2.686-1.987-1.987l-.311.169a1.464 1.464 0 0 1-2.105-.872l-.1-.34zM8 10.93a2.929 2.929 0 1 1 0-5.86 2.929 2.929 0 0 1 0 5.858z"/>
</svg>
</a>
</div> </div>
--> <div class="padding-y-8">
<?php if ($route == '') { ?> <?php if ($route == '') { ?>
<span class="padding-x-16 padding-y-8 display-block background-color-green cursor-default text-color-white"> <span class="padding-x-16 padding-y-8 display-block background-color-green cursor-default text-color-white">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-house-door-fill" viewBox="0 0 16 16"> <svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-house-door-fill" viewBox="0 0 16 16">
@ -27,6 +30,27 @@
</span> </span>
</a> </a>
<?php } ?> <?php } ?>
<!--
<?php if ($route == 'setting') { ?>
<span class="padding-x-16 padding-y-8 display-block background-color-green cursor-default text-color-white">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-gear-fill" viewBox="0 0 16 16">
<path d="M9.405 1.05c-.413-1.4-2.397-1.4-2.81 0l-.1.34a1.464 1.464 0 0 1-2.105.872l-.31-.17c-1.283-.698-2.686.705-1.987 1.987l.169.311c.446.82.023 1.841-.872 2.105l-.34.1c-1.4.413-1.4 2.397 0 2.81l.34.1a1.464 1.464 0 0 1 .872 2.105l-.17.31c-.698 1.283.705 2.686 1.987 1.987l.311-.169a1.464 1.464 0 0 1 2.105.872l.1.34c.413 1.4 2.397 1.4 2.81 0l.1-.34a1.464 1.464 0 0 1 2.105-.872l.31.17c1.283.698 2.686-.705 1.987-1.987l-.169-.311a1.464 1.464 0 0 1 .872-2.105l.34-.1c1.4-.413 1.4-2.397 0-2.81l-.34-.1a1.464 1.464 0 0 1-.872-2.105l.17-.31c.698-1.283-.705-2.686-1.987-1.987l-.311.169a1.464 1.464 0 0 1-2.105-.872l-.1-.34zM8 10.93a2.929 2.929 0 1 1 0-5.86 2.929 2.929 0 0 1 0 5.858z"/>
</svg>
<span class="margin-l-4">
<?php echo _('Setting') ?>
</span>
</span>
<?php } else { ?>
<a class="padding-x-16 padding-y-8 display-block background-color-hover-night-light text-color-default" href="setting">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-gear-fill" viewBox="0 0 16 16">
<path d="M9.405 1.05c-.413-1.4-2.397-1.4-2.81 0l-.1.34a1.464 1.464 0 0 1-2.105.872l-.31-.17c-1.283-.698-2.686.705-1.987 1.987l.169.311c.446.82.023 1.841-.872 2.105l-.34.1c-1.4.413-1.4 2.397 0 2.81l.34.1a1.464 1.464 0 0 1 .872 2.105l-.17.31c-.698 1.283.705 2.686 1.987 1.987l.311-.169a1.464 1.464 0 0 1 2.105.872l.1.34c.413 1.4 2.397 1.4 2.81 0l.1-.34a1.464 1.464 0 0 1 2.105-.872l.31.17c1.283.698 2.686-.705 1.987-1.987l-.169-.311a1.464 1.464 0 0 1 .872-2.105l.34-.1c1.4-.413 1.4-2.397 0-2.81l-.34-.1a1.464 1.464 0 0 1-.872-2.105l.17-.31c.698-1.283-.705-2.686-1.987-1.987l-.311.169a1.464 1.464 0 0 1-2.105-.872l-.1-.34zM8 10.93a2.929 2.929 0 1 1 0-5.86 2.929 2.929 0 0 1 0 5.858z"/>
</svg>
<span class="margin-l-4">
<?php echo _('Setting') ?>
</span>
</a>
<?php } ?>
-->
<?php if ($route == 'stars') { ?> <?php if ($route == 'stars') { ?>
<span class="padding-x-16 padding-y-8 display-block background-color-green cursor-default text-color-white"> <span class="padding-x-16 padding-y-8 display-block background-color-green cursor-default text-color-white">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-star-fill" viewBox="0 0 16 16"> <svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-star-fill" viewBox="0 0 16 16">
@ -171,4 +195,5 @@
</span> </span>
</a> </a>
<?php } ?> <?php } ?>
</div>
</div> </div>

5
src/public/assets/theme/default/css/framework.css

@ -272,6 +272,11 @@ a:visited.background-color-hover-night-light:hover {
padding-bottom: 8px; padding-bottom: 8px;
} }
.padding-y-12 {
padding-top: 12px;
padding-bottom: 12px;
}
.padding-b-16 { .padding-b-16 {
padding-bottom: 16px; padding-bottom: 16px;
} }

Loading…
Cancel
Save