wew edit link wew

This commit is contained in:
Ben Visness 2024-07-01 22:46:38 -05:00
parent 908c8b02f8
commit a98cce4b4b
7 changed files with 53 additions and 31 deletions

View File

@ -0,0 +1,5 @@
<svg width="18" height="20" fill="currentColor" viewBox="0 0 18 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<g transform="matrix(1,0,0,1,-3,-1.91942)">
<path d="M6.414,15.919L16.556,5.748L15.142,4.334L5,14.476L5,15.919L6.414,15.919ZM7.243,17.919L3,17.919L3,13.647L14.435,2.212C14.826,1.822 15.459,1.822 15.849,2.212L18.678,5.041C19.068,5.431 19.068,6.064 18.678,6.455L7.243,17.919ZM3,19.89L21,19.89L21,21.919L3,21.919L3,19.89Z" style="fill-rule:nonzero;"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 682 B

View File

@ -23,7 +23,7 @@
<div class="mt4">
<h2>Leadership</h2>
<div class="flex flex-column flex-row-l g2">
<div class="flex-fair pa3 bg3 br3">
<div class="flex-fair pa3 bg3">
<h3>Ben Visness</h3>
<h4>Lead<!--, Foundation President--></h4>
<p>
@ -40,7 +40,7 @@
</p> -->
</div>
<div class="flex-fair pa3 bg3 br3">
<div class="flex-fair pa3 bg3">
<h3>Asaf Gartner</h3>
<h4>Admin<!--, Foundation Secretary--></h4>
<p>
@ -51,7 +51,7 @@
</p>
</div>
<div class="flex-fair pa3 bg3 br3">
<div class="flex-fair pa3 bg3">
<h3>Colin Davidson</h3>
<h4>Admin<!--, Foundation Treasurer--></h4>
<p>
@ -67,7 +67,7 @@
<div class="ph3 ph0-ns mt4">
<h2>Key Contributors</h2>
<div class="flex flex-column flex-row-ns g3">
<div class="flex-fair pa3 bg3 br3">
<div class="flex-fair pa3 bg3">
<h3>Martin Fouilleul</h3>
<h4>Orca Lead</h4>
<p>Martin is a systems programmer, researcher, and PhD with experience in programming languages and models for distributed temporal interactions in music and performing arts software. He is also a former sound engineer and computer music designer.</p>

View File

@ -39,7 +39,7 @@
</div>
</div>
</div>
<a class="db pa3 lh-solid flex f6 {{ if not .User }}bl{{ end }}" href="{{ or .Header.UserProfileUrl .LoginPageUrl }}">
<a class="db {{ if .User }}pv2 ph3{{ else }}pa3{{ end }} lh-solid flex f6 {{ if not .User }}bl{{ end }}" href="{{ or .Header.UserProfileUrl .LoginPageUrl }}">
{{ with .User }}
<img class="avatar avatar-user" src="{{ .AvatarUrl }}">
{{ else }}

View File

@ -5,8 +5,8 @@
</legend>
<div class="pa3 input-group">
<div id="links" class="flex flex-column g2 relative">
<div>Primary Links</div>
<div class="drop_slot secondary_links">Secondary Links</div>
<div class="b">Primary Links</div>
<div class="b drop_slot secondary_links">Secondary Links</div>
</div>
<template id="link_row">
<div class="link_row drop_slot w-100 flex flex-row items-center" data-tmpl="root">

View File

@ -11,23 +11,33 @@
<div class="flex justify-center">
<div class="flex-grow-1 flex flex-column items-center mw-site pt4">
<div class="w-100 h5 bg-white-50 bg-center cover" style="background-image: url('{{ .Project.HeaderImage }}')">
<div class="flex justify-end pa3 g3 link-normal b">
{{ with .NamedLinks }}
<div class="flex justify-between pa3 link-normal b">
<div class="flex g3">
{{ if .CanEdit }}
<div class="bg-transparent flex">
<a class="ph3 pv2 flex items-center" href="{{ .EditUrl }}"><span class="mr2 flex items-center">{{ svg "edit-line" }}</span>Edit Project</a>
</div>
{{ end }}
</div>
<div class="flex g3">
{{ with .PrimaryLinks }}
<div class="bg-transparent flex">
{{ range . }}
<a class="flex ph3 pv2 flex items-center" href="{{ .Url }}">{{ .Name }}<span class="svgicon f6 ml2">{{ svg "arrow-right-up" }}</span></a>
<a class="ph3 pv2 flex items-center" href="{{ .Url }}">{{ .Name }}<span class="svgicon f6 ml2">{{ svg "arrow-right-up" }}</span></a>
{{ end }}
</div>
{{ end }}
{{ with .UnnamedLinks }}
{{ with .SecondaryLinks }}
<div class="bg-transparent flex items-center ph1">
{{ range . }}
<a class="flex ph2" href="{{ .Url }}" title="{{ .ServiceName }}{{ with .Username }} ({{ . }}){{ end }}">{{ svg (strjoin "logos/" .Icon) }}</a>
<a class="ph2 flex" href="{{ .Url }}" title="{{ .ServiceName }}{{ with .Username }} ({{ . }}){{ end }}">{{ svg (strjoin "logos/" .Icon) }}</a>
{{ end }}
<div class="pv2">&#8203;</div><!-- make sure secondary links render at the right height despite SVG size -->
</div>
{{ end }}
</div>
</div>
</div>
<div class="w-100 mw-site-narrow pa3 bg-transparent link-normal flex g3 overflow-hidden" style="margin-top: -4rem">
{{ if .Project.Logo }}
<a class="flex-shrink-0 flex" href="{{ .Project.Url }}">

View File

@ -215,10 +215,13 @@ func ProjectHomepage(c *RequestContext) ResponseData {
Project templates.Project
Owners []templates.User
Screenshots []string
NamedLinks, UnnamedLinks []templates.Link
PrimaryLinks, SecondaryLinks []templates.Link
RecentActivity []templates.TimelineItem
SnippetEdit templates.SnippetEdit
CanEdit bool
EditUrl string
FollowUrl string
Following bool
}
@ -242,6 +245,8 @@ func ProjectHomepage(c *RequestContext) ResponseData {
for _, owner := range owners {
templateData.Owners = append(templateData.Owners, templates.UserToTemplate(owner))
}
templateData.CanEdit = c.CurrentUserCanEditCurrentProject
templateData.EditUrl = c.UrlContext.BuildProjectEdit("")
if c.CurrentProject.Hidden {
templateData.BaseData.AddImmediateNotice(
@ -288,10 +293,10 @@ func ProjectHomepage(c *RequestContext) ResponseData {
}
for _, link := range templates.LinksToTemplate(projectLinks) {
if link.Name != "" {
templateData.NamedLinks = append(templateData.NamedLinks, link)
if link.Primary {
templateData.PrimaryLinks = append(templateData.PrimaryLinks, link)
} else {
templateData.UnnamedLinks = append(templateData.UnnamedLinks, link)
templateData.SecondaryLinks = append(templateData.SecondaryLinks, link)
}
}

View File

@ -63,6 +63,8 @@
- [ ] Resolve TODO(redesign) comments
- [ ] Audit all project lifecycles on HMN - probably remove "complete", replace with stuff like "alpha", "beta", maybe other stuff that makes sense for other types of projects.
- [ ] Afterward, re-enable badges
- [ ] Add logout / settings menu on avatar
- [ ] Delete all the scss :D
stack!