Skip to content

Commit

Permalink
Show gem downloads ranking on gems page
Browse files Browse the repository at this point in the history
  • Loading branch information
juankuquintana committed May 21, 2023
1 parent 1843288 commit eeff20f
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 9 deletions.
3 changes: 3 additions & 0 deletions app/assets/stylesheets/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
.l-mb-4 {
margin-bottom: 1rem; }

.l-mb-6 {
margin-bottom: 1.5rem; }

.l-mb-8 {
margin-bottom: 2rem; }

Expand Down
1 change: 0 additions & 1 deletion app/assets/stylesheets/modules/gem.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
margin-bottom: 6px; }

.gem__downloads {
margin-bottom: 20px;
display: block;
font-weight: 800;
font-size: 24px; }
Expand Down
3 changes: 1 addition & 2 deletions app/assets/stylesheets/type.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@

.t-text--s {
font-weight: 500;
font-size: 12px;
text-transform: uppercase; }
font-size: 12px; }

.t-hidden {
position: absolute !important;
Expand Down
8 changes: 4 additions & 4 deletions app/views/profiles/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,19 @@
</div>

<div class="profile__downloads-wrap">
<h4 class="gem__downloads__heading t-text--s">
<h4 class="gem__downloads__heading t-text--s t-uppercase">
<%= t('stats.index.total_gems') %>
</h4>

<h2 id="profile-gems-count" class="gem__downloads">
<h2 id="profile-gems-count" class="gem__downloads l-mb-6">
<%= @user.total_rubygems_count.to_s %>
</h2>

<h4 id="downloads" class="gem__downloads__heading t-text--s">
<h4 id="downloads" class="gem__downloads__heading t-text--s t-uppercase">
<%= t('stats.index.total_downloads') %>
</h4>

<h2 id="downloads_count" class="gem__downloads">
<h2 id="downloads_count" class="gem__downloads l-mb-6">
<%= number_with_delimiter(@user.total_downloads_count) %>
</h2>
</div>
Expand Down
5 changes: 3 additions & 2 deletions app/views/rubygems/_aside.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@

<div class="gem__downloads-wrap" data-href="<%= api_v1_download_path(@latest_version.full_name, :format => 'json') %>">
<h2 class="gem__downloads__heading t-text--s">
<%= t('stats.index.total_downloads') %>
<span class="t-uppercase"><%= t('stats.index.total_downloads') %></span>
<span class="gem__downloads"><%= number_with_delimiter(@rubygem.downloads) %></span>
<span class="gem__downloads t-text--s l-mb-6"><%= t('stats.index.ranking', count: number_with_delimiter(@rubygem.gem_rank), total: number_with_delimiter(Rubygem.total_count)) %></span>
</h2>
<h2 class="gem__downloads__heading t-text--s">
<h2 class="gem__downloads__heading t-text--s t-uppercase">
<%= t('.downloads_for_this_version') %>
<span class="gem__downloads"><%= number_with_delimiter(@latest_version.downloads_count) %></span>
</h2>
Expand Down
1 change: 1 addition & 0 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ de:
total_downloads: Downloads insgesamt
total_gems: Gems insgesamt
total_users: Benutzer insgesamt
ranking: "%{count} von %{total}"
users:
create:
email_sent:
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ en:
total_downloads: Total downloads
total_gems: Total gems
total_users: Total users
ranking: "%{count} of %{total}"
users:
create:
email_sent: A confirmation mail has been sent to your email address.
Expand Down
1 change: 1 addition & 0 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ es:
total_downloads: Total de descargas
total_gems: Gemas totales
total_users: Usuarios totales
ranking: "%{count} de %{total}"
users:
create:
email_sent: Se ha enviado un correo de confirmación a tu casilla de correo electrónico.
Expand Down
1 change: 1 addition & 0 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@ fr:
total_downloads: Total de téléchargements
total_gems: Total de gems
total_users: Total d'utilisateurs
ranking: "%{count} de %{total}"
users:
create:
email_sent: Un email de confirmation a été envoyé sur votre adresse email.
Expand Down
1 change: 1 addition & 0 deletions config/locales/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ ja:
total_downloads: 累計ダウンロード数
total_gems: Gem総数
total_users: ユーザー総数
ranking:
users:
create:
email_sent: 確認メールがあなたのメールアドレスに送信されました。
Expand Down
1 change: 1 addition & 0 deletions config/locales/nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,7 @@ nl:
total_downloads:
total_gems:
total_users:
ranking:
users:
create:
email_sent: Een bevestigingsemail is naar je e-mailadres gestuurd
Expand Down
1 change: 1 addition & 0 deletions config/locales/pt-BR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ pt-BR:
total_downloads: Total de downloads
total_gems: Total de gems
total_users: Total de usuários
ranking: "%{count} de %{total}"
users:
create:
email_sent:
Expand Down
1 change: 1 addition & 0 deletions config/locales/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ zh-CN:
total_downloads: 下载总次数
total_gems: Gems 总数
total_users: 用户总数
ranking:
users:
create:
email_sent: 确认邮件已发送到您的电子邮件地址。
Expand Down
1 change: 1 addition & 0 deletions config/locales/zh-TW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,7 @@ zh-TW:
total_downloads: 總下載次數
total_gems: Gems 總數
total_users: 總使用者數量
ranking:
users:
create:
email_sent: 已發送確認信到你的信箱地址。
Expand Down

0 comments on commit eeff20f

Please sign in to comment.