Skip to content

Commit

Permalink
Merge pull request #2 from zachlasiuk/main
Browse files Browse the repository at this point in the history
Fixed several features like table highlighting, active category filter display, and github links fixed.
  • Loading branch information
zachlasiuk authored Jan 30, 2024
2 parents b6ec1a9 + 2e103bf commit 57ab4b8
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 8 deletions.
29 changes: 29 additions & 0 deletions category_parser.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import os, yaml

# LOAD ALL CATS
all_cats = ''
with open('data/all_categories.yml', 'r') as all_cat_file:
all_cats = yaml.safe_load(all_cat_file)

# CREATE NEW ACTIVE_CATS LIST
content_dir = 'content/sw_database'
active_cats = []
for content_file in os.listdir(content_dir):
if (content_file != ('_index.md')) and content_file.endswith('.md'):
# OBTAIN CATEGORY FROM FILE
cat = None
with open(os.path.join(content_dir, content_file), 'r') as f:
content_all = f.read()
start = content_all.find('---')
end = content_all.find('---', start + 3)
content_metadata = content_all[start+3:end].strip()
cat = yaml.safe_load(content_metadata).get('category')
# ADD TO ACTIVE_CATS LIST IF NOT ALREADY PRESENT
if cat in all_cats:
if cat not in active_cats:
active_cats.append(cat)

# SAVE ACTIVE_CATS LIST
with open('data/active_categories.yml', 'w') as active_cats_file:
yaml.safe_dump(list(active_cats), active_cats_file, default_flow_style=False)

3 changes: 3 additions & 0 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ cloudFrontDistributionID = "EBSHXJ6P4DYP8"
# location of assets
assetsDir = "assets"

# Repository configuration (URLs for in-page links to opening issues and suggesting changes)
github_repo = "https://github.com/ArmDeveloperEcosystem/ecosystem-dashboard-for-arm"
github_project_repo = "https://github.com/ArmDeveloperEcosystem/ecosystem-dashboard-for-arm"
3 changes: 3 additions & 0 deletions content/_index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
title: Arm Ecosystem Dashboard
active_filters:
- test1
- ttx
---


Expand Down
10 changes: 10 additions & 0 deletions data/active_categories.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- Containers and Orchestration
- Runtimes
- Databases - noSQL
- Compilers/Tools
- Monitoring/Observability
- Databases - Big-data
- Distros
- Storage
- Operating System
- Networking
File renamed without changes.
22 changes: 14 additions & 8 deletions themes/arm-design-system-hugo-theme/layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
<!-- Get all SWs -->
<!-- Get all Filter categories from file -->
{{ $swData := .Site.GetPage "/sw_database" }}

{{$filter_categories := .Site.Data.categories }}
{{$filter_categories := .Site.Data.active_categories }}



Expand All @@ -26,13 +25,16 @@

<div id="all-content-div" class="c-container is-responsive-width" style="min-height: 250px;">
<p style="margin-bottom: 16px; text-align: center;">
The following elements will still be added to this screen at this top level:
(1) Legal Disclaimer text and what this webpage is about.
(2) CTA to view these packages as a graphic.
(3) CTA to have users add a new package.
The other functionality works as is.
Migrating your cloud server app to Arm?
Discover what software packages work on Arm, the recommended and minimum supported versions, download links, and quick-start resources.
<br>
This data is sourced from Arm and our wide software ecosystem.
While we make our best efforts to keep this dashboard accurate, there are no guarantees of data correctness due to the ever-evolving software landscape.
For more details, read the <a href="https://github.com/ArmDeveloperEcosystem/ecosystem-dashboard-for-arm/blob/main/datapoint-boundary-conditions.md" target="_blank"> contribution guidelines here</a> to understand how packages are added.
</p>



<!-- Page wrapping row -->
<div class="c-row md:is-collapsed u-gap-1-1/2 u-flex-nowrap u-padding-top-2 u-padding-bottom-2-1/2">
<!-- Filter bar on left -->
Expand All @@ -43,6 +45,10 @@
<!-- Search & Results on Right -->
<div class="c-col">

<!-- Guided content for new starters -->
<div style="text-align: left; margin-top: -16px; padding-bottom: 16px; padding-left: 16px;">
<a href="https://github.com/ArmDeveloperEcosystem/ecosystem-dashboard-for-arm/blob/main/contrib.md"><h6 class="basics-title">Package missing that works on Arm? Submit it via GitHub. </h6></a>
</div>

<!-- Search, and mobile filtering support -->
{{ partial "eco-dashboard/mobile-search-and-filter.html" (dict "context" . "categories" $filter_categories)}}
Expand Down Expand Up @@ -103,7 +109,7 @@
<u><b>Category:</b> {{.Params.category}}</u>
</td>
<td style="margin: 0px; padding: 0px;">
<a href="https://www.github.com" target="_blank" style="text-decoration: none;"><p class="github-link"><span><i class="left-hand-icon fa-brands fa-github"></i>&nbsp;&nbsp;Issues? Update here.</p></span></a>
{{partial "eco-dashboard/github-links.html" . }}
</td>
</tr>
</table>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!-- GitHub links calculated from GitHub repo, defined in config.toml -->
{{ $pathFormatted := replace .File.Path "\\" "/" -}}
{{ $gh_repo := ($.Param "github_repo") -}}
{{ $gh_branch := (default "main" ($.Param "github_branch")) -}}
{{ $gh_repo_path := printf "%s/content/%s" $gh_branch $pathFormatted -}}

{{ $editURL := printf "%s/edit/%s" $gh_repo $gh_repo_path -}}

<!-- Display github elements -->

<a href="{{ $editURL }}" target="_blank" style="text-decoration: none;">
<p class="github-link">
<span>
<i class="left-hand-icon fa-brands fa-github"></i>
&nbsp;&nbsp;Issues? Update here.
</span>
</p>
</a>

Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ function hideElements(all_path_cards,results_to_hide) {
if (results_to_hide.includes(card)) {
// Hide card and subrow!
card.setAttribute('hidden',true);
// Remove 'clicked' attribute
card.classList.remove("main-sw-row--clicked");

if (card.nextElementSibling){ // temp to enable card view too
card.nextElementSibling.setAttribute('hidden',true);
}
Expand Down

0 comments on commit 57ab4b8

Please sign in to comment.