2014-02-17 18:05:39 +01:00
|
|
|
<div class="row">
|
|
|
|
|
2014-02-28 19:57:58 +01:00
|
|
|
<div class="col-xs-12 col-sm-9">
|
2014-03-14 00:16:35 +01:00
|
|
|
<h4 class="breadcrumb"><%= @header %></h4>
|
2014-02-17 18:05:39 +01:00
|
|
|
<%= render :partial => 'list' %>
|
2014-03-14 00:16:35 +01:00
|
|
|
<br>
|
2014-02-17 18:05:39 +01:00
|
|
|
<%= will_paginate @channels %>
|
2014-02-28 19:57:58 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-xs-12 col-sm-3">
|
|
|
|
<h4 class="breadcrumb"><%= t(:search).capitalize %></h4>
|
|
|
|
|
|
|
|
<div class="col-pad">
|
|
|
|
<form role="form">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="tag_input"><%= t(:search_by_tag) %></label>
|
|
|
|
<input type="text" class="form-control" id="tag_input" placeholder="<%= t(:search_input_tag) %>">
|
|
|
|
</div>
|
|
|
|
<button type="submit" id="search_tag" class="btn btn-primary btn-sm"><%= t(:submit) %></button>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<br><br>
|
|
|
|
|
|
|
|
<form role="form">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="username_input"><%= t(:search_by_username) %></label>
|
|
|
|
<input type="text" class="form-control" id="username_input" placeholder="<%= t(:search_input_username) %>">
|
|
|
|
</div>
|
|
|
|
<button type="submit" id="search_username" class="btn btn-primary btn-sm"><%= t(:submit) %></button>
|
|
|
|
</form>
|
|
|
|
</div>
|
2014-02-17 18:05:39 +01:00
|
|
|
|
|
|
|
</div>
|
2014-02-28 19:57:58 +01:00
|
|
|
|
2014-02-17 18:05:39 +01:00
|
|
|
</div>
|
|
|
|
|
2014-02-28 19:57:58 +01:00
|
|
|
<script>
|
|
|
|
// when the document is ready
|
2014-07-23 19:45:15 +02:00
|
|
|
$(document).on('page:load ready', function() {
|
2014-02-28 19:57:58 +01:00
|
|
|
|
|
|
|
// when search tag is clicked
|
|
|
|
$('#search_tag').on('click', function() {
|
|
|
|
window.location.href = '<%= @domain %>channels/public?tag=' + encodeURIComponent($('#tag_input').val());
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
|
|
|
// when search username is clicked
|
|
|
|
$('#search_username').on('click', function() {
|
|
|
|
window.location.href = '<%= @domain %>channels/public?username=' + encodeURIComponent($('#username_input').val());
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|