Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide deprecated updates unless in a branch #57

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions static/js/margarita.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,19 @@ var FilterCriteria = Backbone.Model.extend({
productFilter: function(product) {
var show = false;

if (this.get('hideCommon') == false || product.get('depr') == true) {
// always show the update if not hiding common updates OR if the update is deprecated
if (this.get('hideCommon') == false) {
// always show the update if not hiding common updates
show = true;
} else if (this.get('hideCommon') == true && product.get('depr') == true) {
// if the product is deprecated but still in a branch, show it when hiding common updates
if (product.get('branches').length > 0){
show = true;
} else {
// don't show deprecated updates if hiding common updates and it's not in a branch
show = false;
}
} else {
var proddiff = _.difference(product.allBranches, product.get('branches'))
var proddiff = _.difference(product.allBranches, product.get('branches'));

// if we're not listed in all branches then show the update
if (proddiff.length != 0) show = true;
Expand Down
2 changes: 1 addition & 1 deletion templates/margarita.html
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ <h4 class="modal-title" title="<%= id %>"><%= title %></h4>
</script>

<script id="toggleHideCommonBtnViewTpl" type="text/template">
<i class="icon-white<% if (hideCommon) { %> icon-ok<% } %>"></i> <span>Hide commonly listed updates</span>
<i class="icon-white<% if (hideCommon) { %> icon-ok<% } %>"></i> <span>Toggle listed updates -</span> &#x2714;<span>= Unique /</span> &#x2610; <span>= All</span>
</script>

<script id="span12-progress-bar" type="text/html">
Expand Down