mirror of
https://github.com/internetee/registry.git
synced 2025-06-09 06:04:56 +02:00
Add button to download filtered domains
This commit is contained in:
parent
b6df415fb9
commit
b65a2ca924
4 changed files with 18 additions and 1 deletions
|
@ -8,6 +8,8 @@ $(window).load ->
|
|||
|
||||
$('[data-toggle="popover"]').popover()
|
||||
|
||||
$('[data-toggle="tooltip"]').tooltip()
|
||||
|
||||
# doublescroll
|
||||
$('[data-doublescroll]').doubleScroll({
|
||||
onlyIfScroll: false,
|
||||
|
|
|
@ -27,8 +27,17 @@ module Admin
|
|||
params[:q][:name_matches] = n_cache # we don't want to show wildcards in search form
|
||||
end
|
||||
end
|
||||
|
||||
@domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i.positive?
|
||||
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
@domains
|
||||
end
|
||||
format.csv do
|
||||
raw_csv = @domains.to_csv
|
||||
send_data raw_csv, filename: 'domains.csv', type: "#{Mime[:csv]}; charset=utf-8"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
|
|
|
@ -64,6 +64,11 @@
|
|||
<span class="glyphicon glyphicon-search"></span>
|
||||
|
||||
</button>
|
||||
<button class="btn">
|
||||
<%= link_to "", admin_domains_path(format: :csv),
|
||||
"data-toggle" => "tooltip", "data-placement" => "bottom", "title" => t('.download_csv_btn'),
|
||||
class: 'glyphicon glyphicon-list-alt' %>
|
||||
</button>
|
||||
<%= link_to t('.reset_btn'), admin_domains_path, class: 'btn btn-default' %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -11,6 +11,7 @@ en:
|
|||
|
||||
search_form:
|
||||
reset_btn: Reset
|
||||
download_csv_btn: "Download CSV"
|
||||
|
||||
form:
|
||||
pending_delete: &pending_delete
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue