<commit_before>{#

Creates single item in a section.

item - The request that needs to be shown.

Example usage:
  {% snippet 'requestdata/snippets/section_item_open.html', item=item %}

#}

{% resource 'requestdata/handle-open-request.js' %}

{% set package_url = h.url_for(controller='package', action='read', id=item.package_id) %}

<div class="my-requested-data-container__content-item">
  <p class="my-requested-data-container__content-item-info">You contacted with <a href="{{ sender_profile }}" title="{{ _('View profile') }}">{{ item.sender_name }}</a> for a new data request for dataset <a href="{{ package_url }}" title="{{ _('View dataset') }}">{{ h.requestdata_get_package_title(item.package_id) }}</a>. Was data shared?</p>

  <p class="my-requested-data-container__date" title="{{ h.render_datetime(item.modified_at, with_hours=True) }}">{{ h.requestdata_time_ago_from_datetime(item.modified_at) }}</p>

  {% set action_shared = h.url_for('requestdata_handle_open_request_action', username=c.userobj.name, request_action='shared') %}
  {% set post_data_shared = h.dump_json({'id': item.id, 'package_id': item.package_id, 'state': 'archive', 'data_shared': True}) %}

  {% set action_notshared = h.url_for('requestdata_handle_open_request_action', username=c.userobj.name, request_action='shared') %}
  {% set post_data_notshared = h.dump_json({'id': item.id, 'package_id': item.package_id, 'state': 'archive', 'data_shared': False}) %}

  <div class="my-requested-data-container__actions">
    <button class="btn btn-success my-requested-data-container__actions--data-shared"
            data-module="handle-open-request"
            data-module-action="{{ action_shared }}"
            data-module-post_data="{{ post_data_shared }}">Yes</button>
    <br>
    <button class="btn btn-danger my-requested-data-container__actions--data-notshared"
            data-module="handle-open-request"
            data-module-action="{{ action_notshared }}"
            data-module-post_data="{{ post_data_notshared }}">No</button>
  </div>
</div><commit_msg>Use btn-info for Not shared button<commit_after>{#

Creates single item in a section.

item - The request that needs to be shown.

Example usage:
  {% snippet 'requestdata/snippets/section_item_open.html', item=item %}

#}

{% resource 'requestdata/handle-open-request.js' %}

{% set package_url = h.url_for(controller='package', action='read', id=item.package_id) %}

<div class="my-requested-data-container__content-item">
  <p class="my-requested-data-container__content-item-info">You contacted <a href="{{ sender_profile }}" title="{{ _('View profile') }}">{{ item.sender_name }}</a> for a new data request for dataset <a href="{{ package_url }}" title="{{ _('View dataset') }}">{{ h.requestdata_get_package_title(item.package_id) }}</a>. Was data shared?</p>

  <p class="my-requested-data-container__date" title="{{ h.render_datetime(item.modified_at, with_hours=True) }}">{{ h.requestdata_time_ago_from_datetime(item.modified_at) }}</p>

  {% set action_shared = h.url_for('requestdata_handle_open_request_action', username=c.userobj.name, request_action='shared') %}
  {% set post_data_shared = h.dump_json({'id': item.id, 'package_id': item.package_id, 'state': 'archive', 'data_shared': True}) %}

  {% set action_notshared = h.url_for('requestdata_handle_open_request_action', username=c.userobj.name, request_action='shared') %}
  {% set post_data_notshared = h.dump_json({'id': item.id, 'package_id': item.package_id, 'state': 'archive', 'data_shared': False}) %}

  <div class="my-requested-data-container__actions">
    <button class="btn btn-success my-requested-data-container__actions--data-shared"
            data-module="handle-open-request"
            data-module-action="{{ action_shared }}"
            data-module-post_data="{{ post_data_shared }}">Yes</button>
    <br>
    <button class="btn btn-info my-requested-data-container__actions--data-notshared"
            data-module="handle-open-request"
            data-module-action="{{ action_notshared }}"
            data-module-post_data="{{ post_data_notshared }}">No</button>
  </div>
</div>
{'fraction_non_alphanumeric': 0.17093810444874274, 'fraction_numerical': 0.0, 'mean_word_length': 4.961095100864553, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, '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': '2017233', 'n_tokens_mistral': 1359, 'n_tokens_neox': 1315, 'n_words': 245}