Sha256: 3302c4e79d4a582a3b47ee07dc2260bb1eed1c797258eb0788da8c060797b068

Contents?: true

Size: 1.66 KB

Versions: 6

Compression:

Stored size: 1.66 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?
            = 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
          - if plugin.installed?
            = t("plugins.common.installed")
          - else
            = t(".not_installed")
        %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();
      });;
    });
  });

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fluentd-ui-0.2.0 app/views/plugins/recommended.html.haml
fluentd-ui-0.1.4 app/views/plugins/recommended.html.haml
fluentd-ui-0.1.3 app/views/plugins/recommended.html.haml
fluentd-ui-0.1.2 app/views/plugins/recommended.html.haml
fluentd-ui-0.1.1 app/views/plugins/recommended.html.haml
fluentd-ui-0.1.0 app/views/plugins/recommended.html.haml