Skip to content

Commit

Permalink
Merge pull request #262 from qor5/listing-inline
Browse files Browse the repository at this point in the history
listing rewrite
  • Loading branch information
sunfmin authored Jul 5, 2024
2 parents 7cb14ae + 9e47c66 commit 005d163
Show file tree
Hide file tree
Showing 170 changed files with 4,804 additions and 14,032 deletions.
2 changes: 1 addition & 1 deletion docs/docs/activity-log.html
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ <h2><a name="initialize-the-activity-package" class="anchor" href="#initialize-t

<p>To initialize activity package with the default configuration, you need to pass a <code>presets.Builder</code> instance and a database instance.</p>

<highlightjs :language='"go"' :code='"b.DataOperator(gorm2op.DataOperator(db))\n\nactivityBuilder := activity.New(db)\nb.Use(activityBuilder)"'></highlightjs>
<highlightjs :language='"go"' :code='"b.DataOperator(gorm2op.DataOperator(db))\n\nactivityBuilder := activity.New(db).AutoMigrate()\nb.Use(activityBuilder)"'></highlightjs>
<p>By default, the activity package uses QOR5 login package&#39;s <code>login.UserKey</code> as the default key to fetch the current user from the context. If you want to use your own key, you can use the <code>CreatorContextKey</code> function.</p>

<p>Same with above, the activity package uses the db instance that passed in during initialization to perform db operations. If you need another db to do the work, you can use <code>DBContextKey</code> method.</p>
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/advanced-functions/the-go-html-builder.html
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,14 @@ <h1 class='mb-8'>The Go HTML builder</h1>

<p>Consider the following code:</p>

<highlightjs :language='"go"' :code='"import (\n\t\"github.com/qor5/admin/v3/docs/docsrc/examples\"\n\t\"github.com/qor5/web/v3\"\n\t. \"github.com/theplant/htmlgo\"\n)\n\nfunc result(args ...HTMLComponent) HTMLComponent {\n\tvar converted []HTMLComponent\n\tfor _, arg := range args {\n\t\tconverted = append(converted, Div(arg).Class(\"wrapped\"))\n\t}\n\n\treturn HTML(\n\t\tHead(\n\t\t\tTitle(\"XML encoding with Go\"),\n\t\t),\n\t\tBody(\n\t\t\tH1(\"XML encoding with Go\"),\n\t\t\tP().Text(\"this format can be used as an alternative markup to XML\"),\n\t\t\tA().Href(\"http://golang.org\").Text(\"Go\"),\n\t\t\tP(\n\t\t\t\tText(\"this is some\"),\n\t\t\t\tB(\"mixed\"),\n\t\t\t\tText(\"text. For more see the\"),\n\t\t\t\tA().Href(\"http://golang.org\").Text(\"Go\"),\n\t\t\t\tText(\"project\"),\n\t\t\t),\n\t\t\tP().Text(\"some text\"),\n\n\t\t\tP(converted...),\n\t\t),\n\t)\n}\n\nfunc TypeSafeBuilderExample(ctx *web.EventContext) (pr web.PageResponse, err error) {\n\tpr.Body = result(H5(\"1\"), B(\"2\"), Strong(\"3\"))\n\treturn\n}\n\nvar TypeSafeBuilderSamplePFPB = web.Page(TypeSafeBuilderExample)\n\nvar TypeSafeBuilderSamplePath = examples.URLPathByFunc(TypeSafeBuilderExample)\n"'></highlightjs>
<highlightjs :language='"go"' :code='"import (\n\t\"github.com/qor5/web/v3\"\n\t. \"github.com/theplant/htmlgo\"\n)\n\nfunc result(args ...HTMLComponent) HTMLComponent {\n\tvar converted []HTMLComponent\n\tfor _, arg := range args {\n\t\tconverted = append(converted, Div(arg).Class(\"wrapped\"))\n\t}\n\n\treturn HTML(\n\t\tHead(\n\t\t\tTitle(\"XML encoding with Go\"),\n\t\t),\n\t\tBody(\n\t\t\tH1(\"XML encoding with Go\"),\n\t\t\tP().Text(\"this format can be used as an alternative markup to XML\"),\n\t\t\tA().Href(\"http://golang.org\").Text(\"Go\"),\n\t\t\tP(\n\t\t\t\tText(\"this is some\"),\n\t\t\t\tB(\"mixed\"),\n\t\t\t\tText(\"text. For more see the\"),\n\t\t\t\tA().Href(\"http://golang.org\").Text(\"Go\"),\n\t\t\t\tText(\"project\"),\n\t\t\t),\n\t\t\tP().Text(\"some text\"),\n\n\t\t\tP(converted...),\n\t\t),\n\t)\n}\n\nfunc TypeSafeBuilderExample(ctx *web.EventContext) (pr web.PageResponse, err error) {\n\tpr.Body = result(H5(\"1\"), B(\"2\"), Strong(\"3\"))\n\treturn\n}\n\nvar TypeSafeBuilderSamplePFPB = web.Page(TypeSafeBuilderExample)\n\nvar TypeSafeBuilderSamplePath = URLPathByFunc(TypeSafeBuilderExample)\n"'></highlightjs>
<p>It&#39;s basically assembled what Kotlin can do, Also is legitimate Go code.</p>

<div>
<div class='demo'>
<a href='/samples/type-safe-builder-example' target='_blank'>Check the demo</a>
<a href='/examples/type-safe-builder-example' target='_blank'>Check the demo</a>
|
<a href='https://github.com/qor5/admin/tree/main/docs/docsrc/examples/examples_web/type-safe-builder-sample.go#L3-L47' target='_blank'>Source on GitHub</a>
<a href='https://github.com/qor5/admin/tree/main/docs/docsrc/../../../../../../pkg/mod/github.com/qor5/web/[email protected]/examples/type-safe-builder-sample.go#L3-L46' target='_blank'>Source on GitHub</a>
</div>
</div>
</div>
Expand Down
202 changes: 101 additions & 101 deletions docs/docs/appendix/all-demo-examples.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/docs/basics/brand.html
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ <h2><a name="simple-customization" class="anchor" href="#simple-customization" r

<div>
<div class='demo'>
<a href='/samples/presets-brand-title/brands' target='_blank'>Check the demo</a>
<a href='/examples/presets-brand-title/brands' target='_blank'>Check the demo</a>
|
<a href='https://github.com/qor5/admin/tree/main/docs/docsrc/examples/examples_presets/brand.go#L19-L21' target='_blank'>Source on GitHub</a>
</div>
Expand All @@ -240,7 +240,7 @@ <h2><a name="full-customization" class="anchor" href="#full-customization" rel="

<div>
<div class='demo'>
<a href='/samples/presets-brand-func/brands' target='_blank'>Check the demo</a>
<a href='/examples/presets-brand-func/brands' target='_blank'>Check the demo</a>
|
<a href='https://github.com/qor5/admin/tree/main/docs/docsrc/examples/examples_presets/brand.go#L35-L41' target='_blank'>Source on GitHub</a>
</div>
Expand All @@ -253,7 +253,7 @@ <h2><a name="profile" class="anchor" href="#profile" rel="nofollow" aria-hidden=

<div>
<div class='demo'>
<a href='/samples/presets-profile/brands' target='_blank'>Check the demo</a>
<a href='/examples/presets-profile/brands' target='_blank'>Check the demo</a>
|
<a href='https://github.com/qor5/admin/tree/main/docs/docsrc/examples/examples_presets/profile.go#L11-L76' target='_blank'>Source on GitHub</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/basics/confirm-dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ <h2><a name="example" class="anchor" href="#example" rel="nofollow" aria-hidden=

<div>
<div class='demo'>
<a href='/samples/presets-confirm-dialog/confirm-dialog' target='_blank'>Check the demo</a>
<a href='/examples/presets-confirm-dialog/confirm-dialog' target='_blank'>Check the demo</a>
|
<a href='https://github.com/qor5/admin/tree/main/docs/docsrc/examples/examples_presets/confirm-dialog.go#L43-L53' target='_blank'>Source on GitHub</a>
</div>
Expand Down
Loading

0 comments on commit 005d163

Please sign in to comment.