Re-add postbox to profile view page #652

Merged
prologic merged 11 commits from ullarah-patch-pp into master 3 weeks ago
  1. 3
      internal/context.go
  2. 2
      internal/external_handlers.go
  3. 1
      internal/profile_handler.go
  4. 3
      internal/theme/static/css/99-yarn.css
  5. 2
      internal/theme/templates/partials.html
  6. 3
      internal/theme/templates/profile.html

3
internal/context.go

@ -126,6 +126,9 @@ type Context struct {
// Login Referer
Referer string
// Profile post box user handle
PostText string
}
func NewContext(s *Server, req *http.Request) *Context {

2
internal/external_handlers.go

@ -127,6 +127,8 @@ func (s *Server) ExternalHandler() httprouter.Handle {
ctx.Profile.LastPostedAt = twts[0].Created()
}
ctx.PostText = fmt.Sprintf("@<%s %s> ", ctx.Profile.Nick, ctx.Profile.URI)
follower := s.cache.GetFollowerByURI(ctx.User, uri)
if follower != nil {
ctx.Profile.LastSeenAt = follower.LastSeenAt

1
internal/profile_handler.go

@ -62,6 +62,7 @@ func (s *Server) ProfileHandler() httprouter.Handle {
profile.FollowedBy = s.cache.FollowedBy(ctx.User, profile.URI)
ctx.Profile = profile
ctx.PostText = fmt.Sprintf("@%s ", profile.Nick)
ctx.Links = append(ctx.Links, Link{
Href: fmt.Sprintf("%s/webmention", UserURL(profile.URI)),

3
internal/theme/static/css/99-yarn.css

@ -729,6 +729,9 @@ footer.container {
font-size: 0.0009rem;
color: var(--background-color);
}
.profile-post {
padding-top: 1rem;
}
.ti-circle-plus, .ti-circle-minus, .ti-settings, .ti-link-profile, .ti-rss-profile, .ti-bookmarks {
font-size: 1.3rem;
color: var(--primary) !important;

2
internal/theme/templates/partials.html

@ -42,7 +42,7 @@
<input type="hidden" id="replyTo" name="reply" value="{{ $.Reply }}" />
<input type="hidden" id="title" name="title" placeholder="{{tr $.Ctx "TwtFormTitle"}}" value="" />
<div class="textarea-container">
<textarea id="text" name="text" placeholder="{{ $.TwtPrompt }}" rows=3 maxlength={{ $.MaxTwtLength }} {{ if $.AutoFocus }}autofocus{{ end }} required></textarea>
<textarea id="text" name="text" placeholder="{{ $.TwtPrompt }}" rows=3 maxlength={{ $.MaxTwtLength }} {{ if $.AutoFocus }}autofocus{{ end }} required>{{ $.PostText }}</textarea>
<div id="mentioned-list" class="users-list">
<div id="mentioned-list-content" class="mentioned-list-content">
</div>

3
internal/theme/templates/profile.html

@ -70,6 +70,9 @@
</li>
</ul>
</details>
<div class="profile-post">
{{ template "post" (dict "Authenticated" $.Authenticated "User" $.User "TwtPrompt" $.TwtPrompt "MaxTwtLength" $.MaxTwtLength "PostText" $.PostText "Reply" $.Reply "AutoFocus" false "CSRFToken" $.CSRFToken "Ctx" .) }}
</div>
{{ end }}
<div class="profile-recent">

Loading…
Cancel
Save