github.com/kyleu/dbaudit@v0.0.2-0.20240321155047-ff2f2c940496/views/layout/Nav.html.go (about)

     1  // Code generated by qtc from "Nav.html". DO NOT EDIT.
     2  // See https://github.com/valyala/quicktemplate for details.
     3  
     4  // <!-- Content managed by Project Forge, see [projectforge.md] for details. -->
     5  
     6  //line views/layout/Nav.html:2
     7  package layout
     8  
     9  //line views/layout/Nav.html:2
    10  import (
    11  	"github.com/kyleu/dbaudit/app"
    12  	"github.com/kyleu/dbaudit/app/controller/cutil"
    13  	"github.com/kyleu/dbaudit/app/lib/menu"
    14  	"github.com/kyleu/dbaudit/app/util"
    15  	"github.com/kyleu/dbaudit/views/components"
    16  )
    17  
    18  //line views/layout/Nav.html:10
    19  import (
    20  	qtio422016 "io"
    21  
    22  	qt422016 "github.com/valyala/quicktemplate"
    23  )
    24  
    25  //line views/layout/Nav.html:10
    26  var (
    27  	_ = qtio422016.Copy
    28  	_ = qt422016.AcquireByteBuffer
    29  )
    30  
    31  //line views/layout/Nav.html:10
    32  func StreamNav(qw422016 *qt422016.Writer, as *app.State, ps *cutil.PageState) {
    33  //line views/layout/Nav.html:10
    34  	qw422016.N().S(`
    35  <nav id="navbar">
    36    <a class="logo" href="`)
    37  //line views/layout/Nav.html:12
    38  	qw422016.E().S(ps.RootPath)
    39  //line views/layout/Nav.html:12
    40  	qw422016.N().S(`" title="`)
    41  //line views/layout/Nav.html:12
    42  	qw422016.E().S(util.AppName)
    43  //line views/layout/Nav.html:12
    44  	qw422016.N().S(` `)
    45  //line views/layout/Nav.html:12
    46  	qw422016.E().S(as.BuildInfo.String())
    47  //line views/layout/Nav.html:12
    48  	qw422016.N().S(`">`)
    49  //line views/layout/Nav.html:12
    50  	components.StreamSVGRef(qw422016, ps.RootIcon, 32, 32, ``, ps)
    51  //line views/layout/Nav.html:12
    52  	qw422016.N().S(`</a>
    53    <div class="breadcrumbs">
    54      <a href="`)
    55  //line views/layout/Nav.html:14
    56  	qw422016.E().S(ps.RootPath)
    57  //line views/layout/Nav.html:14
    58  	qw422016.N().S(`" class="nav-root-icon" title="`)
    59  //line views/layout/Nav.html:14
    60  	qw422016.E().S(util.AppName)
    61  //line views/layout/Nav.html:14
    62  	qw422016.N().S(`">`)
    63  //line views/layout/Nav.html:14
    64  	components.StreamSVGRef(qw422016, ps.RootIcon, 18, 28, "breadcrumb-icon", ps)
    65  //line views/layout/Nav.html:14
    66  	qw422016.N().S(`</a>
    67      <a class="link nav-root-item" href="`)
    68  //line views/layout/Nav.html:15
    69  	qw422016.E().S(ps.RootPath)
    70  //line views/layout/Nav.html:15
    71  	qw422016.N().S(`">`)
    72  //line views/layout/Nav.html:15
    73  	qw422016.E().S(ps.RootTitle)
    74  //line views/layout/Nav.html:15
    75  	qw422016.N().S(`</a>`)
    76  //line views/layout/Nav.html:15
    77  	StreamNavItems(qw422016, ps)
    78  //line views/layout/Nav.html:15
    79  	qw422016.N().S(`
    80    </div>
    81  `)
    82  //line views/layout/Nav.html:17
    83  	if ps.SearchPath != "-" {
    84  //line views/layout/Nav.html:17
    85  		qw422016.N().S(`  <form action="`)
    86  //line views/layout/Nav.html:18
    87  		qw422016.E().S(ps.SearchPath)
    88  //line views/layout/Nav.html:18
    89  		qw422016.N().S(`" class="search" title="search">
    90      <input id="search-input" type="search" name="q" placeholder=" " />
    91      <div class="search-image" style="display: none;"><svg><use xlink:href="#svg-searchbox" /></svg></div>
    92    </form>
    93  `)
    94  //line views/layout/Nav.html:22
    95  	}
    96  //line views/layout/Nav.html:22
    97  	qw422016.N().S(`  `)
    98  //line views/layout/Nav.html:23
    99  	StreamProfileLink(qw422016, as, ps)
   100  //line views/layout/Nav.html:23
   101  	qw422016.N().S(`
   102  `)
   103  //line views/layout/Nav.html:24
   104  	if !ps.HideMenu {
   105  //line views/layout/Nav.html:24
   106  		qw422016.N().S(`  <input type="checkbox" id="menu-toggle-input" style="display: none;" />
   107    <label class="menu-toggle" for="menu-toggle-input"><div class="spinner diagonal part-1"></div><div class="spinner horizontal"></div><div class="spinner diagonal part-2"></div></label>
   108    `)
   109  //line views/layout/Nav.html:27
   110  		StreamMenu(qw422016, ps)
   111  //line views/layout/Nav.html:27
   112  		qw422016.N().S(`
   113  `)
   114  //line views/layout/Nav.html:28
   115  	}
   116  //line views/layout/Nav.html:28
   117  	qw422016.N().S(`</nav>`)
   118  //line views/layout/Nav.html:29
   119  }
   120  
   121  //line views/layout/Nav.html:29
   122  func WriteNav(qq422016 qtio422016.Writer, as *app.State, ps *cutil.PageState) {
   123  //line views/layout/Nav.html:29
   124  	qw422016 := qt422016.AcquireWriter(qq422016)
   125  //line views/layout/Nav.html:29
   126  	StreamNav(qw422016, as, ps)
   127  //line views/layout/Nav.html:29
   128  	qt422016.ReleaseWriter(qw422016)
   129  //line views/layout/Nav.html:29
   130  }
   131  
   132  //line views/layout/Nav.html:29
   133  func Nav(as *app.State, ps *cutil.PageState) string {
   134  //line views/layout/Nav.html:29
   135  	qb422016 := qt422016.AcquireByteBuffer()
   136  //line views/layout/Nav.html:29
   137  	WriteNav(qb422016, as, ps)
   138  //line views/layout/Nav.html:29
   139  	qs422016 := string(qb422016.B)
   140  //line views/layout/Nav.html:29
   141  	qt422016.ReleaseByteBuffer(qb422016)
   142  //line views/layout/Nav.html:29
   143  	return qs422016
   144  //line views/layout/Nav.html:29
   145  }
   146  
   147  //line views/layout/Nav.html:31
   148  func StreamNavItem(qw422016 *qt422016.Writer, link string, title string, icon string, last bool, ps *cutil.PageState) {
   149  //line views/layout/Nav.html:32
   150  	if link != "" || last {
   151  //line views/layout/Nav.html:32
   152  		qw422016.N().S(`<a class="link`)
   153  //line views/layout/Nav.html:33
   154  		if last {
   155  //line views/layout/Nav.html:33
   156  			qw422016.N().S(` `)
   157  //line views/layout/Nav.html:33
   158  			qw422016.N().S(`last`)
   159  //line views/layout/Nav.html:33
   160  		}
   161  //line views/layout/Nav.html:33
   162  		qw422016.N().S(`" href="`)
   163  //line views/layout/Nav.html:33
   164  		qw422016.E().S(link)
   165  //line views/layout/Nav.html:33
   166  		qw422016.N().S(`">`)
   167  //line views/layout/Nav.html:34
   168  	}
   169  //line views/layout/Nav.html:34
   170  	qw422016.N().S(`<span title="`)
   171  //line views/layout/Nav.html:35
   172  	qw422016.E().S(title)
   173  //line views/layout/Nav.html:35
   174  	qw422016.N().S(`">`)
   175  //line views/layout/Nav.html:35
   176  	components.StreamSVGRef(qw422016, icon, 18, 28, "breadcrumb-icon", ps)
   177  //line views/layout/Nav.html:35
   178  	qw422016.N().S(`</span><span class="nav-item-title">`)
   179  //line views/layout/Nav.html:36
   180  	qw422016.E().S(title)
   181  //line views/layout/Nav.html:36
   182  	qw422016.N().S(`</span>`)
   183  //line views/layout/Nav.html:37
   184  	if link != "" || last {
   185  //line views/layout/Nav.html:37
   186  		qw422016.N().S(`</a>`)
   187  //line views/layout/Nav.html:39
   188  	}
   189  //line views/layout/Nav.html:40
   190  }
   191  
   192  //line views/layout/Nav.html:40
   193  func WriteNavItem(qq422016 qtio422016.Writer, link string, title string, icon string, last bool, ps *cutil.PageState) {
   194  //line views/layout/Nav.html:40
   195  	qw422016 := qt422016.AcquireWriter(qq422016)
   196  //line views/layout/Nav.html:40
   197  	StreamNavItem(qw422016, link, title, icon, last, ps)
   198  //line views/layout/Nav.html:40
   199  	qt422016.ReleaseWriter(qw422016)
   200  //line views/layout/Nav.html:40
   201  }
   202  
   203  //line views/layout/Nav.html:40
   204  func NavItem(link string, title string, icon string, last bool, ps *cutil.PageState) string {
   205  //line views/layout/Nav.html:40
   206  	qb422016 := qt422016.AcquireByteBuffer()
   207  //line views/layout/Nav.html:40
   208  	WriteNavItem(qb422016, link, title, icon, last, ps)
   209  //line views/layout/Nav.html:40
   210  	qs422016 := string(qb422016.B)
   211  //line views/layout/Nav.html:40
   212  	qt422016.ReleaseByteBuffer(qb422016)
   213  //line views/layout/Nav.html:40
   214  	return qs422016
   215  //line views/layout/Nav.html:40
   216  }
   217  
   218  //line views/layout/Nav.html:42
   219  func StreamNavItems(qw422016 *qt422016.Writer, ps *cutil.PageState) {
   220  //line views/layout/Nav.html:43
   221  	for idx, bc := range ps.Breadcrumbs {
   222  //line views/layout/Nav.html:45
   223  		i := ps.Menu.GetByPath(ps.Breadcrumbs[:idx+1])
   224  		if i == nil {
   225  			i = menu.ItemFromString(bc, ps.DefaultNavIcon)
   226  		}
   227  
   228  //line views/layout/Nav.html:50
   229  		components.StreamIndent(qw422016, true, 2)
   230  //line views/layout/Nav.html:50
   231  		qw422016.N().S(`<span class="separator">/</span>`)
   232  //line views/layout/Nav.html:52
   233  		components.StreamIndent(qw422016, true, 2)
   234  //line views/layout/Nav.html:53
   235  		StreamNavItem(qw422016, i.Route, i.Title, i.Icon, idx == len(ps.Breadcrumbs)-1, ps)
   236  //line views/layout/Nav.html:54
   237  	}
   238  //line views/layout/Nav.html:55
   239  }
   240  
   241  //line views/layout/Nav.html:55
   242  func WriteNavItems(qq422016 qtio422016.Writer, ps *cutil.PageState) {
   243  //line views/layout/Nav.html:55
   244  	qw422016 := qt422016.AcquireWriter(qq422016)
   245  //line views/layout/Nav.html:55
   246  	StreamNavItems(qw422016, ps)
   247  //line views/layout/Nav.html:55
   248  	qt422016.ReleaseWriter(qw422016)
   249  //line views/layout/Nav.html:55
   250  }
   251  
   252  //line views/layout/Nav.html:55
   253  func NavItems(ps *cutil.PageState) string {
   254  //line views/layout/Nav.html:55
   255  	qb422016 := qt422016.AcquireByteBuffer()
   256  //line views/layout/Nav.html:55
   257  	WriteNavItems(qb422016, ps)
   258  //line views/layout/Nav.html:55
   259  	qs422016 := string(qb422016.B)
   260  //line views/layout/Nav.html:55
   261  	qt422016.ReleaseByteBuffer(qb422016)
   262  //line views/layout/Nav.html:55
   263  	return qs422016
   264  //line views/layout/Nav.html:55
   265  }
   266  
   267  //line views/layout/Nav.html:57
   268  func StreamProfileLink(qw422016 *qt422016.Writer, as *app.State, ps *cutil.PageState) {
   269  //line views/layout/Nav.html:57
   270  	qw422016.N().S(`<a class="profile" title="`)
   271  //line views/layout/Nav.html:58
   272  	qw422016.E().S(ps.AuthString())
   273  //line views/layout/Nav.html:58
   274  	qw422016.N().S(`" href="`)
   275  //line views/layout/Nav.html:58
   276  	qw422016.E().S(ps.ProfilePath)
   277  //line views/layout/Nav.html:58
   278  	qw422016.N().S(`">`)
   279  //line views/layout/Nav.html:59
   280  	if i := ps.Accounts.Image(); i != "" {
   281  //line views/layout/Nav.html:59
   282  		qw422016.N().S(`<img style="width: 24px; height: 24px;" src="`)
   283  //line views/layout/Nav.html:60
   284  		qw422016.E().S(i)
   285  //line views/layout/Nav.html:60
   286  		qw422016.N().S(`" />`)
   287  //line views/layout/Nav.html:61
   288  	} else {
   289  //line views/layout/Nav.html:62
   290  		components.StreamSVGRef(qw422016, `profile`, 24, 24, ``, ps)
   291  //line views/layout/Nav.html:63
   292  	}
   293  //line views/layout/Nav.html:63
   294  	qw422016.N().S(`</a>`)
   295  //line views/layout/Nav.html:65
   296  }
   297  
   298  //line views/layout/Nav.html:65
   299  func WriteProfileLink(qq422016 qtio422016.Writer, as *app.State, ps *cutil.PageState) {
   300  //line views/layout/Nav.html:65
   301  	qw422016 := qt422016.AcquireWriter(qq422016)
   302  //line views/layout/Nav.html:65
   303  	StreamProfileLink(qw422016, as, ps)
   304  //line views/layout/Nav.html:65
   305  	qt422016.ReleaseWriter(qw422016)
   306  //line views/layout/Nav.html:65
   307  }
   308  
   309  //line views/layout/Nav.html:65
   310  func ProfileLink(as *app.State, ps *cutil.PageState) string {
   311  //line views/layout/Nav.html:65
   312  	qb422016 := qt422016.AcquireByteBuffer()
   313  //line views/layout/Nav.html:65
   314  	WriteProfileLink(qb422016, as, ps)
   315  //line views/layout/Nav.html:65
   316  	qs422016 := string(qb422016.B)
   317  //line views/layout/Nav.html:65
   318  	qt422016.ReleaseByteBuffer(qb422016)
   319  //line views/layout/Nav.html:65
   320  	return qs422016
   321  //line views/layout/Nav.html:65
   322  }