Skip to content

Commit

Permalink
Merge pull request #49 from sora1998/main
Browse files Browse the repository at this point in the history
handlebar revert and some small ui adjust
  • Loading branch information
sora1998 authored Dec 10, 2023
2 parents 9ae95f0 + c312fcb commit b9ac8c7
Show file tree
Hide file tree
Showing 9 changed files with 203 additions and 308 deletions.
56 changes: 28 additions & 28 deletions design/dashboard.handlebars
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
<div class="stream">
<header class="stream-header">
<span>{{prefs.icons.latest}} Latest</span>
<a href="/private" id="newPosts" class="unread" hidden></a>
</header>
<main id="home_stream">
{{#if activitystream}}
{{#each activitystream}}
<article class="activity">
{{#with this}}
{{#if boost}}
<section class="boost">
🚀 Boosted by
<a href="/private/feeds/{{getUsername booster.id}}">{{booster.name}}</a>
</section>
{{/if}}
{{> note note=note me=../me}}
{{/with}}
</article>
{{/each}}
{{else}}
<div class="empty">
<p>Follow some people to fill your feed with posts.</p>
<p>Suggestion: Follow
<a href="/private/feeds/[email protected]">[email protected]</a>
</p>
</div>
{{/if}}
</main>
<header>
<span>{{prefs.icons.latest}} Latest</span>
<a href="/private" id="newPosts" class="unread" hidden></a>
</header>
<div id="home_stream">
{{#if activitystream}}
{{#each activitystream}}
{{#with this}}
<div class="activity">
{{#if boost}}
<div class="boost">
🚀 boosted by <a href="/private/feeds/{{getUsername booster.id}}">{{booster.name}}</a>
</div>
{{/if}}
{{> note note=note me=../me}}
</div>
{{/with}}
{{/each}}
{{else}}
<div class="empty">
<p>Follow some people to fill your feed with posts.</p>
<p>I suggest following me!
I'm <a href="/private/feeds/[email protected]">[email protected]</a>
</p>
</div>
{{/if}}
</div>


{{#if next}}
<footer>
Expand Down
57 changes: 24 additions & 33 deletions design/dms.handlebars
Original file line number Diff line number Diff line change
@@ -1,36 +1,27 @@
<article>
{{#if error}}
<aside class="error">
{{error.message}}
</aside>
{{else}}
<section class="stream">
{{#if feed}}
<header>
<nav>
<a href="/private/dms">Inbox</a> &raquo;
Messages with
<a href="/private/feeds/{{getUsername feed.id}}">{{feed.preferredUsername}}</a>
</nav>
</header>
<div class="inbox">
<ul class="messages" id="inbox_stream">
{{#each inbox}}
<li>
{{> dm message=this me=../me}}
</li>
{{/each}}
</ul>
{{> minicomposer inReplyTo=lastIncoming to=feed.id}}
</div>
{{else}}
<div class="empty">
Select a conversation. To create a new one, navigate to a profile.
</div>
{{/if}}
</section>
{{/if}}
</article>
{{#if error}}
<div class="error">
{{error.message}}
</div>
{{else}}
<div class="stream">
{{#if feed}}
<header><a href="/private/dms">Inbox</a> &raquo; Messages with <a href="/private/feeds/{{getUsername feed.id}}">{{feed.preferredUsername}}</a></header>
<div class="inbox">
<div class="messages" id="inbox_stream">
{{#each inbox}}
{{> dm message=this me=../me}}
{{/each}}
</div>
{{> minicomposer inReplyTo=lastIncoming to=feed.id}}
</div>
{{else}}
<!-- TODO: empty state? -->
<div class="empty">
Select a conversation. To create a new one, navigate to a profile.
</div>
{{/if}}
</div>
{{/if}}
<script>
document.addEventListener('DOMContentLoaded', () => {
app.pollForPosts();
Expand Down
74 changes: 34 additions & 40 deletions design/feeds.handlebars
Original file line number Diff line number Diff line change
@@ -1,45 +1,39 @@
<div class="content-area">
{{#if error}}
<aside class="error">
{{error.message}}
</aside>
{{else}}
<section class="stream">
{{#if feed}}
{{> profileHeader actor=feed nobio=true}}
{{/if}}

{{#if activitystream}}
{{#each activitystream}}
{{#with this}}
<article class="activity">
{{#if boost}}
<div class="boost">
🚀 Boosted by
<a href="/private/feeds/{{getUsername booster.id}}">{{booster.name}}</a>
</div>
{{> note note=note}}
{{else}}
{{> note note=note hidebyline=true}}
{{/if}}
</article>
{{/with}}
{{/each}}
{{else}}
<div class="empty">
No posts. <a href="/private/feeds/{{getUsername feed.id}}">Reload</a>
</div>
{{/if}}

{{#if next}}
<footer class="pagination">
<a href="?offset={{next}}" class="moreLink">More</a>
</footer>
{{/if}}
</section>
{{/if}}
{{#if error}}
<div class="error">
{{error.message}}
</div>
{{else}}
<div class="stream">
{{#if feed}}
{{> profileHeader actor=feed nobio=true}}
{{/if}}
{{#if activitystream}}
{{#each activitystream}}
{{#with this}}
<div class="activity">
{{#if boost}}
<div class="boost">
🚀 boosted by <a href="/private/feeds/{{getUsername booster.id}}">{{booster.name}}</a>
</div>
{{> note note=note}}
{{else}}
{{> note note=note hidebyline=true}}
{{/if}}
</div>
{{/with}}
{{/each}}
{{else}}
<!-- TODO: empty state? -->
<div class="empty">
No posts. <a href="/private/feeds/{{getUsername feed.id}}">Reload</a>
</div>
{{/if}}

{{#if next}}
<a href="?offset={{next}}" class="moreLink">More</a>
{{/if}}

</div>
<script>
document.addEventListener('DOMContentLoaded', () => {
app.pollForPosts();
Expand Down
34 changes: 13 additions & 21 deletions design/findresults.handlebars
Original file line number Diff line number Diff line change
@@ -1,32 +1,24 @@
<section class="stream">
<div class="stream">
<header>
<form method="get" action="/private/find" class="search-form">
<label for="lookup">Find People</label>
<input
type="search"
placeholder="[email protected]"
id="lookup"
name="handle"
aria-label="Search for people"
value="{{query}}" />
{{!-- <button type="submit" class="search-button">Search</button> --}}
<form method="get" action="/private/find">
<label for="lookup">Find People</label>
<input type="search" placeholder="[email protected]" id="lookup" name="handle" value="{{query}}" />
</form>
</header>

</header>
{{#if results}}
<div class="results-container">
{{#each results}}
<div class="activity">
{{> personCard actor=this nobio=true}}
</div>
{{/each}}
</div>
{{#each results}}
<div class="activity">
{{> personCard actor=this nobio=true}}
</div>
{{/each}}
{{else}}
<div class="activity">
No results found.
Nobody results
</div>
{{/if}}
</section>
</div>

<script>
document.addEventListener('DOMContentLoaded', () => {
app.pollForPosts();
Expand Down
19 changes: 8 additions & 11 deletions design/followers.handlebars
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
<div class="stream">
<header class="followers-header">
<span>🤷🏽‍♂️ Followers</span>
</header>
<header>
<span>🤷🏽‍♂️ Followers</span>
</header>

<section class="followers-list">
{{#each followers}}
<article class="activity">
{{> personCard actor=this}}
</article>
{{/each}}
</section>
{{#each followers}}
<div class="activity">
{{> personCard actor=this}}
</div>
{{/each}}
</div>

{{> peopleTools}}

<script>
Expand Down
19 changes: 8 additions & 11 deletions design/following.handlebars
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
<div class="stream">
<header class="following-header">
<span>🤷🏽‍♂️ Following</span>
</header>
<header>
<span>🤷🏽‍♂️ Following</span>
</header>

<section class="following-list">
{{#each following}}
<article class="activity">
{{> personCard actor=this}}
</article>
{{/each}}
</section>
{{#each following}}
<div class="activity">
{{> personCard actor=this}}
</div>
{{/each}}
</div>

{{> peopleTools}}

<script>
Expand Down
86 changes: 36 additions & 50 deletions design/notifications.handlebars
Original file line number Diff line number Diff line change
@@ -1,56 +1,42 @@
<div class="stream">
<header class="notification-header">
<span>{{prefs.icons.notifications}} Notifications</span>
<a href="/private/notifications" id="newNotifications" class="unread" hidden></a>
</header>
<header>
<span>{{prefs.icons.notifications}} Notifications</span>
<a href="/private/notifications" id="newNotifications" class="unread" hidden></a>
</header>
{{#each notifications}}
<div class="activity">
{{#with this}}
{{#isEq notification.type "Announce"}}
<div class="notification">🚀 <a href="/private/feeds/{{getUsername ../actor.id}}">{{or ../actor.name ../actor.preferredUsername}}</a> boosted <a href="{{../note.id}}">your post</a> {{timesince ../time}}</div>
<div class="preview">
{{{...note.content}}}
</div>
{{/isEq}}
{{#isEq notification.type "Reply"}}
{{> note actor=../actor note=../note}}
{{/isEq}}
{{#isEq notification.type "Mention"}}
<div class="notification">💬 <a href="/private/feeds/{{getUsername ../actor.id}}">{{or ../actor.name ../actor.preferredUsername}}</a> mentioned you {{timesince ../time}}</div>
{{> note actor=../actor note=../note}}
{{/isEq}}
{{#isEq notification.type "Like"}}
<div class="notification">⭐️ <a href="/private/feeds/{{getUsername ../actor.id}}">{{or ../actor.name ../actor.preferredUsername}}</a> liked <a href="{{../note.id}}">your post</a> {{timesince ../time}}</div>
<div class="preview">
{{{...note.content}}}
</div>
{{/isEq}}
{{#isEq notification.type "Follow"}}
<div class="notification">🤷🏽‍♂️ <a href="/private/feeds/{{getUsername ../actor.id}}">{{or ../actor.name ../actor.preferredUsername}}</a> followed you {{timesince ../time}}</div>
{{> byline actor=../actor}}
{{/isEq}}
{{/with}}
</div>
{{/each}}

<section class="notification-list">
{{#each notifications}}
<article class="activity">
{{#with this}}
{{#isEq notification.type "Announce"}}
<div class="notification">
🚀 <a href="/private/feeds/{{getUsername ../actor.id}}">{{or ../actor.name ../actor.preferredUsername}}</a> boosted
<a href="{{../note.id}}">your post</a> {{timesince ../time}}
</div>
<div class="preview">
{{{...note.content}}}
</div>
{{/isEq}}
{{#isEq notification.type "Reply"}}
{{> note actor=../actor note=../note}}
{{/isEq}}
{{#isEq notification.type "Mention"}}
<div class="notification">
💬 <a href="/private/feeds/{{getUsername ../actor.id}}">{{or ../actor.name ../actor.preferredUsername}}</a> mentioned you {{timesince ../time}}
</div>
{{> note actor=../actor note=../note}}
{{/isEq}}
{{#isEq notification.type "Like"}}
<div class="notification">
⭐️ <a href="/private/feeds/{{getUsername ../actor.id}}">{{or ../actor.name ../actor.preferredUsername}}</a> liked
<a href="{{../note.id}}">your post</a> {{timesince ../time}}
</div>
<div class="preview">
{{{...note.content}}}
</div>
{{/isEq}}
{{#isEq notification.type "Follow"}}
<div class="notification">
🤷🏽‍♂️ <a href="/private/feeds/{{getUsername ../actor.id}}">{{or ../actor.name ../actor.preferredUsername}}</a> followed you {{timesince ../time}}
</div>
{{> byline actor=../actor}}
{{/isEq}}
{{/with}}
</article>
{{/each}}
</section>
{{#if next}}
<a href="/private/notifications?offset={{next}}" class="moreLink">More</a>
{{/if}}

{{#if next}}
<footer class="more-notifications">
<a href="/private/notifications?offset={{next}}" class="moreLink">More</a>
</footer>
{{/if}}
</div>

<script>
Expand Down
Loading

0 comments on commit b9ac8c7

Please sign in to comment.