Browse Source

Styles

imwald
Nuša Pukšič 1 year ago
parent
commit
b1a1934e72
  1. 1
      assets/app.js
  2. 14
      assets/styles/app.css
  3. 7
      assets/styles/article.css
  4. 1
      assets/styles/card.css
  5. 6
      src/Controller/AuthorController.php
  6. 2
      templates/components/Molecules/Card.html.twig

1
assets/app.js

@ -9,6 +9,7 @@ import './styles/theme.css';
import './styles/app.css'; import './styles/app.css';
import './styles/layout.css'; import './styles/layout.css';
import './styles/button.css'; import './styles/button.css';
import './styles/card.css';
import './styles/article.css'; import './styles/article.css';
import './styles/form.css'; import './styles/form.css';

14
assets/styles/app.css

@ -13,7 +13,7 @@ body {
h1, h2, h3, h4, h5, h6 { h1, h2, h3, h4, h5, h6 {
font-family: var(--heading-font), serif; font-family: var(--heading-font), serif;
font-weight: 300; font-weight: 400;
line-height: 1.1; line-height: 1.1;
color: var(--color-primary); color: var(--color-primary);
margin: 0 0 10px; margin: 0 0 10px;
@ -49,8 +49,11 @@ p {
} }
.lede { .lede {
font-size: 1.5rem; font-family: var(--main-body-font), serif;
font-size: 1.6rem;
word-wrap: break-word; word-wrap: break-word;
margin: 20px 0;
font-weight: 300;
} }
strong, .strong { strong, .strong {
@ -145,13 +148,6 @@ svg.icon {
margin-top: 10px; margin-top: 10px;
} }
.lede {
font-size: 1.9em;
line-height: 1.25;
margin: 20px 0;
font-weight: lighter;
}
.header { .header {
text-align: center; text-align: center;
z-index: 1000; /* Ensure it stays on top */ z-index: 1000; /* Ensure it stays on top */

7
assets/styles/article.css

@ -7,14 +7,17 @@
.article-main ul, .article-main ul,
.article-main ol, .article-main ol,
.article-main blockquote, .article-main blockquote,
.article-main table, .article-main table {
.lede {
font-family: var(--main-body-font), serif; font-family: var(--main-body-font), serif;
color: var(--color-text-mid); color: var(--color-text-mid);
font-size: 1.4rem; font-size: 1.4rem;
line-height: 1.75; line-height: 1.75;
} }
.article-main .lede {
font-size: 1.9rem;
}
.article-main table { .article-main table {
font-size: 1.3rem; font-size: 1.3rem;
} }

1
assets/styles/card.css

@ -0,0 +1 @@

6
src/Controller/AuthorController.php

@ -13,10 +13,16 @@ use Symfony\Component\Routing\Attribute\Route;
class AuthorController extends AbstractController class AuthorController extends AbstractController
{ {
/**
* @throws \Exception
*/
#[Route('/p/{npub}', name: 'author-profile')] #[Route('/p/{npub}', name: 'author-profile')]
public function index($npub, EntityManagerInterface $entityManager): Response public function index($npub, EntityManagerInterface $entityManager): Response
{ {
$author = $entityManager->getRepository(User::class)->findOneBy(['npub' => $npub]); $author = $entityManager->getRepository(User::class)->findOneBy(['npub' => $npub]);
if (!$author) {
throw new \Exception('No author found');
}
$articles = $entityManager->getRepository(Article::class)->findBy(['pubkey' => $npub], ['createdAt' => 'DESC']); $articles = $entityManager->getRepository(Article::class)->findBy(['pubkey' => $npub], ['createdAt' => 'DESC']);

2
templates/components/Molecules/Card.html.twig

@ -8,6 +8,6 @@
</p> </p>
</div> </div>
<div class="card-footer"> <div class="card-footer">
<small><twig:Molecules:UserFromNpub npub="{{ article.pubkey }}" /></small> <a href="{{ path('author-profile', { npub: article.pubkey })}}"><twig:Molecules:UserFromNpub npub="{{ article.pubkey }}" /></a>
</div> </div>
</{{ tag }}> </{{ tag }}>

Loading…
Cancel
Save