<commit_before><%= attribute_table_row(t("myplaceonline.feeds.name"), obj.name) %>
<%= attribute_table_row_url(t("myplaceonline.feeds.url"), obj.url) %>

<% content_for :aftertable do %>
  
  <script type="text/javascript">
    function feed_item_mark_read(obj, id) {
      var link = "<%= feed_feed_item_mark_read_url(obj.id, -1) %>";
      link = link.replace(/-1/, id);
      myplaceonline.showLoading();
      $.ajax({
        url: link,
        method: "POST",
        dataType: "json",
        context: {
          obj: obj
        }
      }).done(function(data, textStatus, jqXHR) {
        if (data.result) {
          myplaceonline.createSuccessNotification("<%= t("myplaceonline.feed_items.item_marked_read") %>");
          $(this.obj).parents("li").first().find(".feed_item").first().addClass("bghighlight");
        }
      }).fail(function(jqXHR, textStatus, errorThrown) {
        myplaceonline.criticalError("Error. jqXHR: " + jqXHR.readyState + "," + jqXHR.status + ", " + jqXHR.responseText + ", " + jqXHR.responseXML + ", status: " + textStatus, errorThrown);
      }).complete(function(jqXHR, textStatus) {
        myplaceonline.hideLoading();
      });
  }
  </script>

  <ul data-role="listview" data-inset="true">
    <% obj.feed_items.first(20).each do |item| %>
      <li>
        <%= link_to(item.feed_link, class: "feed_item" + (item.is_read? ? " bghighlight" : "")) do %>
          <%= item.display %>
          <span class="ui-li-count"><%= Myp.display_datetime_short(item.publication_date, current_user) %></span>
        <% end %>
        <%= link_to(feed_feed_item_path(obj, item), data: { icon: "check" }, onclick: "feed_item_mark_read(this, " + item.id.to_s + "); return false;") do %>
          <%= t("myplaceonline.feed_items.item_mark_read") %>
        <% end %>
      </li>
    <% end %><commit_msg>Add ability to quick edit after marking feed item read<commit_after><%= attribute_table_row(t("myplaceonline.feeds.name"), obj.name) %>
<%= attribute_table_row_url(t("myplaceonline.feeds.url"), obj.url) %>

<% content_for :aftertable do %>
  
  <script type="text/javascript">
    function feed_item_mark_read(obj, id) {
      if (!$(obj).parents("li").first().find(".feed_item").first().hasClass("bghighlight")) {
        var link = "<%= feed_feed_item_mark_read_url(obj.id, -1) %>";
        link = link.replace(/-1/, id);
        myplaceonline.showLoading();
        $.ajax({
          url: link,
          method: "POST",
          dataType: "json",
          context: {
            obj: obj
          }
        }).done(function(data, textStatus, jqXHR) {
          if (data.result) {
            myplaceonline.createSuccessNotification("<%= t("myplaceonline.feed_items.item_marked_read") %>");
            var $obj = $(this.obj);
            $obj.parents("li").first().find(".feed_item").first().addClass("bghighlight");
            $obj.removeClass("ui-icon-check");
            $obj.addClass("ui-icon-edit");
          }
        }).fail(function(jqXHR, textStatus, errorThrown) {
          myplaceonline.criticalError("Error. jqXHR: " + jqXHR.readyState + "," + jqXHR.status + ", " + jqXHR.responseText + ", " + jqXHR.responseXML + ", status: " + textStatus, errorThrown);
        }).complete(function(jqXHR, textStatus) {
          myplaceonline.hideLoading();
        });
        return false;
      } else {
        return true;
      }
    }
  </script>

  <ul data-role="listview" data-inset="true">
    <% obj.feed_items.first(20).each do |item| %>
      <li>
        <%= link_to(item.feed_link, class: "feed_item" + (item.is_read? ? " bghighlight" : "")) do %>
          <%= item.display %>
          <span class="ui-li-count"><%= Myp.display_datetime_short(item.publication_date, current_user) %></span>
        <% end %>
        <% if item.is_read? %>
          <%= link_to(feed_feed_item_path(obj, item), data: { icon: "edit" }) do %>
            <%= t("myplaceonline.general.edit") %>
          <% end %>
        <% else %>
          <%= link_to(feed_feed_item_path(obj, item), data: { icon: "check" }, onclick: "return feed_item_mark_read(this, " + item.id.to_s + ");") do %>
            <%= t("myplaceonline.feed_items.item_mark_read") %>
          <% end %>
        <% end %>
      </li>
    <% end %>
{'fraction_non_alphanumeric': 0.18529826209488023, 'fraction_numerical': 0.0018788163457022077, 'mean_word_length': 2.6874458874458873, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7634257', 'n_tokens_mistral': 1487, 'n_tokens_neox': 1399, 'n_words': 212}