-
Notifications
You must be signed in to change notification settings - Fork 78
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
My table layout and collection info #567
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,26 @@ | ||
Blacklight.onLoad(function() { | ||
// toggle button on or off based on boxes being clicked | ||
$(".batch_document_selector, .batch_document_selector_all").bind('click', function(e) { | ||
var n = $(".batch_document_selector:checked").length; | ||
if (n>0 || $('input#check_all')[0].checked) { | ||
$('.sort-toggle').hide(); | ||
} else { | ||
$('.sort-toggle').show(); | ||
} | ||
// toggle button on or off based on boxes being clicked | ||
$(".batch_document_selector, .batch_document_selector_all").bind('click', function(e) { | ||
var n = $(".batch_document_selector:checked").length; | ||
if (n>0 || $('input#check_all')[0].checked) { | ||
$('.sort-toggle').hide(); | ||
} else { | ||
$('.sort-toggle').show(); | ||
} | ||
}); | ||
|
||
}); | ||
}); | ||
// show/hide more information on the dashboard when clicking | ||
// plus/minus | ||
$('.glyphicon-chevron-right').on('click', function() { | ||
var button = $(this); | ||
//this.id format: "expand_NNNNNNNNNN" | ||
var array = this.id.split("expand_"); | ||
if (array.length > 1) { | ||
var docId = array[1]; | ||
$("#detail_" + docId + " .expanded-details").slideToggle(); | ||
button.toggleClass('glyphicon-chevron-right glyphicon-chevron-down'); | ||
} | ||
return false; | ||
}); | ||
|
||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Settings | ||
// | ||
// Variables, colors, etc. that are used in Sufia. | ||
// Some are unique or override other variables from Bootstrap. | ||
$gray-lightish: #bbb; | ||
$gray-lighter: #eee; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
$gray-lightish: #bbb; | ||
$gray-lighter: #eee; | ||
|
||
body { | ||
margin: 0; | ||
padding: 0; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
<% if !@disable_select_all %> | ||
<div class="dropdown" > | ||
<%= check_box_tag 'check_all', 'yes', @all_checked, class: 'pull-left', disabled: ((@batch_size_on_other_page + @document_list.count) > @max_batch_size) %> | ||
<a class="dropdown-toggle cog" data-toggle="dropdown" href="#"><span class="glyphicon glyphicon-cog" title="click for selection options"></span></a> | ||
<ul class="dropdown-menu"> | ||
<%= render partial: "#{controller_name}/batch_edits_actions" %> | ||
</ul> | ||
</div> | ||
<% end %> | ||
<div class="dropdown" > | ||
<%= check_box_tag 'check_all', 'yes', @all_checked, class: 'pull-left', disabled: ((@batch_size_on_other_page + @document_list.count) > @max_batch_size) %> | ||
<a class="dropdown-toggle" data-toggle="dropdown" href="#"><span class="glyphicon glyphicon-cog" title="click for selection options"></span></a> | ||
<ul class="dropdown-menu"> | ||
<%= render partial: "#{controller_name}/batch_edits_actions" %> | ||
</ul> | ||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<% # container for all documents in index view -%> | ||
<div id="documents"> | ||
<div class="table-responsive" id="documents"> | ||
<%= render partial: 'my/_index_partials/default_group', locals: {docs: @response.docs.map { |x| SolrDocument.new(x) }, facet_value: nil} %> | ||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,9 +20,10 @@ | |
visit "dashboard/files" | ||
end | ||
|
||
it "should show me some files" do | ||
it "should show me files that are not part of any collection" do | ||
expect(page).to have_content("Edit File") | ||
expect(page).to have_content("Download File") | ||
expect(page).to_not have_content("Is part of:") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. while this is the "correct" way to write a feature test. It's going to do a whole request/response cycle just for this. That's making our test suite slow. Can this be combined into another test that tests a whole "Feature", or can this be moved to a view test? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've combined the two feature tests into one which reduces the request/response cycle back to its original state. Regarding feature vs. view tests, I took the path of least resistance which was to simply expand the current feature tests by a few lines to cover the new bit. It seems to me there's a larger problem of feature tests that should be view tests overall, and is perhaps beyond the scope of this PR. |
||
end | ||
|
||
it "should allow you to search your own files" do | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
require 'spec_helper' | ||
|
||
describe BatchEditsHelper do | ||
|
||
describe "#render_check_all" do | ||
|
||
before do | ||
@document_list = ["doc1", "doc2"] | ||
@batch_size_on_other_page = 1 | ||
@max_batch_size = 10 | ||
end | ||
|
||
context "with my files" do | ||
it "should show the check all dropdown" do | ||
allow(helper).to receive(:params).and_return({ controller: "my/files" }) | ||
allow(helper).to receive(:controller_name).and_return("batch_edits") | ||
expect(helper.render_check_all).to have_css("span.glyphicon-cog") | ||
end | ||
end | ||
|
||
context "with my collections" do | ||
it "should not show the check all dropdown" do | ||
allow(helper).to receive(:params).and_return({ controller: "my/collections" }) | ||
expect(helper.render_check_all).to be_nil | ||
end | ||
end | ||
|
||
context "with select all disabled" do | ||
it "should not show the check all dropdown" do | ||
allow(helper).to receive(:params).and_return({ controller: "foo" }) | ||
assign(:disable_select_all, true) | ||
expect(helper.render_check_all).to be_nil | ||
end | ||
end | ||
|
||
end | ||
|
||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd really like this moved out of sufia.js into it's own file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.