mirror of
https://github.com/MeshTender/MeshTender.git
synced 2026-09-17 00:44:20 +00:00
117 lines
4.8 KiB
HTML
117 lines
4.8 KiB
HTML
{{define "title"}}{{.Org.Name}} · MeshTender{{end}}
|
|
{{define "content"}}
|
|
{{if .Error}}<p class="error banner">{{.Error}}</p>{{end}}
|
|
<section class="card">
|
|
<h1>{{.Org.Name}}</h1>
|
|
<p class="muted">You are {{if .IsAdmin}}an <strong>admin</strong>{{else}}a <strong>member</strong>{{end}} of this organization.</p>
|
|
{{if .Org.Description}}<p>{{.Org.Description}}</p>{{end}}
|
|
<div class="ractions">
|
|
{{if .IsAdmin}}<a class="btnlink" href="/orgs/{{.Org.ID}}/permissions">⚙ Edit permissions</a>{{end}}
|
|
<a class="btnlink" href="/orgs/{{.Org.ID}}?view=public">🌐 View public page</a>
|
|
<form method="post" action="/orgs/{{.Org.ID}}/leave" class="inline" onsubmit="return confirm('Leave this organization?')">
|
|
<button type="submit" class="btn danger sm">Leave organization</button>
|
|
</form>
|
|
</div>
|
|
</section>
|
|
|
|
{{if .IsAdmin}}
|
|
<section class="card">
|
|
<h2 style="margin-top:0">Organization profile <span class="muted">(public)</span></h2>
|
|
<p class="muted">Name and description are shown on the public organization page and directory.</p>
|
|
<form method="post" action="/orgs/{{.Org.ID}}/edit">
|
|
<label>Name<input type="text" name="name" value="{{.Org.Name}}" maxlength="80" required></label>
|
|
<label>Description<input type="text" name="description" value="{{.Org.Description}}" maxlength="2000" placeholder="What this organization is about, where it operates, etc."></label>
|
|
<button type="submit" class="primary">Save profile</button>
|
|
</form>
|
|
</section>
|
|
{{end}}
|
|
|
|
<section class="card">
|
|
<h2>Members</h2>
|
|
<ul class="repeaters">
|
|
{{range .Members}}
|
|
<li class="rhead">
|
|
<span class="rname">{{.Name}}</span>
|
|
<span class="muted">@{{.Username}}</span>
|
|
{{if eq .Role "admin"}}<span class="badge ok">admin</span>{{else}}<span class="badge shared">member</span>{{end}}
|
|
{{if and $.IsAdmin (ne .UserID $.Self)}}
|
|
<form method="post" action="/orgs/{{$.Org.ID}}/members/{{.UserID}}" class="inline" style="margin-left:auto;display:flex;gap:0.6rem">
|
|
{{if eq .Role "admin"}}
|
|
<button type="submit" name="action" value="demote" class="link">Demote</button>
|
|
{{else}}
|
|
<button type="submit" name="action" value="promote" class="link">Make admin</button>
|
|
{{end}}
|
|
<button type="submit" name="action" value="remove" class="link danger">Remove</button>
|
|
</form>
|
|
{{end}}
|
|
</li>
|
|
{{end}}
|
|
</ul>
|
|
</section>
|
|
|
|
<section class="card">
|
|
<h2>Repeaters</h2>
|
|
{{if .HasMap}}
|
|
<link rel="stylesheet" href="/static/leaflet.css">
|
|
<div id="map"></div>
|
|
<script src="/static/leaflet.js"></script>
|
|
<script>
|
|
var pts = [
|
|
{{range .Repeaters}}{{if .HasLocation}}{name: {{.Name}}, lat: {{.Lat}}, lon: {{.Lon}}},{{end}}{{end}}
|
|
];
|
|
var map = L.map('map');
|
|
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
|
maxZoom: 19, attribution: '© OpenStreetMap'
|
|
}).addTo(map);
|
|
var group = L.featureGroup(pts.map(function (p) {
|
|
return L.circleMarker([p.lat, p.lon], { radius: 7, color: '#3fb950', fillOpacity: 0.7 }).bindPopup(p.name);
|
|
})).addTo(map);
|
|
map.fitBounds(group.getBounds().pad(0.2));
|
|
</script>
|
|
{{end}}
|
|
{{if .Repeaters}}
|
|
<ul class="repeaters">
|
|
{{range .Repeaters}}
|
|
<li class="rhead">
|
|
<span class="rname">{{.Name}}</span>
|
|
<span class="muted">owner {{.OwnerName}}</span>
|
|
<a class="btn primary sm" style="margin-left:auto" href="/repeaters/{{.RepeaterID}}/console">▸ Console</a>
|
|
</li>
|
|
{{end}}
|
|
</ul>
|
|
{{else}}
|
|
<p class="muted">No repeaters have been contributed yet. Members can contribute their own from a repeater's “Organizations” page.</p>
|
|
{{end}}
|
|
</section>
|
|
|
|
{{if .IsAdmin}}
|
|
<section class="card">
|
|
<h2>Join links</h2>
|
|
<p class="muted">Anyone with a link joins as a member. Promote them to admin above if needed.</p>
|
|
{{if .Invites}}
|
|
<ul class="repeaters">
|
|
{{range .Invites}}
|
|
<li>
|
|
<div class="rhead"><span class="rname">{{if .Description}}{{.Description}}{{else}}(no label){{end}}</span></div>
|
|
<div class="copyrow">
|
|
<code id="ol-{{.ID}}">{{.Link}}</code>
|
|
<button type="button" onclick="navigator.clipboard.writeText(document.getElementById('ol-{{.ID}}').textContent)">Copy</button>
|
|
</div>
|
|
<form method="post" action="/orgs/{{$.Org.ID}}/invite/delete" class="inline">
|
|
<input type="hidden" name="invite_id" value="{{.ID}}">
|
|
<button type="submit" class="link danger">Revoke</button>
|
|
</form>
|
|
</li>
|
|
{{end}}
|
|
</ul>
|
|
{{end}}
|
|
<form method="post" action="/orgs/{{.Org.ID}}/invite">
|
|
<label>New link description (optional)<input type="text" name="description" maxlength="100" placeholder="e.g. forum post"></label>
|
|
<button type="submit" class="primary">Create join link</button>
|
|
</form>
|
|
</section>
|
|
{{end}}
|
|
|
|
<p><a class="backlink" href="/orgs">← All organizations</a></p>
|
|
{{end}}
|