Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

improve the fedora rpm show/index page2

  • Loading branch information...
commit 52b839e021da380733d18cd3b12bea443140e384 1 parent da88f3c
@kendhia kendhia authored movitto committed
View
6 app/models/rpm_importer.rb
@@ -47,10 +47,16 @@ def self.import_rpms_list
rpms = Pkgwat.get_packages("rubygem")
rpms.each {|rpm|
rpm_name = rpm["name"]
+ rpm_summary = rpm["summary"]
+ rpm_description = rpm["description"]
+ rpm_author = rpm["devel_owner"]
puts "Importing rpm #{rpm_name}"
if FedoraRpm.find_by_name(rpm_name).nil?
r = FedoraRpm.new
r.name = rpm_name
+ r.summary = rpm_summary
+ r.author = rpm_author
+ r.description = rpm_description
r.source_uri = "git://pkgs.fedoraproject.org/#{rpm_name}"
r.save!
else
View
2  app/views/fedorarpms/index.html.haml
@@ -22,7 +22,7 @@
%td= rpm.upto_date? ? _('Yes') : _('No')
%td= rpm.commits
%td= rpm.last_commit_date.nil? ? '' : _('%{time_ago} ago') % { :time_ago => time_ago_in_words(rpm.last_commit_date)}
- %td= rpm.patched? ? link_to(image_tag("True.svg.med.png", :size => "15x20")) : link_to(image_tag("False.svg.med.png", :size => "15x20"))
+ %td{:style => "text-align: center;"}= rpm.patched? ? link_to(image_tag("True.png", :size => "20x20")) : link_to(image_tag("False.png", :size => "20x20"))
/ %td= link_to rpm.ruby_gem.name, rubygem_path(rpm.ruby_gem.name) if rpm.ruby_gem != nil
- if rpm.fedora_user && rpm.fedora_user.split("@").first != nil
%td= link_to rpm.obfuscated_fedora_user.truncate(15), fedorarpm_path(rpm.fedora_user.split("@").first + "/by_owner")
View
175 app/views/fedorarpms/show.html.haml
@@ -1,71 +1,120 @@
-%h1= @rpm.name
-%div.info
- %label= link_to _('Homepage URI'), @rpm.homepage if @rpm.homepage != nil
- %label= link_to _('Source Code URI'), @rpm.source_uri if @rpm.source_uri != nil
- %label= link_to _('Dependency Tree'), :controller => 'fedorarpms', :action => 'full_deps'
+%h1= link_to @rpm.name, @rpm.homepage if @rpm.homepage != nil
+%h2= "(%{rpm_summary})" % { :rpm_summary => @rpm.summary}
+%h2
+ = link_to _('Source Code URI'), @rpm.source_uri if @rpm.source_uri != nil
+ = "|"
+ = link_to _('Dependency Tree'), :controller => 'fedorarpms', :action => 'full_deps'
+ = "|"
- if @rpm.ruby_gem != nil
- %span.label.label-info= link_to _('RubyGem'), rubygem_path(@rpm.ruby_gem.name)
- %label= _("Hotness: %{rpm_hotness}%") % { :rpm_hotness => @rpm.hotness}
- %label
- = _('Up to date: ')
- - if @rpm.upto_date?
- %span.label.label-success= _('Yes')
- - else
- %span.label.label-important= _('No')
- - unless @rpm.fedora_user.blank?
- %p= link_to _('Maintainer: %{maintainer_email}') % { :maintainer_email => @rpm.obfuscated_fedora_user }, fedorarpm_path(@rpm.fedora_user.split("@").first + "/by_owner")
- %label= _('Versions: %{rpm_versions}') % { :rpm_versions => @rpm.versions}
- %label= _('Git Commits: %{rpm_commits}') % { :rpm_commits => @rpm.commits}
- - if @dependencies.blank?
- %label= _('No dependencies')
- - else
- %label= _('Depends on:')
-
- %table.table.table-striped.table-condensed.dependency
- %thead
- %tr
- %th= _('Package')
- -FedoraRpm::FEDORA_VERSIONS.each do |t, g|
- %th= t
- %th= _('Gem Version')
- %tbody
- - @dependencies.each do |d|
+ = link_to _('RubyGem'), rubygem_path(@rpm.ruby_gem.name)
+%div.info
+ %div.row
+ %div.span6
+ %label= _('Description: %{rpm_description}') % { :rpm_description => @rpm.description}
+ %label= _("Hotness: %{rpm_hotness}%") % { :rpm_hotness => @rpm.hotness}
+ = _('Up to date: ')
+ - if @rpm.upto_date?
+ %span.label.label-success= _('Yes')
+ - else
+ %span.label.label-important= _('No')
+ - unless @rpm.fedora_user.blank?
+ %p= link_to _('Maintainer: %{maintainer_email}') % { :maintainer_email => @rpm.obfuscated_fedora_user }, fedorarpm_path(@rpm.fedora_user.split("@").first + "/by_owner")
+ %label= _('Git Commits: %{rpm_commits}') % { :rpm_commits => @rpm.commits}
+ %div.span6
+ %h2
+ = _('Versions: ')
+ %table.table.table-striped.table-condensed.dependency
+ %thead
+ %tr
+ -FedoraRpm::FEDORA_VERSIONS.each do |t, g|
+ %th= t
+ %th= _('Gem Version')
+ %tbody
%tr
- %td= link_to d.name, fedorarpm_path(d.name)
-FedoraRpm::FEDORA_VERSIONS.each do |t, g|
- %td= d.version_for(t)
- %td= d.ruby_gem.version
+ %td= @rpm.version_for(t)
+ %td= @rpm.ruby_gem.version
+ %div.row
+ %div.span6
+ - if @dependents.blank?
+ %label= _('No dependents')
+ - else
+ %label= _('Dependents:')
- %label= _('Bugs:')
- %table.table.table-striped.table-condensed.dependency
- %thead
- %tr
- %th BZ
- %th= _('Title')
- %th= _('Review?')
- %tbody
- - @rpm.bugs.each do |b|
- %tr
- %td
- = link_to b.bz_id, b.url
- %td
- = b.name
- %td
- = b.is_review ? _('Yes') : _('No')
+ %table.table.table-striped.table-condensed.dependency
+ %thead
+ %tr
+ %th= _('Package')
+ -FedoraRpm::FEDORA_VERSIONS.each do |t, g|
+ - if g == 'master'
+ %th= 'Rawhide'
+ - else
+ %th= g
+ %th= _('Upstream')
+ %tbody
+ - @dependencies.each do |d|
+ %tr
+ %td= link_to d.name, fedorarpm_path(d.name)
+ -FedoraRpm::FEDORA_VERSIONS.each do |t, g|
+ %td= d.version_for(t)
+ %td= d.ruby_gem.version
+ %div.span6
+ - if @dependents.blank?
+ %label= _('No depedencies')
+ - else
+ %label= _('Depedencies:')
- %label= _('Builds:')
- %table.table.table-striped.table-condensed.dependency
- %thead
- %tr
- %th= _('Build ID')
- %th= _('Title')
- %tbody
- - @rpm.builds.each do |b|
- %tr
- %td
- = link_to b.build_id, b.build_url
- %td
- = b.name
+ %table.table.table-striped.table-condensed.dependency
+ %thead
+ %tr
+ %th= _('Package')
+ -FedoraRpm::FEDORA_VERSIONS.each do |t, g|
+ - if g == 'master'
+ %th= 'Rawhide'
+ - else
+ %th= g
+ %th= _('Upstream')
+ %tbody
+ - @dependents.each do |d|
+ %tr
+ %td= link_to d.name, fedorarpm_path(d.name)
+ -FedoraRpm::FEDORA_VERSIONS.each do |t, g|
+ %td= d.version_for(t)
+ %td= d.ruby_gem.version
+ %div.row
+ %div.span6
+ %h2
+ = _('Bugs:')
+ %table.table.table-striped.table-condensed.dependency
+ %thead
+ %tr
+ %th Bug's id
+ %th= _('Title')
+ %th= _('Review?')
+ %tbody
+ - @rpm.bugs.each do |b|
+ %tr
+ %td
+ = link_to b.bz_id, b.url
+ %td
+ = b.name.truncate(30)
+ %td{:style => "text-align: center;"}
+ = b.is_review ? link_to(image_tag("True.png", :size => "20x20")) : link_to(image_tag("False.png", :size => "20x20"))
+ %div.span6
+ %h2
+ = _('Builds:')
+ %table.table.table-striped.table-condensed.dependency
+ %thead
+ %tr
+ %th= _('Build ID')
+ %th= _('Title')
+ %tbody
+ - @rpm.builds.each do |b|
+ %tr
+ %td
+ = link_to b.build_id, b.build_url
+ %td
+ = b.name.truncate(30)
= render :partial => 'rpmcomments/comments'
= render :partial => 'rpmcomments/new_comment'
Please sign in to comment.
Something went wrong with that request. Please try again.