diff --git a/models/table.models.go b/models/table.models.go new file mode 100644 index 0000000..2640e7f --- /dev/null +++ b/models/table.models.go @@ -0,0 +1 @@ +package models diff --git a/views/component/navbarmaster/navbarmaster.templ b/views/component/navbarmaster/navbarmaster.templ new file mode 100644 index 0000000..e501b68 --- /dev/null +++ b/views/component/navbarmaster/navbarmaster.templ @@ -0,0 +1,655 @@ +package navbarmaster + +import ( + "github.com/emarifer/go-templ-project-structure/views/component/sidebarmaster" + "github.com/emarifer/go-templ-project-structure/services" +) + +templ MainNavbar(datamenu []services.MasterMenu) { +
+ +
+ + + +
+ +
+} + +templ Navbarmaster(datamenu []services.MasterMenu, content templ.Component) { + +
+ + + Logo + + + +
+ + + + + + +
+ +
+ + +
+ +
+ +
+ +
+ + + + + + +
+ + + @MainNavbar(datamenu) + +
+ + +
+ +
+ +
+ +
+ + +
+ +
+
+ Hi, + Sean + + S + +
+
+ +
+ +
+ +
+ + + @content + +
+ +
+ +
+ +} + +templ Navbaruserprofile() { +
+ +
+

+ User Profile + 12 messages +

+ + + +
+ + +
+ +
+
+
+ +
+ +
+ + +
+ + + + + +
+ + +
+ +
+ Recent Notifications +
+ + +
+ + + + + + + + + + + + + + +28% +
+ + +
+ + + + + + + + + + + + +
+ + Would + be to people + + Due in 2 Days +
+ +50% +
+ + +
+ + + + + + + + + + + + + + -27% +
+ + +
+ + + + + + + + + + + + + + +
+ + The + best product + + Due in 2 Days +
+ +8% +
+ +
+ +
+ +
+} diff --git a/views/component/navbarmaster/navbarmaster_templ.go b/views/component/navbarmaster/navbarmaster_templ.go new file mode 100644 index 0000000..7fb123b --- /dev/null +++ b/views/component/navbarmaster/navbarmaster_templ.go @@ -0,0 +1,138 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package navbarmaster + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import "context" +import "io" +import "bytes" + +import ( + "github.com/emarifer/go-templ-project-structure/services" + "github.com/emarifer/go-templ-project-structure/views/component/sidebarmaster" +) + +func MainNavbar(datamenu []services.MasterMenu) templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Navbarmaster(datamenu []services.MasterMenu, content templ.Component) templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
\"Logo\"
\"Logo\"
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = MainNavbar(datamenu).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Hi, Sean S
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = content.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Navbaruserprofile() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

User Profile\r 12 messages

Recent Notifications\r
+28%
+50%
The\r best product\r Due in 2 Days
+8%
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} diff --git a/views/layout/layout_corporate.templ b/views/layout/layout_corporate.templ new file mode 100644 index 0000000..84e01e0 --- /dev/null +++ b/views/layout/layout_corporate.templ @@ -0,0 +1,177 @@ +package layout + +// LAYOUT PLAYGROUND +templ CorporateLayout(title string, css templ.Component, js templ.Component) { + + + + + + + + Company Portal | { title } + + + + + + + + + + + + + + + + + + + + + + + @css + + + + + // htmx + + + { children... } + + + + + + + + + + + + @js + + + + +} diff --git a/views/layout/layout_corporate_templ.go b/views/layout/layout_corporate_templ.go new file mode 100644 index 0000000..2fa0c4a --- /dev/null +++ b/views/layout/layout_corporate_templ.go @@ -0,0 +1,73 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package layout + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import "context" +import "io" +import "bytes" + +// LAYOUT PLAYGROUND +func CorporateLayout(title string, css templ.Component, js templ.Component) templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Company Portal | ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var2 string + templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(title) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\layout\layout_corporate.templ`, Line: 23, Col: 34} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = css.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = js.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} diff --git a/views/mastermenuusergroup/mastermenuusergroup.templ b/views/mastermenuusergroup/mastermenuusergroup.templ index 624e94f..8d2baf0 100644 --- a/views/mastermenuusergroup/mastermenuusergroup.templ +++ b/views/mastermenuusergroup/mastermenuusergroup.templ @@ -1,704 +1,20 @@ package mastermenuusergroup import ( + "github.com/emarifer/go-templ-project-structure/views/component/breadcrumbadmin" "github.com/emarifer/go-templ-project-structure/views/layout" "github.com/emarifer/go-templ-project-structure/services" - "github.com/emarifer/go-templ-project-structure/views/component/sidebarmaster" - "github.com/emarifer/go-templ-project-structure/views/component/breadcrumbadmin" + "github.com/emarifer/go-templ-project-structure/views/component/navbarmaster" ) - -templ MainNavbar(datamenu []services.MasterMenu) { -
- -
- - - -
- -
-} - templ MainMasterMenuUserGroup(datamenu []services.MasterMenu) { -
- - - Logo - - - -
- - - - - - - - - -
- -
+ @navbarmaster.Navbarmaster(datamenu, ContentMasterMenuUserGroup()) -
- -
- -
- -
- - - - - - -
- - - @MainNavbar(datamenu) - -
- - -
- -
- -
- -
- - -
- -
-
- Hi, - Sean - - S - -
-
- -
- -
- -
- - -
-
- @breadcrumadmin.MainBreadcrumbAdmin() -
-
- - - - -
- -
- -
-
- -
-

- User Profile - 12 messages -

- - - -
- - -
- -
-
-
- -
- -
- - -
- - - - - -
- - -
- -
- Recent Notifications -
- - -
- - - - - - - - - - - - - - +28% -
- - -
- - - - - - - - - - - - -
- - Would - be to people - - Due in 2 Days -
- +50% -
- - -
- - - - - - - - - - - - - - -27% -
- - -
- - - - - - - - - - - - - - -
- - The - best product - - Due in 2 Days -
- +8% -
- -
- -
- -
+ @navbarmaster.Navbaruserprofile()
@@ -727,6 +43,78 @@ templ MainMasterMenuUserGroup(datamenu []services.MasterMenu) { } +templ ContentMasterMenuUserGroup() { +
+
+
+ @breadcrumadmin.MainBreadcrumbAdmin() +
+
+ //
+
+ +
+
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + +
KODEUSER GROUPACTION
001Admin +
+ + +
+
002Tes +
+ + +
+
+
+
+ +
+
+ + + ... + 23 + 24 + 25 + 26 + 27 + 28 + ... + + +
+
+ +
+
+} + templ CssMasterMenuUserGroup() {
    ") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - for index, d := range datamenu { - if index == 0 { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = sidebarmaster.MenuDashboard(d.ParentMenuName, d.ParentUrl).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
  • Menu

  • ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if index+1 < len(datamenu) { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = sidebarmaster.ListMenuNavbar(datamenu[index+1].ParentMenuName, datamenu[index+1].Children).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } + templ_7745c5c3_Err = navbarmaster.Navbarmaster(datamenu, ContentMasterMenuUserGroup()).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = navbarmaster.Navbaruserprofile().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -75,7 +57,7 @@ func MainNavbar(datamenu []services.MasterMenu) templ.Component { }) } -func MainMasterMenuUserGroup(datamenu []services.MasterMenu) templ.Component { +func ContentMasterMenuUserGroup() templ.Component { return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) if !templ_7745c5c3_IsBuffer { @@ -88,15 +70,7 @@ func MainMasterMenuUserGroup(datamenu []services.MasterMenu) templ.Component { templ_7745c5c3_Var2 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
\"Logo\"
\"Logo\"
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = MainNavbar(datamenu).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Hi, Sean S
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -104,7 +78,7 @@ func MainMasterMenuUserGroup(datamenu []services.MasterMenu) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
KODEUSER GROUPACTION
001Admin
002Tes
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err }