Skip to content

Commit

Permalink
Merge pull request #41 from brendt/minor-layout-tweaks-2019-02-13
Browse files Browse the repository at this point in the history
Minor layout tweaks
  • Loading branch information
brendt committed Feb 13, 2019
2 parents b1d212a + 9eda7a2 commit 17e6980
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 88 deletions.
3 changes: 1 addition & 2 deletions app/App/Http/ViewModels/PostsViewModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ public function title(): ?string

public function donationIndex(): int
{
return 4;
// return rand(4, $this->posts->count() - 4);
return rand(4, $this->posts->count() - 4);
}
}
3 changes: 2 additions & 1 deletion resources/css/components/link.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
}

.link-active {
color: #000;
color: var(--black);
text-decoration: underline;
}
1 change: 1 addition & 0 deletions resources/views/components/postButton.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<form
action="{{ $action }}"
method="post"
@if(isset($inline) && $inline) class="inline-block" @endif
>
@csrf

Expand Down
31 changes: 12 additions & 19 deletions resources/views/components/postCard.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ class="text-xl font-bold font-title post-link {{ $user && $user->hasViewed($post
</a>
</p>

<p class="text-grey-dark text-sm">
<div class="text-grey-darker text-sm">
<a href="{{ action([\App\Http\Controllers\PostsController::class, 'source'], $post->source->website) }}" class="link">{{ $post->source->website }}</a>
on
{{ $post->relative_date }}

@if ($post->view_count > 0)
Expand All @@ -31,7 +31,16 @@ class="text-xl font-bold font-title post-link {{ $user && $user->hasViewed($post
{{ __(':view_count views', ['view_count' => $post->view_count]) }}
@endif
@endif
</p>

@if ($user)
@if(! $user->hasMuted($post->source))
<post-button :action="$post->source->getMuteUrl()" :inline="true">
{{ __('Mute source') }}
</post-button>
@endif
@endif
</div>

<div class="flex items-baseline mt-2">
@if($post->tags->isNotEmpty())
Expand All @@ -41,22 +50,6 @@ class="text-xl font-bold font-title post-link {{ $user && $user->hasViewed($post
@endforeach
</p>
@endif

@if ($user)
@if(! $user->hasMuted($post->source))
<post-button
:action="$post->source->getMuteUrl()"
>
<span class="
underline
text-grey text-sm
hover:no-underline
">
{{ __('Mute source') }}
</span>
</post-button>
@endif
@endif
</div>
</div>

Expand Down
4 changes: 0 additions & 4 deletions resources/views/components/postList.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
:last="$loop->last"
></post-card>
@endforeach

@if($posts->isEmpty())
{{ __('Nothing to see here!') }}
@endif
</section>

{{ $posts->render() }}
105 changes: 52 additions & 53 deletions resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,77 +30,71 @@
<a href="{{ url('/') }}" class="font-title text-2xl text-primary font-bold">aggregate</a>
<span class="bg-black text-white rounded text-xs ml-2" style="padding: 0.25rem 0.25rem 0.1rem; margin-top: 0.15rem">beta</span>
</header>
<ul class="text-sm sticky" style="bottom: 1rem">
<li class="mb-3">
<a href="{{ action([\App\Http\Controllers\PostsController::class, 'index']) }}">
{{ __('All posts') }}
</a>
<ul class="text-sm text-grey-darker sticky" style="bottom: 1rem">
<li class="mb-2">
<active-link :href="action([\App\Http\Controllers\PostsController::class, 'index'])">
{{ __('Feed') }}
</active-link>
</li>
@if(current_user())
<li class="mb-3">
<a href="{{ action([\App\Http\Controllers\UserSourcesController::class, 'index']) }}">
<li class="mb-2">
<active-link :href="action([\App\Http\Controllers\UserSourcesController::class, 'index'])">
{{ __('My content') }}
</a>
</active-link>
</li>
<li class="mb-3">
<a href="{{ action([\App\Http\Controllers\UserMutesController::class, 'index']) }}">
<li class="mb-2">
<active-link :href="action([\App\Http\Controllers\UserMutesController::class, 'index'])">
{{ __('Mutes') }}
</a>
</active-link>
</li>
@if(current_user()->isAdmin())
<li class="mb-3">
<a href="{{ action([\App\Http\Controllers\AdminSourcesController::class, 'index']) }}">
{{ __('Admin') }}
</a>
</li>
<li class="mb-3">
<a href="/horizon" target="_blank" rel="noopener noreferrer">
{{ __('Horizon') }}
</a>
</li>
@endif
<li class="mb-3">
<li class="mb-2">
<a href="{{ action([\App\Http\Controllers\UserProfileController::class, 'index']) }}">
{{ __('Profile') }}
</a>
</li>
<li class="mb-3">
<li>
<a href="{{ action([\App\Http\Controllers\Auth\LogoutController::class, 'logout']) }}">
{{ __('Log out') }}
</a>
</li>
@if(current_user()->isAdmin())
<li class="mt-6 mb-2">
<active-link :href="action([\App\Http\Controllers\AdminSourcesController::class, 'index'])">
{{ __('Admin') }}
</active-link>
</li>
<li>
<active-link href="/horizon" target="_blank" rel="noopener noreferrer">
{{ __('Horizon') }}
</active-link>
</li>
@endif
@else
<li class="mb-3">
<a href="{{ action([\App\Http\Controllers\Auth\LoginController::class, 'login']) }}">
<i class="fas fa-sign-in-alt w-6 opacity-75"></i> {{ __('Log in') }}
</a>
<li class="mb-2">
<active-link :href="action([\App\Http\Controllers\Auth\LoginController::class, 'login'])">
{{ __('Log in') }}
</active-link>
</li>
<li class="mb-3">
<a href="{{ action([\App\Http\Controllers\Auth\RegisterController::class, 'register']) }}">
<i class="fas fa-user-plus w-6 opacity-75"></i> {{ __('Register') }}
</a>
<li class="mb-2">
<active-link :href="action([\App\Http\Controllers\Auth\RegisterController::class, 'register'])">
{{ __('Register') }}
</active-link>
</li>
@endif

@if(! current_user())
<li class="mb-3">
<a href="{{ action([\App\Http\Controllers\Auth\RegisterController::class, 'showRegistrationForm']) }}">
<i class="fas fa-plus-circle w-6 opacity-75"></i> {{ __('Submit your blog') }}
</a>
<li class="mb-2">
<active-link :href="action([\App\Http\Controllers\Auth\RegisterController::class, 'showRegistrationForm'])">
{{ __('Submit your blog') }}
</active-link>
</li>
@elseif(! current_user()->getPrimarySource())
<li class="mb-3">
<a href="{{ action([\App\Http\Controllers\UserSourcesController::class, 'index']) }}">
<i class="fas fa-pencil-alt w-6 opacity-75"></i> {{ __('Submit your blog') }}
</a>
<li class="mb-2">
<active-link :href="action([\App\Http\Controllers\UserSourcesController::class, 'index'])">
{{ __('Submit your blog') }}
</active-link>
</li>
@endif

<li>
<a href="https://github.com/brendt/aggregate.stitcher.io/issues" target="_blank" rel="noopener noreferrer">
<i class="fas fa-bug w-6 opacity-75"></i> {{ __('Report an issue') }}
</a>
</li>
</ul>
</nav>

Expand All @@ -113,20 +107,25 @@
</div>

<footer class="pt-4 bg-black text-grey text-sm">
<div class="w-full max-w-lg ml-16">
<div class="w-2/3 ml-auto">
<span>
<div class="max-w-lg ml-16">
<ul class="flex w-2/3 ml-auto">
<li>
&copy; {{ now()->format('Y') }}
<a href="https://stitcher.io" target="_blank" rel="noopener noreferrer">
stitcher.io
</a>
</span>
<span class="ml-6">
</li>
<li class="ml-6">
<a href="{{ action(\App\Http\Controllers\PrivacyController::class) }}">
Privacy &amp; disclaimer
</a>
</li>
<li class="ml-6">
<a href="https://github.com/brendt/aggregate.stitcher.io/issues" target="_blank" rel="noopener noreferrer">
{{ __('Report an issue') }}
</a>
</span>
</div>
</ul>
</div>
</footer>

Expand Down
2 changes: 1 addition & 1 deletion resources/views/layouts/pagination.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/** @var \Illuminate\Pagination\LengthAwarePaginator $paginator */
@endphp

<nav class="text-sm text-grey-dark leading-normal pt-2 flex items-center justify-between w-full">
<nav class="text-sm text-grey-darker leading-normal pt-2 flex items-center justify-between w-full">
<div>
@if($paginator->previousPageUrl())
<a
Expand Down
12 changes: 4 additions & 8 deletions resources/views/posts/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
'title' => $title,
])
<div class="flex items-baseline justify-between">
<nav class="text-sm text-grey-dark leading-normal pt-2 h-12 flex items-center justify-between border-b border-grey-lighter w-full">
<ul class="flex">
<nav class="text-sm text-grey-darker leading-normal pt-2 h-12 flex items-center justify-between border-b border-grey-lighter w-full">
<ul class="flex w-full">
<li class="mr-6">
<active-link
:href="action([\App\Http\Controllers\PostsController::class, 'index'])"
Expand All @@ -32,15 +32,11 @@
{{ __('Top this week') }}
</active-link>
</li>
</ul>

<ul>
<li>
<li class="ml-auto">
<a
href="{{ action([\App\Http\Controllers\GuestSourcesController::class, 'index']) }}"
class="text-green"
>
{{ __('Suggest a blog') }}
<i class="far fa-lightbulb mr-2"></i>{{ __('Suggest a blog') }}
</a>
</li>
</ul>
Expand Down

0 comments on commit 17e6980

Please sign in to comment.