Skip to content

Commit

Permalink
templates
Browse files Browse the repository at this point in the history
  • Loading branch information
kdudkov committed Jan 10, 2025
1 parent 15c811a commit 2ecc131
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
16 changes: 4 additions & 12 deletions cmd/goatak_server/marti_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,7 @@ func getEndpointsHandler(app *App) fiber.Handler {
data := make([]map[string]any, 0)

app.items.ForEach(func(item *model.Item) bool {
if !user.CanSeeScope(item.GetScope()) {
return true
}

if item.GetClass() == model.CONTACT {
if user.CanSeeScope(item.GetScope()) && item.GetClass() == model.CONTACT {
info := make(map[string]any)
info["uid"] = item.GetUID()
info["callsign"] = item.GetCallsign()
Expand Down Expand Up @@ -161,11 +157,7 @@ func getContactsHandler(app *App) fiber.Handler {
result := make([]*model.Contact, 0)

app.items.ForEach(func(item *model.Item) bool {
if !user.CanSeeScope(item.GetScope()) {
return true
}

if item.GetClass() == model.CONTACT {
if user.CanSeeScope(item.GetScope()) && item.GetClass() == model.CONTACT {
c := &model.Contact{
UID: item.GetUID(),
Callsign: item.GetCallsign(),
Expand Down Expand Up @@ -247,7 +239,7 @@ func getUploadHandler(app *App) fiber.Handler {
return ctx.SendStatus(fiber.StatusNotAcceptable)
}

return ctx.SendString(fmt.Sprintf("/Marti/sync/content?hash=%s", c.Hash))
return ctx.SendString(packageUrl(c))

default:
c, err := app.uploadFile(ctx, uid, fname)
Expand All @@ -256,7 +248,7 @@ func getUploadHandler(app *App) fiber.Handler {
return ctx.SendStatus(fiber.StatusNotAcceptable)
}

return ctx.SendString(fmt.Sprintf("/Marti/sync/content?hash=%s", c.Hash))
return ctx.SendString(packageUrl(c))
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/goatak_server/templates/missions.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
<tr v-for="c in all_missions" @click="current = c">
<td>{{ c.name }}</td>
<td>{{ c.scope }}</td>
<td>{{ c.creatorUid }}</td>
<td>{{ c.creatorUID }}</td>
</tr>
</table>
</div>
<div class="col-6">
<div v-if="current != null" class="overflow-auto">
<h3>{{ current.name }}</h3>
creator: {{ current.creatorUid }}
creator: {{ current.creator }} uid {{ current.creatorUID }}

<div v-if="current.uids && current.uids.length > 0">
<h5>Points</h5>
Expand Down
2 changes: 1 addition & 1 deletion cmd/goatak_server/templates/mp.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<td><a :href="'/mp/' + p.UID">{{ p.UID }}</a></td>
<td>{{ p.Name }}</td>
<td>{{ p.Scope }}</td>
<td>{{ p.CreatorUid }}</td>
<td>{{ p.CreatorUID }}</td>
<td>{{ p.Size }}</td>
<td>{{ p.MIMEType }}</td>
<td>{{ p.Keywords }}</td>
Expand Down
4 changes: 2 additions & 2 deletions cmd/goatak_server/templates/points.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="row">
<div class="col-6">
<div class="col">
<div class="overflow-auto">
<div class="alert alert-secondary info" role="alert" v-if="alert">
{{ alert }}
Expand Down Expand Up @@ -59,7 +59,7 @@
</div>
</div>
</div>
<div class="col-6">
<div class="col">
<div class="card mb-2">
<div class="card-header">Units</div>
<div class="card-body">
Expand Down

0 comments on commit 2ecc131

Please sign in to comment.