<commit_before><% enabled_plugins = PluginRoutes.enabled_plugins(current_site) %>
<div class="panel panel-default">
    <div class="panel-body">

        <table class="table table-responsive table-hover table-striped">
            <thead>
            <tr>
                <th><%= t('camaleon_cms.admin.table.title') %></th>
                <th><%= t('camaleon_cms.admin.table.description') %></th>
                <th><%= t('camaleon_cms.admin.table.version') %></th>
                <th><%= t('camaleon_cms.admin.table.status') %></th>
                <th><%= t('camaleon_cms.admin.table.actions') %></th>
            </tr>
            </thead>
            <tbody>
            <% plugins.each do |plugin| status = enabled_plugins.include?(plugin); r = {links: ["Version: #{plugin["version"]}"], plugin: plugin}; %>
                <tr>
                    <td>
                        <b><%= plugin["title"] %></b>
                        <br>
                        <% # sample:
                           # def cama_stripe_donation_plugin_options(args)
                           #   args[:links] << link_to('Settings', admin_plugins_cama_stripe_donation_settings_path)
                           # end %>
                        <% hook_run(plugin, "plugin_options", r) if status %>
                        <%= raw r[:links].join(" | ") %>
                    </td>
                    <td><%= raw plugin["descr"] %></td>
                    <td><%= plugin["version"] %></td>
                    <td><%= t("camaleon_cms.admin.plugins.status_#{status}") %></td>
                    <td>
                        <%= link_to raw("<i class='fa fa-#{status ? "check-square" : "square"}'></i>"), {action: :toggle, id: plugin["key"], status: status }, class: "btn btn-default btn-xs", title: "#{status ? t('camaleon_cms.admin.button.disable_plugin') : t('camaleon_cms.admin.button.activate_plugin') }", data: { confirm: "#{"#{status ? t('camaleon_cms.admin.button.disable_plugin') : t('camaleon_cms.admin.button.activate_plugin') }"}?" } %>
                        <%= link_to("<i class='fa fa-arrow-circle-o-up'></i>".html_safe, cama_admin_plugin_upgrade_path(plugin["key"]), class: "btn btn-info btn-xs", title: "#{t("camaleon_cms.admin.plugins.upgrade_to")} #{plugin["version"]}") if status && current_site.get_plugin(plugin["key"]).old_version? %>
                    </td>
                </tr>
            <% end %>

            </tbody>
        </table>
        <%= content_tag("div", raw(t('camaleon_cms.admin.message.data_found_list')), class: "alert alert-warning") if plugins.empty? %>
    </div>
</div><commit_msg>Fix UX for Plugins -> Activate/Deactivate buttons<commit_after><% enabled_plugins = PluginRoutes.enabled_plugins(current_site) %>
<div class="panel panel-default">
    <div class="panel-body">

        <table class="table table-responsive table-hover table-striped">
            <thead>
            <tr>
                <th><%= t('camaleon_cms.admin.table.title') %></th>
                <th><%= t('camaleon_cms.admin.table.description') %></th>
                <th><%= t('camaleon_cms.admin.table.version') %></th>
                <th><%= t('camaleon_cms.admin.table.status') %></th>
                <th><%= t('camaleon_cms.admin.table.actions') %></th>
            </tr>
            </thead>
            <tbody>
            <% plugins.each do |plugin| status = enabled_plugins.include?(plugin); r = {links: ["Version: #{plugin["version"]}"], plugin: plugin}; %>
                <tr>
                    <td>
                        <b><%= plugin["title"] %></b>
                        <br>
                        <% # sample:
                           # def cama_stripe_donation_plugin_options(args)
                           #   args[:links] << link_to('Settings', admin_plugins_cama_stripe_donation_settings_path)
                           # end %>
                        <% hook_run(plugin, "plugin_options", r) if status %>
                        <%= raw r[:links].join(" | ") %>
                    </td>
                    <td><%= raw plugin["descr"] %></td>
                    <td><%= plugin["version"] %></td>
                    <td><%= t("camaleon_cms.admin.plugins.status_#{status}") %></td>
                    <td>
                        <% msg = "#{status ? t('camaleon_cms.admin.button.disable_plugin') : t('camaleon_cms.admin.button.activate_plugin') }" %>
                        <%= link_to msg, {action: :toggle, id: plugin["key"], status: status }, class: "btn btn-#{status ? 'danger' : 'primary'} btn-xs", data: { confirm: msg } %>
                        <%= link_to("<i class='fa fa-arrow-circle-o-up'></i>".html_safe, cama_admin_plugin_upgrade_path(plugin["key"]), class: "btn btn-info btn-xs", title: "#{t("camaleon_cms.admin.plugins.upgrade_to")} #{plugin["version"]}") if status && current_site.get_plugin(plugin["key"]).old_version? %>
                    </td>
                </tr>
            <% end %>

            </tbody>
        </table>
        <%= content_tag("div", raw(t('camaleon_cms.admin.message.data_found_list')), class: "alert alert-warning") if plugins.empty? %>
    </div>
</div>
{'fraction_non_alphanumeric': 0.18500581170089112, 'fraction_numerical': 0.0, 'mean_word_length': 1.900561797752809, 'pattern_counts': {'":': 0, '<': 124, '<?xml version=': 0, '>': 121, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5215021', 'n_tokens_mistral': 1646, 'n_tokens_neox': 1522, 'n_words': 258}