fix for pagination and revoke and grant buttons

This commit is contained in:
Harry Bomrah 2014-12-30 21:37:58 +08:00
parent 5b02e54f17
commit dbc9e5a931
3 changed files with 24 additions and 8 deletions

View File

@ -53,3 +53,9 @@
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<%=
content_tag :div, class: "bottomnav clearfix" do
content_tag :div, paginate(@registeredsites), class: "pagination pagination-centered"
end
%>

View File

@ -1 +1,16 @@
$("#index_table").html("<%= j render 'index' %>") $("#index_table").html("<%= j render 'index' %>");
var atags = $(".pagination a");
if (atags.length > 0){
atags.each(function(){
var el = $(this);
if(el.attr("href")){
var url = "http://" + window.location.host + el.attr("href");
uri = new URL(url);
if(uri.searchParams.get("page")){
$(this).attr("href","/<%= locale.to_s %>/admin/registered_sites?page=" + uri.searchParams.get("page"));
}else{
$(this).attr("href","/<%= locale.to_s %>/admin/registered_sites");
}
}
})
}

View File

@ -2,8 +2,3 @@
<span id="index_table"> <span id="index_table">
<%= render 'index'%> <%= render 'index'%>
</span> </span>
<%=
content_tag :div, class: "bottomnav clearfix" do
content_tag :div, paginate(@registeredsites), class: "pagination pagination-centered"
end
%>