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

Update gem show styles #761

Merged
merged 1 commit into from Nov 24, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions app/helpers/rubygems_helper.rb
Expand Up @@ -86,9 +86,8 @@ def stats_options(rubygem)

def links_to_owners(rubygem)
rubygem.owners.sort_by(&:id).map do |owner|
link_to profile_path(owner.display_id), :class => 'project__member--v' do
gravatar(64, "gravatar-#{owner.id}", owner) + "<p class='project__member__name'>#{h owner.display_handle}</p>".html_safe
end
link_to gravatar(48, "gravatar-#{owner.id}", owner), profile_path(owner.display_id),
:alt => owner.display_handle, :title => owner.display_handle
end.join.html_safe
end

Expand Down
4 changes: 2 additions & 2 deletions app/views/layouts/application.html.erb
Expand Up @@ -111,7 +111,7 @@
<%= link_to @title, @title_url, class: "t-link--black" %>

<% if @subtitle %>
<i class="gem__version"><%= @subtitle.html_safe %></i>
<i class="page__subheading"><%= @subtitle.html_safe %></i>
<% end %>
</h1>
<% end %>
Expand Down Expand Up @@ -155,7 +155,7 @@
Hosted by
<%= image_tag('sponsors/bluebox.png', class: 'footer__sponsor__logo') %>
</a>
<a class="footer__sponsor" href="http://www.dockyard.com/" target="_blank">
<a class="footer__sponsor" href="http://dockyard.com/" target="_blank">
Designed by
<%= image_tag('sponsors/dockyard.png', class: 'footer__sponsor__logo') %>
</a>
Expand Down
21 changes: 0 additions & 21 deletions app/views/rubygems/_clippy.html.erb

This file was deleted.

161 changes: 86 additions & 75 deletions app/views/rubygems/show.html.erb
Expand Up @@ -11,58 +11,64 @@
<div class="l-overflow">
<div class="l-colspan--l colspan--l--has-border">
<% if @latest_version.indexed %>
<article class="gem__intro">
<div id="markup" class="gem__desc t-text">
<div class="gem__intro">
<div id="markup" class="gem__desc">
<%= simple_markup(@latest_version.info) %>
</div>
<pre class="gem__pre"><code><span class="gem__code__heading"><%= t '.bundler_header' %></span>
<span class="gem__code"><%= @latest_version.to_bundler %></span></code><%= render :partial => "rubygems/clippy", :locals => { :embed => "github_clippy", :text => @latest_version.to_bundler } %></pre>
<pre class="gem__pre"><code><span class="gem__code__heading"><%= t '.install' %></span>
<span class="gem__code"><%= @latest_version.to_install %></span></code><%= render :partial => "rubygems/clippy", :locals => { :embed => "github_clippy", :text => @latest_version.to_install } %></pre>
</article>
</div>
<% else %>
<div class="t-body">
<p><%= t('.yanked_notice', :more_info_link => link_to(t('.yank_info_link_text'), "http://help.rubygems.org/faqs/gemcutter/removing-a-published-rubygem")).html_safe %></p>
</div>
<% end %>

<% if @versions.present? %>
<div class="l-half--l">
<div class="versions">
<h3 class="t-list__heading"><%= t '.versions_header' %>:</h3>
<ol class="gem__versions t-list__items">
<%= render @versions %>
</ol>
<% if show_all_versions_link?(@rubygem) %>
<%= link_to t('.show_all_versions', :count => @rubygem.versions.count), rubygem_versions_url(@rubygem), :class => "gem__see-all-versions t-link--gray t-link--has-arrow" %>
<% end %>
</div>
</div>
<% end %>

<%= render :partial => "rubygems/dependencies", :locals => { :dependencies => @latest_version.dependencies.runtime } %>
<%= render :partial => "rubygems/dependencies", :locals => { :dependencies => @latest_version.dependencies.development } %>

<article class="l-overflow">
<% if @latest_version.requirements.present? %>
<div class="l-half--l">
<h3 class="t-list__heading"><%= t '.requirements_header' %>:</h3>
<div class="t-list__items">
<% Array(@latest_version.requirements).each do |requirement| %>
<p><%= requirement %></p>
<% end %>
</div>
</div>
<% end %>

<div class="gem__members">
<% if @latest_version.indexed %>
<% if @latest_version.authors.present? %>
<div class="l-half--l">
<h3 class="t-list__heading"><%= t '.authors_header' %>:</h3>
<ul class="t-list__items">
<li class="t-list__item">
<p><%= @latest_version.authors %></p>
</li>
</ul>
</div>
<h3 class="t-list__heading"><%= t '.authors_header' %>:</h3>
<ul class="t-list__items">
<li class="t-list__item">
<p><%= @latest_version.authors %></p>
</li>
</ul>
<% end %>

<% if @rubygem.owners.present? %>
<div class="l-half--l">
<h3 class="t-list__heading"><%= t '.owners_header' %>:</h3>
<div class="project__members">
<%= links_to_owners(@rubygem) %>
</div>
<h3 class="t-list__heading"><%= t '.owners_header' %>:</h3>
<div class="gem__owners">
<%= links_to_owners(@rubygem) %>
</div>
<% end %>
</article>

<article>
<div class="gem__versions-wrap">
<% if @latest_version.licenses.present? %>
<div class="l-half--l">
<h3 class="t-list__heading"><%= t '.licenses_header' %>:</h3>
<ul class="t-list__items">
<li class="t-list__item">
<p><%= formatted_licenses @latest_version.licenses %></p>
</li>
</ul>
</div>
<% end %>
</div>
</article>

<% else %>
<div class="t-body">
<p><%= t('.yanked_notice', :more_info_link => link_to(t('.yank_info_link_text'), "http://help.rubygems.org/faqs/gemcutter/removing-a-published-rubygem")).html_safe %></p>
</div>
<% end %>
<% end %>
</div>
</div>

<div class="gem__aside l-col--r--pad">
Expand All @@ -88,15 +94,43 @@

<h2 class="gem__ruby-version__heading t-list__heading">
Required Ruby Version:
<span class="gem__ruby-version">
<i class="gem__ruby-version">
<% if @latest_version.ruby_version %>
<%= @latest_version.ruby_version %>
<% else %>
None
<% end %>
</span>
</i>
</h2>

<% if @latest_version.indexed %>
<h2 class="gem__ruby-version__heading t-list__heading">
<%= t '.licenses_header' %>:
<span class="gem__ruby-version">
<p><%= formatted_licenses @latest_version.licenses %></p>
</span>
</h2>

<h2 class="gem__ruby-version__heading t-list__heading">
<%= t '.bundler_header' %>:
<div class="gem__code-wrap">
<span class="gem__code"><%= @latest_version.to_bundler %></span></code>
<span class="gem__code__icon" id="js-gem__code--gemfile" data-clipboard-text="<%= @latest_version.to_bundler %>">=</span>
<span class="gem__code__tooltip--copy">Copy to clipboard</span>
<span class="gem__code__tooltip--copied">Copied!</span>
</div>
</h2>
<h2 class="gem__ruby-version__heading t-list__heading">
<%= t '.install' %>:
<div class="gem__code-wrap">
<span class="gem__code"><%= @latest_version.to_install %></span></code>
<span class="gem__code__icon" id="js-gem__code--install" data-clipboard-text="<%= @latest_version.to_install %>">=</span>
<span class="gem__code__tooltip--copy">Copy to clipboard</span>
<span class="gem__code__tooltip--copied">Copied!</span>
</div>
</h2>
<% end %>

<h3 class="t-list__heading"><%= t '.links.header' %>:</h3>
<div class="t-list__items">
<%= link_to t('edit'), edit_rubygem_path(@rubygem), :class => "gem__link t-list__item", :id => "edit" if @rubygem.owned_by?(current_user) %>
Expand Down Expand Up @@ -125,35 +159,12 @@
-->
</div>
</div>

<div class="l-colspan--l colspan--l--has-border">
<% if @versions.present? %>
<div class="l-half--l">
<div class="versions">
<h3 class="t-list__heading"><%= t '.versions_header' %>:</h3>
<ol class="gem__versions t-list__items">
<%= render @versions %>
</ol>
<% if show_all_versions_link?(@rubygem) %>
<%= link_to t('.show_all_versions', :count => @rubygem.versions.count), rubygem_versions_url(@rubygem), :class => "gem__see-all-versions t-link--gray t-link--has-arrow" %>
<% end %>
</div>
</div>
<% end %>

<%= render :partial => "rubygems/dependencies", :locals => { :dependencies => @latest_version.dependencies.runtime } %>
<%= render :partial => "rubygems/dependencies", :locals => { :dependencies => @latest_version.dependencies.development } %>

<% if @latest_version.requirements.present? %>
<div class="l-half--l">
<h3 class="t-list__heading"><%= t '.requirements_header' %>:</h3>
<div class="t-list__items">
<% Array(@latest_version.requirements).each do |requirement| %>
<p><%= requirement %></p>
<% end %>
</div>
</div>
<% end %>
</div>
</div>
<% end %>

<%= javascript_include_tag "ZeroClipboard" %>

<script>
var client = new ZeroClipboard( document.getElementById("js-gem__code--gemfile") );
var client2 = new ZeroClipboard( document.getElementById("js-gem__code--install") );
</script>
Binary file added public/favicon.icns
Binary file not shown.
Binary file modified public/favicon.ico
Binary file not shown.
Binary file removed public/favicon.png
Binary file not shown.
Binary file removed public/fluid-icon.png
Binary file not shown.