Skip to content

Commit

Permalink
Merge pull request #3 from Kaiserdragon2/main
Browse files Browse the repository at this point in the history
Updatable Dashboard
  • Loading branch information
Kaiserdragon2 authored Mar 15, 2024
2 parents c9f01e5 + 0b211df commit a5f3f68
Show file tree
Hide file tree
Showing 10 changed files with 711 additions and 66 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/combine_appfilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,22 @@
import hashlib
import requests


# Get the repository
# Change this to your Repo
repo = g.get_repo("Arcticons-Team/Arcticons")

# Get the branch name
# Change this to your branch name
branchName = "main"


# Your GitHub token
github_token = os.getenv('GITHUB_TOKEN')

# Initialize the GitHub instance
g = Github(github_token)

# Get the repository
repo = g.get_repo("Arcticons-Team/Arcticons")

def combine_xml_files(input_files, output_file):
unique_components = set()
output_root = ET.Element('resources') # Root element for the output XML tree
Expand Down Expand Up @@ -112,7 +119,7 @@ def combine_all_appfilters():

# Try to get the content of the existing combined_appfilter.xml file
try:
existing_file = repo.get_contents('docs/assets/combined_appfilter.xml', ref='icon-requests')
existing_file = repo.get_contents('docs/assets/combined_appfilter.xml', ref=branchName)
print(existing_file) # Debugging statement
if existing_file:
try:
Expand Down Expand Up @@ -149,11 +156,11 @@ def combine_all_appfilters():
try:
if existing_content is None:
# Create the combined_appfilter.xml file in the repository
repo.create_file('docs/assets/combined_appfilter.xml', 'Created combined appfilter.xml from pull requests', new_content, branch='icon-requests')
repo.create_file('docs/assets/combined_appfilter.xml', 'Created combined appfilter.xml from pull requests', new_content, branch=branchName)
print("Created combined_appfilter.xml in the repository.")
else:
# Update the combined_appfilter.xml file in the repository
repo.update_file('docs/assets/combined_appfilter.xml', 'Updated combined appfilter.xml from pull requests', new_content, existing_sha, branch='icon-requests')
repo.update_file('docs/assets/combined_appfilter.xml', 'Updated combined appfilter.xml from pull requests', new_content, existing_sha, branch=branchName)
print("Updated combined_appfilter.xml in the repository.")
except Exception as e:
print(f"Error updating/creating combined_appfilter.xml in the repository: {e}")
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ It also checks your pull requests and removes the entries from the requests list
## How to set it up

1. Clone this repo
2. Open `docs/js/requests.js` Change `Arcticons-Team` to your username and possibly `Icon-Request-Dashboard` to your project name too. : `https://raw.githubusercontent.com/Arcticons-Team/Icon-Request-Dashboard/main/generated/requests.txt`
3. Repeat the previous step for the combined appfilter. `https://raw.githubusercontent.com/Arcticons-Team/Arcticons/Icon-Request-Dashboard/docs/assets/combined_appfilter.xml`
2. Open `docs/js/requests.js` and `docs/js/updatable.js` Change the variables at the top of the file from `Arcticons-Team` to your username and possibly `Icon-Request-Dashboard` to your project name and the branch name too.
3. Open `.github/workflows/combine_appfilter.py` Change the Repository an the Branch to yours.
4. Setup GitHub Pages in your repo's Settings: **Pages > Deploy from branch > main /docs**
(Using it with localhost is possible too, if you don't use the GitHub actions)

Expand All @@ -22,4 +22,4 @@ This generates a `requests.txt` file and an `updatable.txt` if existing apps hav
- **mail_folder_path** if you followed step 3 it should be `mail/`
- **appfilter_path** the folder where you keep your appfilter.
- **extracted_png_folder_path** the location to save all PNGs from icon requests `../docs/extracted_png`
- **requests_path** the path to your requests.txt file `../generated/requests.txt`
- **requests_path** the path to the folder containing your requests.txt file `../generated/`
51 changes: 47 additions & 4 deletions docs/css/requests.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,42 @@
font-style: oblique 0deg 10deg;
font-variation-settings: "slnt" 0deg;
src: url("../img/Inter.var.woff2") format("woff2");
}
}

.header-container {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20px;
;
}

#updatable-container {
margin-right: 15px;
width: 150px;
align-items: center;
justify-content: center;
;
}

#updatable-button {
cursor: pointer;
background-color: #4CAF50;
color: white;
border: none;
padding: 5px 15px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin-bottom: 10px;
border-radius: 100px;
}

#updatable-button:hover {
background-color: #409943;
}

body {
font-family: 'Inter', Arial, Helvetica, sans-serif, sans-serif;
Expand Down Expand Up @@ -66,6 +101,7 @@ body {
margin: 0 auto;
align-items: center;
justify-content: center;
padding-left: 165px;

}

Expand All @@ -80,7 +116,7 @@ body {
border: 1.5px solid #171717;
box-shadow: none;
outline: none;
padding: 0.8em 1.2em;
padding: 0.8em 1.2em;
font-size: 16px;
font-weight: bold;
font-family: 'Inter', Arial, Helvetica, sans-serif, sans-serif;
Expand Down Expand Up @@ -143,6 +179,7 @@ td {
td:nth-child(1) {
width: 20%;
}

td:nth-child(2) {
min-width: 55px;
max-width: 60px;
Expand Down Expand Up @@ -179,6 +216,7 @@ h1 {
margin-top: 20px;
margin-bottom: 20px;
}

h2 {
text-align: center;
margin-top: 20px;
Expand All @@ -187,27 +225,32 @@ h2 {

.links img {
filter: invert();
width:50px;
height:50px;
width: 50px;
height: 50px;
}

@media (prefers-color-scheme: dark) {
body {
background-color: #171717;
color: white;
}

tr:nth-child(even) {
background-color: rgb(37, 37, 37);
}

th {
background-color: #0f0f0f;
}

.links img {
filter: none;
}

.asc::after {
border-bottom: 4px solid white;
}

.desc::after {
border-top: 4px solid white;
}
Expand Down
Loading

0 comments on commit a5f3f68

Please sign in to comment.