Skip to content

Commit

Permalink
[webui] Try to (ab)use the project name for the default selected
Browse files Browse the repository at this point in the history
repository in the rpmlint results view.

In plain, show the rpmlint log for repo 'openSUSE_Factory' when
submitting to openSUSE:Factory without hardcoding it ;-)
  • Loading branch information
saschpe committed Mar 1, 2012
1 parent df20c27 commit 49df1f0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions src/webui/app/controllers/package_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1025,14 +1025,11 @@ def rpmlint_result
render :text => 'no ajax', :status => 400 and return unless request.xhr?
@repo_arch_hash = {}
@buildresult = find_cached(Buildresult, :project => @project, :package => @package, :view => 'status', :expires_in => 5.minutes )
@repo_options = []
@buildresult.each('result') do |result|
hash_key = valid_xml_id(result.value('repository'))
@repo_arch_hash[hash_key] ||= []
@repo_arch_hash[hash_key] << result.value('arch')
@repo_options << [result.value('repository'), hash_key]
end
@repo_options.sort!
render :partial => 'rpmlint_result', :locals => {:index => params[:index]}
end

Expand Down
2 changes: 1 addition & 1 deletion src/webui/app/views/package/_rpmlint_result.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% index ||= '' %>
<p>
<%= select_tag("rpmlint_repo_select_#{index}", options_for_select(@repo_options)) %>
<%= select_tag("rpmlint_repo_select_#{index}", options_for_select(@repo_arch_hash.keys, @project.value('name').gsub(':', '_'))) %>
<% i = 0 %>
<% @repo_arch_hash.each do |repo, arches| %>
<%= select_tag("rpmlint_arch_select_#{index}_#{repo}", options_for_select(arches.sort), :class => "rpmlint_arch_select_#{index}") %>
Expand Down

0 comments on commit 49df1f0

Please sign in to comment.