Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix-stat-spacing #344

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 34 additions & 33 deletions app/site/_layouts/org-report.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -16,44 +16,45 @@ layout: base
>
</h1>
</div>

<div class="report_container">
{% if organization %}
<h2>Organization Stats</h2>
<div class="github-information">
<div class="stat-container" id="projects">
<div class="projects-heading">
<h4 class=repo-stats>
<span>
<svg
class="usa-icon"
aria-labelledby="projects-count"
role="img"
>
{% lucide "folder-git-2" %}
</svg>
</span>
Repositories
</h4>
<div class="org-github-info">
<div class="github-information org-info">
<div class="stat-container" id="projects">
<div class="projects-heading">
<h4 class="repo-stats">
<span>
<svg
class="usa-icon"
aria-labelledby="projects-count"
role="img"
>
{% lucide "folder-git-2" %}
</svg>
</span>
Repositories
</h4>
</div>
<p>{{ organization.repo_count }}</p>
</div>
<p>{{ organization.repo_count }}</p>
</div>
<div class="stat-container" id="followers">
<div class="followers-heading">
<h4 class=repo-stats>
<span>
<svg
class="usa-icon"
aria-labelledby="followers-count"
role="img"
>
{% lucide "users-2" %}
</svg>
</span>
Followers
</h4>
<div class="stat-container" id="followers">
<div class="followers-heading">
<h4 class="repo-stats">
<span>
<svg
class="usa-icon"
aria-labelledby="followers-count"
role="img"
>
{% lucide "users-2" %}
</svg>
</span>
Followers
</h4>
</div>
<p>{{ organization.followers_count }}</p>
</div>
<p>{{ organization.followers_count }}</p>
</div>
</div>
{% else %}
Expand Down
43 changes: 27 additions & 16 deletions app/site/_layouts/repo-report.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,24 @@ layout: base
</div>
<p>{{ project.pull_requests_count }}</p>
</div>
<div class="stat-container" id="project-age" onclick="toggleDateAge(this)" style="cursor: pointer;">
<div class="stat-container" id="project-created">
<div class="project-age-heading">
<h4>
<span>
<svg
class="usa-icon"
aria-labelledby="project-created"
role="img"
>
{% lucide "calendar" %}
</svg>
</span>
Project Creation Date
</h4>
</div>
<p>{{ project.created_at | date: '%B %d, %Y' }}</p>
</div>
<div class="stat-container" id="project-age">
<div class="project-age-heading">
<h4>
<span>
Expand All @@ -182,26 +199,20 @@ layout: base
{% lucide "calendar" %}
</svg>
</span>
<span class="date">Project Creation Date</span>
<span class="age" style="display: none;">Age of Project</span>
Age of Project
</h4>
</div>
<p style="text-decoration: underline;">
<span class="date">
{{ project.created_at | date: '%B %d, %Y' }}
</span>
<span class="age" style="display: none;">
{% comment %} takes project created + todays date and turns it into seconds {% endcomment %}
{% assign created_date = project.created_at | date: '%s' | plus: 0 %}
{% assign current_date = 'now' | date: '%s' | plus: 0 %}
<p>
{% comment %} takes project created + todays date and turns it into seconds {% endcomment %}
{% assign created_date = project.created_at | date: '%s' | plus: 0 %}
{% assign current_date = 'now' | date: '%s' | plus: 0 %}

{% assign age_seconds = current_date | minus: created_date %}
{% assign age_seconds = current_date | minus: created_date %}

{% comment %} divide by how many seconds are in a day to convert back into days {% endcomment %}
{% assign age_days = age_seconds | divided_by: 86400.0 | round %}
{% comment %} divide by how many seconds are in a day to convert back into days {% endcomment %}
{% assign age_days = age_seconds | divided_by: 86400.0 | round %}

{{ age_days }} day{% if age_days != 1 %}s{% endif %}
</span>
{{ age_days }} day{% if age_days != 1 %}s{% endif %}
</p>
</div>
</div>
Expand Down
22 changes: 19 additions & 3 deletions app/src/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,11 @@ a.usa-link:visited {
width: 95%;
}

/* .org-github-info {
display: flex;
justify-content: center;
} */

.github-information {
display: flex;
justify-content: space-around;
Expand Down Expand Up @@ -524,8 +529,6 @@ a.usa-link:visited {
display: flex;
flex-direction: column;
align-items: center;
/* flex-wrap: wrap; */
/* gap: 1rem; */
justify-content: center;
}

Expand Down Expand Up @@ -706,7 +709,11 @@ iframe:focus, [href]:focus, [tabindex]:focus, [contentEditable=true]:focus {

.github-information {
flex-wrap: wrap;
justify-content: space-between;
justify-content: center;
}

.org-info {
justify-content: space-evenly;
}

.stat-container {
Expand Down Expand Up @@ -757,6 +764,15 @@ iframe:focus, [href]:focus, [tabindex]:focus, [contentEditable=true]:focus {
.home-icon-container {
height: 90px;
}

.org-github-info {
display: flex;
justify-content: center;
}

.org-info {
width: 50%;
}
}

@media (max-width: 1023px) {
Expand Down
Loading