-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add support for grid view #986
Conversation
The B,A <-> A B shouldn't be visible. It's made for the authors view (displaying surname, first-name or first name surname) |
Ah ok that makes sense! Since the grid view doesn't support author at the moment I'll remove it entirely. |
I think I found a solution, using the the |
Ok the default theme works but in Caliblur the sorting is still broken... |
Ok so the 2 remaining issues are linked
|
The sorting problem arises from these lines in caliblur.css.min:
If you comment out the lines like in the code snippet the searching works |
Thanks for looking in to this. I'll try out your fix and see if that affects anything else. I would be curious to know why those rules were there in the first place, but it this fist it I'll probably override it just in the grid view so it won't affect any other places this is used. Regarding the left alignment, like you said this is crazy XD. |
The thing I realized about the css, it's shortening the titles of the book, without the css the book titles can be very long and go into the next book. |
Issues
======
- Added 19
Complexity increasing per file
==============================
- cps/ub.py 1
- cps/static/js/filter_grid.js 2
See the complete overview on Codacy |
|
||
var $list = $('#list').isotope({ | ||
itemSelector: '.book', | ||
layoutMode: 'fitRows', |
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.
Issue found: Expected indentation of 4 spaces but found 2.
|
||
$("#asc").click(function() { | ||
$list.isotope({ | ||
sortBy: 'name', |
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.
Issue found: Strings must use doublequote.
|
||
var $list = $('#list').isotope({ | ||
itemSelector: '.book', | ||
layoutMode: 'fitRows', |
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.
Issue found: Strings must use doublequote.
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
var $list = $('#list').isotope({ |
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.
Issue found: Strings must use doublequote.
itemSelector: '.book', | ||
layoutMode: 'fitRows', | ||
getSortData: { | ||
title: '.title', |
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.
Issue found: Strings must use doublequote.
data = {}; | ||
data[target] = view; | ||
console.debug("Updating view data: ", data); | ||
$.post( "/ajax/view", data).done(function( result ) { |
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.
Issue found: 'data' is not defined.
layoutMode: 'fitRows', | ||
getSortData: { | ||
title: '.title', | ||
} |
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.
Issue found: Expected indentation of 4 spaces but found 2.
@@ -239,4 +239,17 @@ $(function() { | |||
$(".discover .row").isotope("layout"); | |||
}); | |||
|
|||
$(".update-view").click(function(e) { | |||
var target = $(this).data('target'); | |||
var view = $(this).data('view'); |
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.
Issue found: Strings must use doublequote.
*/ | ||
|
||
var $list = $('#list').isotope({ | ||
itemSelector: '.book', |
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.
Issue found: Strings must use doublequote.
@@ -239,4 +239,17 @@ $(function() { | |||
$(".discover .row").isotope("layout"); | |||
}); | |||
|
|||
$(".update-view").click(function(e) { | |||
var target = $(this).data('target'); |
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.
Issue found: Strings must use doublequote.
*/ | ||
|
||
var $list = $('#list').isotope({ | ||
itemSelector: '.book', |
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.
Issue found: Expected indentation of 4 spaces but found 2.
var $list = $('#list').isotope({ | ||
itemSelector: '.book', | ||
layoutMode: 'fitRows', | ||
getSortData: { |
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.
Issue found: Expected indentation of 4 spaces but found 2.
|
||
e.preventDefault(); | ||
e.stopPropagation(); | ||
data = {}; |
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.
Issue found: 'data' is not defined.
} | ||
}); | ||
// We need to trigger the resize event to have all the grid item to re-align. | ||
window.dispatchEvent(new Event('resize')); |
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.
Issue found: Strings must use doublequote.
data = {}; | ||
data[target] = view; | ||
console.debug("Updating view data: ", data); | ||
$.post( "/ajax/view", data).done(function( result ) { |
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.
Issue found: 'result' is defined but never used.
e.stopPropagation(); | ||
data = {}; | ||
data[target] = view; | ||
console.debug("Updating view data: ", data); |
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.
Issue found: Unexpected console statement.
e.preventDefault(); | ||
e.stopPropagation(); | ||
data = {}; | ||
data[target] = view; |
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.
Issue found: 'data' is not defined.
itemSelector: '.book', | ||
layoutMode: 'fitRows', | ||
getSortData: { | ||
title: '.title', |
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.
Issue found: Expected indentation of 8 spaces but found 4.
e.stopPropagation(); | ||
data = {}; | ||
data[target] = view; | ||
console.debug("Updating view data: ", data); |
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.
Issue found: 'data' is not defined.
I like that! I'm going to update at some point. |
Partly: Codacy is using different "linter" to do the checking. |
Yeah don't worry gmail keeps it tidy in a thread anyway :) It would be nice to have a |
…ad of top right: each element's width in the list seems to be double the size of the image, so right alignment gets tricky. janeczku#986 (comment) suggests top-left alignment which does make a lot of sense. Using this for now. Maintainer might have a better idea to fix it
…ad of top right: each element's width in the list seems to be double the size of the image, so right alignment gets tricky. janeczku#986 (comment) suggests top-left alignment which does make a lot of sense. Using this for now. Maintainer might have a better idea to fix it
I guess this can be close now that #1306 has been merged |
Not too sure if I should base this on develop or master so feel free to edit.
This is pretty much done but still need to address 2 issues
B,A <-> A B
does and fix it in the cover viewFeedback and pointers welcome.