Skip to content

Commit

Permalink
Merge pull request #194 from loftwah/dl/achievements-improve
Browse files Browse the repository at this point in the history
Dl/achievements improve
  • Loading branch information
loftwah authored Sep 21, 2024
2 parents 31bdd1e + 0c9d843 commit 25b87e6
Showing 1 changed file with 38 additions and 41 deletions.
79 changes: 38 additions & 41 deletions app/views/links/user_links.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,53 +13,54 @@
</div>
</div>

<div class="mt-4 text-center">
<h1 class="text-2xl font-bold text-white"><%= @user.full_name %></h1>
<h2 class="text-xl font-bold text-white"><%= @user.username %></h2>
<div class="flex flex-wrap justify-center mt-2">
<% @user.tags.each do |tag| %>
<span class="bg-gray-700 text-white rounded px-2 py-1 m-1"><%= tag %></span>
<% end %>
</div>
<div class="mt-4 text-center max-w-2xl mx-auto">
<h1 class="text-2xl font-bold text-white"><%= @user.full_name %></h1>
<h2 class="text-xl font-bold text-white"><%= @user.username %></h2>
<div class="flex flex-wrap justify-center mt-2">
<% @user.tags.each do |tag| %>
<span class="bg-gray-700 text-white rounded px-2 py-1 m-1"><%= tag %></span>
<% end %>
</div>
</div>

<% if @pinned_links.any? %>
<div class="mt-4">
<div class="flex flex-wrap justify-center">
<% @pinned_links.order(:position).each do |link| %> <!-- Add ordering here -->
<%= link_to link_path(link), target: "_blank", class: 'bg-gray-800 p-3 m-1 rounded hover:underline' do %>
<% if link.icon.present? %>
<i class="<%= link.icon %> text-lime-300"></i>
<% end %>
<% if @pinned_links.any? %>
<div class="mt-4">
<div class="flex flex-wrap justify-center max-w-2xl mx-auto">
<% @pinned_links.order(:position).each do |link| %>
<%= link_to link_path(link), target: "_blank", class: 'bg-gray-800 p-3 m-1 rounded hover:underline' do %>
<% if link.icon.present? %>
<i class="<%= link.icon %> text-lime-300"></i>
<% end %>
<% end %>
</div>
<% end %>
</div>
</div>
<% end %>

<div class="pb-4 text-center">
<p class="text-lg text-white"><%= auto_link_urls(@user.description || "") %></p>
</div>
<div class="pb-4 text-center max-w-2xl mx-auto">
<p class="text-lg text-white"><%= auto_link_urls(@user.description || "") %></p>
</div>

<div class="links-section max-w-4xl mx-auto mt-8 text-center">
<h2 class="text-2xl font-bold pt-2 pb-2 text-white">Links</h2>
<ul class="space-y-4">
<% @links.where(pinned: false).each do |link| %>
<li class="bg-gray-800 p-3 rounded shadow-md max-w-2xl mx-auto">
<h2 class="text-xl text-lime-300 font-bold">
<%= link_to link_path(link), target: "_blank", class: 'hover:underline' do %>
<% if link.icon.present? %>
<i class="<%= link.icon %> text-lime-300"></i>
<% if @links.where(pinned: false).any? %>
<div class="links-section max-w-4xl mx-auto mt-8 text-center">
<h2 class="text-2xl font-bold pt-2 pb-2 text-white">Links</h2>
<ul class="space-y-4">
<% @links.where(pinned: false).each do |link| %>
<li class="bg-gray-800 p-3 rounded shadow-md max-w-2xl mx-auto">
<h2 class="text-xl text-lime-300 font-bold">
<%= link_to link_path(link), target: "_blank", class: 'hover:underline' do %>
<% if link.icon.present? %>
<i class="<%= link.icon %> text-lime-300"></i>
<% end %>
<%= link.title %>
<% end %>
<%= link.title %>
<% end %>
</h2>
<p class="text-gray-400"><%= link.description %></p>
</li>
<% end %>
</ul>
</div>
</h2>
<p class="text-gray-400"><%= link.description %></p>
</li>
<% end %>
</ul>
</div>
<% end %>

<div id="hidden-links-data" style="display: none;" data-hidden-links="<%= @hidden_links.to_json %>"></div>

Expand All @@ -85,10 +86,6 @@
<% end %>
</ul>
</div>
<% else %>
<div class="max-w-4xl mx-auto mt-12 text-center">
<p class="text-gray-500">No achievements to display.</p>
</div>
<% end %>

<% if @user.public_analytics %>
Expand Down

0 comments on commit 25b87e6

Please sign in to comment.