Skip to content

Commit

Permalink
feat: faction data to bases
Browse files Browse the repository at this point in the history
  • Loading branch information
dd84ai committed Mar 26, 2024
1 parent e90e866 commit e0fa071
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
15 changes: 7 additions & 8 deletions darkstat/front/bases.templ
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ templ BasesT(bases []configs_export.Base) {
<thead>
<tr>
<th style="width:200px;">Base</th>
<th style="width:200px;">Owner - Faction</th>
<th style="width:100px;">System</th>
<th style="width:200px;">Base Nickname</th>
<th style="width:50px;">System Nickname</th>
Expand All @@ -117,6 +118,7 @@ templ BasesT(bases []configs_export.Base) {
hx-swap="innerHTML"
>
<td>{ base.Name }</td>
<td>{ base.FactionName }</td>
<td>{ base.System }</td>
<td>{ base.Nickname }</td>
<td>{ base.SystemNickname }</td>
Expand All @@ -140,7 +142,7 @@ templ BasesT(bases []configs_export.Base) {
</div>
</div>
<div id="infocard_view">
@Infocard()
@InfocardShared()
</div>
</div>
}
Expand All @@ -158,7 +160,7 @@ func RenderHooks(base configs_export.Base) string {
`
}

templ Infocard() {
templ InfocardShared() {
<style>
.infocard {
margin: 10px;
Expand All @@ -175,12 +177,9 @@ templ Infocard() {
</div>
}

templ BaseInfocard(info configs_export.Infocard) {
@Infocard() {
for _, line := range info.Start {
<p class="infocard_p">{ line }</p>
}
for _, line := range info.Middle {
templ Infocard(info configs_export.Infocard) {
@InfocardShared() {
for _, line := range info.Lines {
<p class="infocard_p">{ line }</p>
}
}
Expand Down
4 changes: 2 additions & 2 deletions darkstat/linker/linker.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (l *Linker) Link() *builder.Builder {
build.RegComps(
builder.NewComponent(
utils_types.FilePath(front.BaseInfocardUrl(base)),
front.BaseInfocard(base.Infocard),
front.Infocard(base.Infocard),
),

builder.NewComponent(
Expand All @@ -85,7 +85,7 @@ func (l *Linker) Link() *builder.Builder {
build.RegComps(
builder.NewComponent(
utils_types.FilePath(front.MarketGoodInfocardUrl(good.Nickname)),
front.BaseInfocard(good.Infocard),
front.Infocard(good.Infocard),
),
)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.21.1

require (
github.com/a-h/templ v0.2.543
github.com/darklab8/fl-configs v0.11.0
github.com/darklab8/fl-configs v0.12.0
github.com/darklab8/go-typelog v0.6.0
github.com/darklab8/go-utils v0.12.0
github.com/yosssi/gohtml v0.0.0-20201013000340-ee4748c638f4
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ github.com/darklab8/fl-configs v0.10.0 h1:RtqFpYIzS4tfCcqp0gRGN/EkVor8lSJHEKq7gv
github.com/darklab8/fl-configs v0.10.0/go.mod h1:8zaCaFL21TvawP65KB9NOJ+nEpaMDQYsnoOi77RiSVY=
github.com/darklab8/fl-configs v0.11.0 h1:uvxcxFpAvJv6JB/zvgQb2wC58jY/fi6rFGXtg5zR6E0=
github.com/darklab8/fl-configs v0.11.0/go.mod h1:8zaCaFL21TvawP65KB9NOJ+nEpaMDQYsnoOi77RiSVY=
github.com/darklab8/fl-configs v0.12.0 h1:6Zrxm/iY1Qo4JqR0gGCy9mOIIWfsPwSKbAWUE/si/XE=
github.com/darklab8/fl-configs v0.12.0/go.mod h1:8zaCaFL21TvawP65KB9NOJ+nEpaMDQYsnoOi77RiSVY=
github.com/darklab8/go-typelog v0.5.0 h1:7/lG9BH1svf2vcSOdNhYbFhKBr8tveHBgw4D/ChaISA=
github.com/darklab8/go-typelog v0.5.0/go.mod h1:AwwOf3dkp/tpevHFNbkB+PbwlDrUUgO1CVFkEnj+q5w=
github.com/darklab8/go-typelog v0.6.0 h1:Ci8imc7ScXiy5e1qMgf46NyJjrqNLPoIE1gbVe7bxl4=
Expand Down

0 comments on commit e0fa071

Please sign in to comment.