-
-
Notifications
You must be signed in to change notification settings - Fork 916
/
show.html.erb
103 lines (91 loc) · 4.21 KB
/
show.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<% @title = @rubygem.name %>
<% @subtitle = @latest_version.try(:slug) %>
<%= content_for :head, auto_discovery_link_tag(:atom, rubygem_versions_path(@rubygem, format: "atom"), {title: "#{@rubygem.name} Version Feed"}) %>
<% if @rubygem.versions.count.zero? %>
<p><%= t '.not_hosted_notice' %></p>
<% else %>
<% if @latest_version.indexed %>
<div id="markup">
<%= simple_markup(@latest_version.info) %>
</div>
<div class="border">
<%= render :partial => "rubygems/clippy", :locals => { :embed => "clippy", :text => @latest_version.to_install } %>
<div class="install">
<div class="instructions"><strong><%= t '.install' %></strong><span><%= @latest_version.to_install %></span></div>
</div>
</div>
<% else %>
<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>
<% end %>
<div class="border">
<div class="meta">
<div class="admin">
<%= link_to t('edit'), edit_rubygem_path(@rubygem), :id => "edit" if @rubygem.owned_by?(current_user) %>
<%= download_link(@latest_version) %>
<%= documentation_link(@latest_version, @rubygem.linkset) %>
<%= subscribe_link(@rubygem) if @latest_version.indexed %>
<%= unsubscribe_link(@rubygem) %>
<%= atom_link(@rubygem) %>
</div>
<% if @latest_version.indexed %>
<div class="who">
<div class="authors info-item">
<% if @latest_version.authors.present? %>
<h5><%= t '.authors_header' %></h5>
<p><%= @latest_version.authors %></p>
<% end %>
</div>
<% unless Rails.env.recovery? %>
<div class="downloads counter" data-href="<%= api_v1_download_path(@latest_version.full_name, :format => 'json') %>">
<span>
<%= t('stats.show.total_downloads', :count => content_tag(:strong, number_with_delimiter(@rubygem.downloads))).html_safe %>
</span>
<span>
<%= t('.downloads_for_this_version', :count => content_tag(:strong, number_with_delimiter(@latest_version.downloads_count))).html_safe %>
</span>
</div>
<% end %>
<% if @rubygem.owners.present? %>
<div class="owners info-item">
<h5><%= t '.owners_header' %></h5>
<p><%= links_to_owners(@rubygem) %></p>
</div>
<% end %>
<div class="licenses info-item">
<h5><%= t '.licenses_header' %></h5>
<p><%= formatted_licenses @latest_version.licenses %></p>
</div>
</div>
<% if @rubygem.linkset.present? %>
<div class="links">
<h5><%= t '.links.header' %></h5>
<%= link_to_page t('.links.home'), @rubygem.linkset.home %>
<%= link_to_page t('.links.code'), @rubygem.linkset.code %>
<%= link_to_page t('.links.docs'), @rubygem.linkset.docs %>
<%= link_to_page t('.links.wiki'), @rubygem.linkset.wiki %>
<%= link_to_page t('.links.mail'), @rubygem.linkset.mail %>
<%= link_to_page t('.links.bugs'), @rubygem.linkset.bugs %>
</div>
<% end %>
<div class="bundler">
<h5><%= t '.bundler_header' %></h5>
<%= render :partial => "rubygems/clippy", :locals => { :embed => "github_clippy", :text => @latest_version.to_bundler } %>
<pre><code><%= @latest_version.to_bundler %></code></pre>
</div>
<% end %>
<% if @versions.present? %>
<div class="versions">
<h5><%= t '.versions_header' %></h5>
<ol>
<%= render @versions %>
</ol>
<% if show_all_versions_link?(@rubygem) %>
<%= link_to t('.show_all_versions', :count => @rubygem.versions.count), rubygem_versions_url(@rubygem), :class => "more" %>
<% end %>
</div>
<% end %>
<%= render :partial => "rubygems/dependencies", :locals => { :dependencies => @latest_version.dependencies.runtime } %>
<%= render :partial => "rubygems/dependencies", :locals => { :dependencies => @latest_version.dependencies.development } %>
</div>
</div>
<% end %>