Index: README.md ================================================================== --- README.md +++ README.md @@ -21,6 +21,6 @@ The software, including the manual, is licensed under the [European Union Public License 1.2 (or later)](https://zettelstore.de/home/file?name=LICENSE.txt&ci=trunk). -[Stay tuned](https://twitter.com/zettelstore)… +[Stay tuned](https://twitter.com/zettelstore) … Index: VERSION ================================================================== --- VERSION +++ VERSION @@ -1,1 +1,1 @@ -0.5.0 +0.6.0 Index: ast/ast.go ================================================================== --- ast/ast.go +++ ast/ast.go @@ -82,7 +82,8 @@ RefStateSelf // Reference to same zettel with a fragment RefStateFound // Reference to an existing internal zettel, URL is ajusted RefStateBroken // Reference to a non-existing internal zettel RefStateHosted // Reference to local hosted non-Zettel, without URL change RefStateBased // Reference to local non-Zettel, to be prefixed + RefStateSearch // Reference to a zettel search RefStateExternal // Reference to external material ) Index: ast/ref.go ================================================================== --- ast/ref.go +++ ast/ref.go @@ -10,20 +10,26 @@ package ast import ( "net/url" + "strings" "zettelstore.de/z/domain/id" ) + +// SearchPrefix is the prefix that denotes a search expression. +const SearchPrefix = "search:" // ParseReference parses a string and returns a reference. func ParseReference(s string) *Reference { - switch s { - case "", "00000000000000": + if s == "" || s == "00000000000000" { return &Reference{URL: nil, Value: s, State: RefStateInvalid} } + if strings.HasPrefix(s, SearchPrefix) { + return &Reference{URL: nil, Value: s[len(SearchPrefix):], State: RefStateSearch} + } if state, ok := localState(s); ok { if state == RefStateBased { s = s[1:] } u, err := url.Parse(s) @@ -64,10 +70,13 @@ // String returns the string representation of a reference. func (r Reference) String() string { if r.URL != nil { return r.URL.String() + } + if r.State == RefStateSearch { + return SearchPrefix + r.Value } return r.Value } // IsValid returns true if reference is valid Index: box/box.go ================================================================== --- box/box.go +++ box/box.go @@ -248,28 +248,22 @@ func (err *ErrNotAllowed) Error() string { if err.User == nil { if err.Zid.IsValid() { return fmt.Sprintf( "operation %q on zettel %v not allowed for not authorized user", - err.Op, - err.Zid.String()) + err.Op, err.Zid) } return fmt.Sprintf("operation %q not allowed for not authorized user", err.Op) } if err.Zid.IsValid() { return fmt.Sprintf( "operation %q on zettel %v not allowed for user %v/%v", - err.Op, - err.Zid.String(), - err.User.GetDefault(api.KeyUserID, "?"), - err.User.Zid.String()) + err.Op, err.Zid, err.User.GetDefault(api.KeyUserID, "?"), err.User.Zid) } return fmt.Sprintf( "operation %q not allowed for user %v/%v", - err.Op, - err.User.GetDefault(api.KeyUserID, "?"), - err.User.Zid.String()) + err.Op, err.User.GetDefault(api.KeyUserID, "?"), err.User.Zid) } // Is return true, if the error is of type ErrNotAllowed. func (*ErrNotAllowed) Is(error) bool { return true } Index: box/constbox/base.css ================================================================== --- box/constbox/base.css +++ box/constbox/base.css @@ -101,17 +101,17 @@ table { border-collapse: collapse; border-spacing: 0; max-width: 100%; } - th,td { + thead>tr>td { border-bottom: 2px solid hsl(0, 0%, 70%); font-weight: bold } + tfoot>tr>td { border-top: 2px solid hsl(0, 0%, 70%); font-weight: bold } + td { text-align: left; padding: .25rem .5rem; + border-bottom: 1px solid hsl(0, 0%, 85%) } - td { border-bottom: 1px solid hsl(0, 0%, 85%) } - thead th { border-bottom: 2px solid hsl(0, 0%, 70%) } - tfoot th { border-top: 2px solid hsl(0, 0%, 70%) } main form { padding: 0 .5em; margin: .5em 0 0 0; } main form:after { @@ -197,13 +197,13 @@ .zs-error { background-color: lightpink; border-style: none !important; font-weight: bold; } - td.left,th.left { text-align:left } - td.center,th.center { text-align:center } - td.right,th.right { text-align:right } + td.left { text-align:left } + td.center { text-align:center } + td.right { text-align:right } .zs-font-size-0 { font-size:75% } .zs-font-size-1 { font-size:83% } .zs-font-size-2 { font-size:100% } .zs-font-size-3 { font-size:117% } .zs-font-size-4 { font-size:150% } Index: box/constbox/info.mustache ================================================================== --- box/constbox/info.mustache +++ box/constbox/info.mustache @@ -19,10 +19,18 @@ {{#Valid}}
  • {{Zid}}
  • {{/Valid}} {{^Valid}}
  • {{Zid}}
  • {{/Valid}} {{/LocLinks}} {{/HasLocLinks}} +{{#HasSearchLinks}} +

    Searches

    + +{{/HasSearchLinks}} {{#HasExtLinks}}

    External