diff options
author | Alex Legler <alex@a3li.li> | 2016-08-10 14:17:17 +0200 |
---|---|---|
committer | Alex Legler <alex@a3li.li> | 2016-08-10 14:17:17 +0200 |
commit | a28d30af7e6e3392edf093b2fa3ca87fbb2c2e0b (patch) | |
tree | 6b42d11d1f4f5c8167726d75c592ed6e57ad436e /app | |
parent | Remove popover keyword legend, link instead (diff) | |
download | packages-5-a28d30af7e6e3392edf093b2fa3ca87fbb2c2e0b.tar.gz packages-5-a28d30af7e6e3392edf093b2fa3ca87fbb2c2e0b.tar.bz2 packages-5-a28d30af7e6e3392edf093b2fa3ca87fbb2c2e0b.zip |
Link package versions to ebuild on gitweb
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/stylesheets/packages.scss | 7 | ||||
-rw-r--r-- | app/helpers/links_helper.rb | 5 | ||||
-rw-r--r-- | app/views/packages/_version_row.html.erb | 2 |
3 files changed, 13 insertions, 1 deletions
diff --git a/app/assets/stylesheets/packages.scss b/app/assets/stylesheets/packages.scss index d09f175..777adb7 100644 --- a/app/assets/stylesheets/packages.scss +++ b/app/assets/stylesheets/packages.scss @@ -236,3 +236,10 @@ color: #999; } } + +a.kk-ebuild-link { + &:link, + &:visited { + color: #333; + } +} diff --git a/app/helpers/links_helper.rb b/app/helpers/links_helper.rb index 5a28fb0..bcdad83 100644 --- a/app/helpers/links_helper.rb +++ b/app/helpers/links_helper.rb @@ -24,6 +24,11 @@ module LinksHelper link_to license, 'https://gitweb.gentoo.org/repo/gentoo.git/plain/licenses/%s' % license end + def link_version_to_ebuild(version) + ebuild_path = '%s/%s.ebuild' % [version.package, version.atom.split('/').last] + link_to version.version, 'https://gitweb.gentoo.org/repo/gentoo.git/tree/%s' % ebuild_path, class: 'kk-ebuild-link' + end + def link_to_category(category) link_to category.name, category_path(category), diff --git a/app/views/packages/_version_row.html.erb b/app/views/packages/_version_row.html.erb index d30d974..6262919 100644 --- a/app/views/packages/_version_row.html.erb +++ b/app/views/packages/_version_row.html.erb @@ -1,5 +1,5 @@ <tr> - <td class="kk-version kk-cell-sep-right"><strong><%= version.version %></strong><%= version_slot version.slot, version.subslot %> <%= version_labels version %></td> + <td class="kk-version kk-cell-sep-right"><strong><%= link_version_to_ebuild(version) %></strong><%= version_slot version.slot, version.subslot %> <%= version_labels version %></td> <%= keyword_cell version, 'amd64' %> <%= keyword_cell version, 'x86', true %> <%= keyword_cell version, 'alpha' %> |