Sha256: 17a56839999ed28fd1e1e4869143787f1b72b83818fa948f2a7b37667402d703
Contents?: true
Size: 1.69 KB
Versions: 27
Compression:
Stored size: 1.69 KB
Contents
- page_title t('.page_title') %table{class: "table table-striped table-hover", id: "plugins-table"} %thead %tr %th{width: "24"} %th= t('plugins.common.name') %th= t('plugins.common.category') %th= t('plugins.common.status') %th %tbody - @plugins.each do |plugin| %tr %td - unless plugin.installed? || plugin.processing? = link_to t("terms.install"), install_plugins_path, class: "js-install btn btn-primary", data: { url: install_plugins_path, name: plugin.gem_name} %td %label{for: "plugin_#{plugin.gem_name}"} = plugin.gem_name %td = plugin.category %td = plugin.status %td = link_to t('plugins.view_on_rubygems_org'), plugin.rubygems_org_page, target: "_blank" :javascript $(document).ready(function() { $('#plugins-table').dataTable({ "autoWidth": false, "ordering": true, "paging": false, "info": false, "searching": true, "language": { "search": "#{t("terms.search")} " } }); $('#plugins-table').on('click', '.js-install', function(ev){ ev.preventDefault(); var $anchor = $(ev.target); var url = $anchor.attr('href'); $anchor.removeClass('js-install'); $anchor.attr("href", "#"); $anchor.css({color: "green"}); var name = $anchor.attr('data-name'); $.ajax({ url: url, data: {"plugins[]": name, "_method": "PATCH"}, method: "POST" }).done(function(){ $anchor.fadeOut(); var status = $anchor.parent().closest('tr').children()[3]; $(status).text("#{t("terms.processing")}"); });; }); });
Version data entries
27 entries across 27 versions & 1 rubygems