Skip to content

Commit

Permalink
Merge pull request #184 from openSUSE-zh/master
Browse files Browse the repository at this point in the history
Add toggle buttons for experimental and community packages
  • Loading branch information
lnussel committed Aug 4, 2017
2 parents d831d0c + faa1e39 commit 0381e87
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
1 change: 0 additions & 1 deletion app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
//= require jquery.ui.all
//= require jquery_ujs
//
//= require bento/global-navigation.js
//= require jquery.cookie
//= require jquery.pjax

Expand Down
1 change: 0 additions & 1 deletion app/assets/javascripts/bento/global-navigation.js

This file was deleted.

14 changes: 11 additions & 3 deletions app/views/package/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,23 @@
<%= render :partial => 'package/download_rows', :locals => {:packages => stable, :distro => distro, :oneclick => true, :type => 'official'} %>
<%
slug = distro[:project].downcase.strip.gsub('_', '-').gsub('/', '-').gsub(':', '-').gsub(/[^\w-]/, '')
home, pkgs = pkgs.partition{|s| s.project.match( /^home\:/ )}
devel = pkgs.reject{|s| @official_projects.include?( s.project ) || s.project.match( /^home\:/ ) || s.project.match( /#{distro[:project]}\:Update/ ) ||
s.project.match( /#{distro[:project]}\:NonFree/ ) || s.project.match( /openSUSE\:Maintenance\:/ ) } %>

<p>
<button class="btn btn-sm btn-warning" type="button" data-toggle="collapse" data-target="#<%= slug %>-experimental-packages"><%= _("Show experimental packages") %></button>
<button class="btn btn-sm btn-danger" type="button" data-toggle="collapse" data-target="#<%= slug %>-community-packages"><%= _("Show community packages") %></button>
</p>
<!-- experimental packages -->
<%= render :partial => 'package/download_rows', :locals => {:packages => devel, :distro => distro, :oneclick => true, :type => 'experimental' } %>

<div id="<%= slug %>-experimental-packages" class="collapse">
<%= render :partial => 'package/download_rows', :locals => {:packages => devel, :distro => distro, :oneclick => true, :type => 'experimental' } %>
</div>
<!-- community packages -->
<%= render :partial => 'package/download_rows', :locals => {:packages => home, :distro => distro, :oneclick => true, :type => 'community'} %>
<div id="<%= slug %>-community-packages" class="collapse">
<%= render :partial => 'package/download_rows', :locals => {:packages => home, :distro => distro, :oneclick => true, :type => 'community'} %>
</div>
<% end -%>
<% end -%>
Expand Down

0 comments on commit 0381e87

Please sign in to comment.