-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dynamically render search results for CodeSystem by OID (#52)
- Loading branch information
Showing
14 changed files
with
371 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package components | ||
|
||
import ( | ||
"strconv" | ||
"github.com/skylight-hq/phinvads-go/internal/database/models" | ||
) | ||
|
||
templ CodeSystemResult(searchTerm string, searchResults *models.CodeSystemResultRow) { | ||
<div> | ||
@CodeSystemResultsCount(searchResults) | ||
<div class="search-results__table" role="table" aria-label="table"> | ||
<div role="rowgroup"> | ||
<div class="cdc-header top-header"> | ||
<div class="col search-results page-count">Showing {strconv.Itoa(searchResults.PageCount)} of {searchResults.CodeSystemsCount} Code Systems</div> | ||
<div | ||
if searchResults.PageCount >=5 { | ||
class="pagination" | ||
} else { | ||
class="pagination" | ||
hidden | ||
} | ||
> | ||
<div class="col search-results page-buttons"> | ||
<button class="active page-button">1</button> | ||
<button class="page-button">2</button> | ||
<button class="page-button">3</button> | ||
<button class="page-button">4</button> | ||
<button class="page-button">5</button> | ||
<div class="button-next"> | ||
<button class="page-button">Next</button> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="col search-results download-button"> | ||
if searchResults.ValueSetsCount == "0" { | ||
<button disabled aria-disabled="true"> | ||
<img src="/assets/img/material-icons/file_download_off.svg"> | ||
Download Value Set | ||
</button> | ||
} else { | ||
<button disabled aria-disabled="true"> | ||
<img src="/assets/img/material-icons/file_download_off.svg"> | ||
Download Value Set | ||
</button> | ||
} | ||
</div> | ||
</div> | ||
@CodeSystemTableHeader() | ||
</div> | ||
<div role="rowgroup"> | ||
for idx, item := range searchResults.CodeSystems { | ||
if idx <= 4 { | ||
// modulo check allows alternating background color | ||
@CodeSystemResultRow(idx % 2 != 0, item) | ||
} | ||
} | ||
</div> | ||
</div> | ||
</div> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package components | ||
|
||
import "github.com/skylight-hq/phinvads-go/internal/database/models/xo" | ||
|
||
templ CodeSystemResultRow(alternate bool, result *xo.CodeSystem) { | ||
<div | ||
if alternate == true { | ||
class="row content-row" role="row" | ||
} else { | ||
class="row content-row alternate-bg" role="row" | ||
} | ||
> | ||
<div class="col check"> | ||
<div role="cell"> | ||
<input | ||
type="checkbox" | ||
value={result.Codesystemcode} | ||
> | ||
</div> | ||
</div> | ||
<div class="col"> | ||
<div role="cell"> | ||
<p>{result.Codesystemcode}</p> | ||
</div> | ||
</div> | ||
<div class="col"> | ||
<div role="cell"> | ||
<p>{result.Name}</p> | ||
</div> | ||
</div> | ||
<div class="col"> | ||
<div role="cell"> | ||
<p>{result.Oid}</p> | ||
</div> | ||
</div> | ||
</div> | ||
} |
Oops, something went wrong.