<commit_before>{% extends "site_base.html" %}

{% load i18n %}
{% load ifsetting_tag %}
{% load threadedcommentstags %}
{% load override_tags %}
{% load avatar_tags %}
{% load group_tags %}
{% load blog_tags %}

{% block head_title %}{% trans "Welcome" %}{% endblock %}

{% block body_class %}home{% endblock %}

{% block extra_head %}
<link rel="alternate" type="application/rss+xml" 
title="Touites" href="{% url all_tweets_feed %}" />
<link rel="alternate" type="application/rss+xml" 
title="Photos" href="{% url all_photos_feed %}" />
<link rel="alternate" type="application/rss+xml" 
title="Commentaires" href="{% url all_comments_feed %}" />
<link rel="alternate" type="application/rss+xml" 
title="Tracks" href="{% url tracks_feed %}" />
<link rel="alternate" type="application/rss+xml" 
title="Blogs" href="{% url all_blogs_feed %}" />
{% endblock %}

{% block body %}

{% if not user.is_authenticated %}
<h1>{% trans 'This is your Smeuh' %}</h1>
<div id="intro-text">
  {% blocktrans %}
  <p>This site is a platform for members and friends of <a
    href="http://smeuh.org/">Smeuh.org</a> to share pictures, sound and ideas.</p>
  <p>
  To know more about the code that runs this site, report bugs and maybe
  contribute, please check <a
    href="https://github.com/alex-marandon/smeuhsocial">the GitHub
    repository</a>.
  </p>
  {% endblocktrans %}
</div>
{% endif %}

<div class="homepage-block latest-tweets">
  <h2>
    <a title="RSS Feed" href="{% url all_tweets_feed %}">
      <img src="{{ STATIC_URL }}img/feed-icon.png"/ >
    </a>
    <a href="{% url all_tweets %}">{% blocktrans %}Touites{% endblocktrans %}</a>
  </h2>
  {% if user.is_authenticated %}
  <div>
    <form id="homepage-tweet-form" action="{% url tweets_you_follow %}" method="POST">
      {% csrf_token %}
      <input type="text" autocomplete="off" id="new_tweet" name="text" cols="30" rows="4"/>

      <input type="submit" value="{% trans 'Bang' %}">
      <span id="chars_left">140</span> caractères restant.
    </form>
  </div>
  {% endif %}
  {% for tweet in latest_tweets %}
  <div class="tweet-item" class="clearfix">
    {% avatar_link tweet.sender 24 %}
    {% include "microblogging/_tweet.html" %}
  </div>
  {% endfor %}
</div>


{% get_latest_comments 12 as latest_comments %}
<div class="homepage-block">
  <h2>
    <a title="RSS Feed" href="{% url all_comments_feed %}"><img 
      src="{{ STATIC_URL }}img/feed-icon.png"/ ></a>
    {% blocktrans %}Comments{% endblocktrans %}
  </h2>
</div>
{% for comment in latest_comments %}
{% if comment.content_object %}
<div class="latest-comment-entry {% if forloop.last %}last{% endif %}">
  <div class="clearfix">
    {% avatar_link comment.user 24 %}
    {% profile_link comment.user %} {% trans ' on ' %} <a href="{{ comment.content_object.get_absolute_url }}">{{ comment.content_object.title }}</a> 
    <span class="comment-blurb-date">{% blocktrans with comment.date_modified|timesince as tweet_age %}{{ tweet_age }} ago{% endblocktrans %}</span>
  </div>

  <div class="comment-blurb">{{ comment.comment|truncatewords:30|urlize|profilize }}</div>
</div>
{% endif %}
{% endfor %}

<div class="homepage-block">
  <h2>
    <a title="RSS Feed" href="{% url all_photos_feed %}"><img 
      src="{{ STATIC_URL }}img/feed-icon.png"/ ></a>
    <a href="{% url photos %}">{% blocktrans %}Photos{% endblocktrans %}</a>
  </h2>
  {% for photo in latest_photos%}
  <a href="{% groupurl photo_details group id=photo.id %}"><img
    class="homepage-photo border-shadow{% cycle '' ''  ' row-end' %}" src="{{ photo.get_thumbnail_url }}" alt="{{ photo.title }}"/></a>
  {% endfor %}
</div>
<div class="homepage-block latest-blogs"><commit_msg>Fix comments block<commit_after>{% extends "site_base.html" %}

{% load i18n %}
{% load ifsetting_tag %}
{% load threadedcommentstags %}
{% load override_tags %}
{% load avatar_tags %}
{% load group_tags %}
{% load blog_tags %}

{% block head_title %}{% trans "Welcome" %}{% endblock %}

{% block body_class %}home{% endblock %}

{% block extra_head %}
<link rel="alternate" type="application/rss+xml" 
title="Touites" href="{% url all_tweets_feed %}" />
<link rel="alternate" type="application/rss+xml" 
title="Photos" href="{% url all_photos_feed %}" />
<link rel="alternate" type="application/rss+xml" 
title="Commentaires" href="{% url all_comments_feed %}" />
<link rel="alternate" type="application/rss+xml" 
title="Tracks" href="{% url tracks_feed %}" />
<link rel="alternate" type="application/rss+xml" 
title="Blogs" href="{% url all_blogs_feed %}" />
{% endblock %}

{% block body %}

{% if not user.is_authenticated %}
<h1>{% trans 'This is your Smeuh' %}</h1>
<div id="intro-text">
  {% blocktrans %}
  <p>This site is a platform for members and friends of <a
    href="http://smeuh.org/">Smeuh.org</a> to share pictures, sound and ideas.</p>
  <p>
  To know more about the code that runs this site, report bugs and maybe
  contribute, please check <a
    href="https://github.com/alex-marandon/smeuhsocial">the GitHub
    repository</a>.
  </p>
  {% endblocktrans %}
</div>
{% endif %}

<div class="homepage-block latest-tweets">
  <h2>
    <a title="RSS Feed" href="{% url all_tweets_feed %}">
      <img src="{{ STATIC_URL }}img/feed-icon.png"/ >
    </a>
    <a href="{% url all_tweets %}">{% blocktrans %}Touites{% endblocktrans %}</a>
  </h2>
  {% if user.is_authenticated %}
  <div>
    <form id="homepage-tweet-form" action="{% url tweets_you_follow %}" method="POST">
      {% csrf_token %}
      <input type="text" autocomplete="off" id="new_tweet" name="text" cols="30" rows="4"/>

      <input type="submit" value="{% trans 'Bang' %}">
      <span id="chars_left">140</span> caractères restant.
    </form>
  </div>
  {% endif %}
  {% for tweet in latest_tweets %}
  <div class="tweet-item" class="clearfix">
    {% avatar_link tweet.sender 24 %}
    {% include "microblogging/_tweet.html" %}
  </div>
  {% endfor %}
</div>


{% get_latest_comments 12 as latest_comments %}
<div class="homepage-block">
  <h2>
    <a title="RSS Feed" href="{% url all_comments_feed %}"><img 
      src="{{ STATIC_URL }}img/feed-icon.png"/ ></a>
    {% blocktrans %}Comments{% endblocktrans %}
  </h2>
{% for comment in latest_comments %}
{% if comment.content_object %}
<div class="latest-comment-entry {% if forloop.last %}last{% endif %}">
  <div >
    {% avatar_link comment.user 24 %}
    {% profile_link comment.user %} {% trans ' on ' %} <a href="{{ comment.content_object.get_absolute_url }}">{{ comment.content_object.title }}</a> 
    <span class="comment-blurb-date">{% blocktrans with comment.date_modified|timesince as tweet_age %}{{ tweet_age }} ago{% endblocktrans %}</span>
  </div>

  <div class="comment-blurb">{{ comment.comment|truncatewords:30|urlize|profilize }}</div>
</div>
{% endif %}
{% endfor %}
</div>

<div class="homepage-block">
  <h2>
    <a title="RSS Feed" href="{% url all_photos_feed %}"><img 
      src="{{ STATIC_URL }}img/feed-icon.png"/ ></a>
    <a href="{% url photos %}">{% blocktrans %}Photos{% endblocktrans %}</a>
  </h2>
  {% for photo in latest_photos%}
  <a href="{% groupurl photo_details group id=photo.id %}"><img
    class="homepage-photo border-shadow{% cycle '' ''  ' row-end' %}" src="{{ photo.get_thumbnail_url }}" alt="{{ photo.title }}"/></a>
  {% endfor %}
</div>
<div class="homepage-block latest-blogs">
{'fraction_non_alphanumeric': 0.20032639738882088, 'fraction_numerical': 0.006527947776417789, 'mean_word_length': 4.279253409906676, 'pattern_counts': {'":': 0, '<': 135, '<?xml version=': 0, '>': 135, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, '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': '7522744', 'n_tokens_mistral': 2852, 'n_tokens_neox': 2537, 'n_words': 614}