Skip to content

Commit

Permalink
Add sort icon to table2 (attempt)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Mardesich committed Feb 23, 2016
1 parent b4db828 commit 347ee03
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 15 deletions.
2 changes: 2 additions & 0 deletions code/ui_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ def index(request):
""" Manage Page, listing all Ids owned by user """
d = { 'menu_item' : 'ui_manage.index' }
isPublicSearch=False
# import pdb; pdb.set_trace()
# d['coowners'] = policy.getReverseCoOwners(request.session["auth"].user)
if request.method == "GET":
d['form'] = form_objects.ManageSearchIdForm() # Build an empty form
noConstraintsReqd =True
Expand Down
Binary file added dev/images/sort.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/images/sort_asc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/images/sort_desc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions dev/includes/table2.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<table class="table2">
<thead>
<tr>
<th>Object Title</th>
<th>Object Creator</th>
<th>Identifier</th>
<th>Object Publisher</th>
<th>Object <abbr title="Publication">Pub</abbr> Date</th>
<th>Object Type</th>
<th class="sorting" aria-label="Object Title: activate to sort column ascending">Object Title</th>
<th class="sorting" aria-label="Object Creator: activate to sort column ascending">Object Creator</th>
<th class="sorting" aria-label="Identifier: activate to sort column ascending">Identifier</th>
<th class="sorting" aria-label="Object Publisher: activate to sort column ascending">Object Publisher</th>
<th class="sorting" aria-label="Object Pub Date: activate to sort column ascending">Object <abbr title="Publication">Pub</abbr> Date</th>
<th class="sorting" aria-label="Object Type: activate to sort column ascending">Object Type</th>
</tr>
</thead>
<tbody>
Expand Down
8 changes: 4 additions & 4 deletions dev/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ <h2>Components</h2>
<li><a href="component_showhide.html">Show / Hide</a></li>
<li><a href="component_sidebox.html">Side Box</a></li>
<li><a href="component_tab.html">Tab</a></li>
<li><a href="component_table.html">Table - Stackable</a></li>
<li><a href="component_table3.html">Table - Stackable v.2</a></li>
<li><a href="component_table2.html">Table - Scrollable</a></li>
<li><a href="component_table.html">Table - Stackable (Used on Learn page)</a></li>
<li><a href="component_table2.html">Table - Scrollable (For large result sets)</a></li>
<li><a href="component_table3.html">Table - Stackable v.2 (For large result sets)</a></li>
</ul>
</ul>

Expand All @@ -69,4 +69,4 @@ <h2>Elements</h2>
<!-- endbuild -->

</body>
</html>
</html>
16 changes: 16 additions & 0 deletions dev/scss/_table2.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@
display: block;
background: $design-secondary-lightest;
text-align: left;

.sorting:after {
position: absolute;
top: 0;
right: 6px;
bottom: 0;
left: auto;
height: 11px;
margin: auto;
line-height: 1;
content: url('../images/sort.png');
// background-image: url('../images/sort.png');
// background-position: right center;
// background-size: 9px 11px;
}

}

tbody {
Expand Down
10 changes: 10 additions & 0 deletions static/stylesheets/main2.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion static/stylesheets/main2.min.css

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions templates/includes/_pagination.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@
// page selection input field: submit on enter
$("#page-directselect-{{ select_position }}").keyup(function(e){
var code = e.which;
if(code==13)e.preventDefault();
// if(code==13)e.preventDefault();
if(code==32||code==13||code==188||code==186){
// Remove values from other buttons in this form since
// we only want to submit value from thsi input field
// $('#p-{{ select_position }} :button').attr('name', '');
var b = $('p-{{ select_position }}').getElementsByTagName("button");
for(var i=0;i<b.length;i++)
var b = $('#p-{{ select_position }} :button');
for(var i=0;i<b.length;i++) {
b[i].value = '';
b[i].disable(true);
}
$("#p-{{ select_position }}").submit();
}
});
Expand Down

0 comments on commit 347ee03

Please sign in to comment.