Skip to content

Commit

Permalink
Merge pull request #195 from JM-Lemmi/fix-edit-view
Browse files Browse the repository at this point in the history
fix(frontend): Handle missing properties in edit view
  • Loading branch information
JM-Lemmi authored Jun 6, 2023
2 parents a9a8040 + 7bba94e commit 510d075
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v2.0.0-beta.6.1

- Fix Edit view crashing for events without a `SUMMARY` or `LOCATION` property

# v2.0.0-beta.6

- Database as Configuration Backend
Expand Down
2 changes: 1 addition & 1 deletion cmd/ical-relay/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
log "github.com/sirupsen/logrus"
)

var version = "2.0.0-beta.6"
var version = "2.0.0-beta.6.1"

var configPath string
var conf Config
Expand Down
6 changes: 3 additions & 3 deletions cmd/ical-relay/templates/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@
<body>
{{template "nav.html" .}}
<main class="container">
<h1 class="mb-3">{{(.Event.GetProperty "SUMMARY").Value}} bearbeiten</h1>
<h1 class="mb-3">{{ if .Event.GetProperty "SUMMARY" }}{{(.Event.GetProperty "SUMMARY").Value}}{{ end }} bearbeiten</h1>
<div class="alert alert-danger" id="edit-error" style="display: none;">
Es ist ein Fehler aufgetreten! Sind Sie eingeloggt?
</div>
<form id="edit-form">
<div class="row mb-3">
<label for="summary" class="col-sm-1 col-form-label">Titel</label>
<div class="col-sm-11">
<input type="text" class="form-control" id="summary" name="summary" value="{{(.Event.GetProperty "SUMMARY").Value}}">
<input type="text" class="form-control" id="summary" name="summary" value="{{ if .Event.GetProperty "SUMMARY" }}{{(.Event.GetProperty "SUMMARY").Value}}{{ end }}">
</div>
</div>
<div class="row mb-3">
<label for="location" class="col-sm-1 col-form-label">Ort</label>
<div class="col-sm-11">
<input type="text" class="form-control" id="location" name="location" value="{{(.Event.GetProperty "LOCATION").Value}}">
<input type="text" class="form-control" id="location" name="location" value="{{ if .Event.GetProperty "LOCATION" }}{{(.Event.GetProperty "LOCATION").Value}}{{ end }}">
</div>
</div>
<div class="row mb-3">
Expand Down

0 comments on commit 510d075

Please sign in to comment.