<commit_before>{% extends 'layout.html.twig' %}
{% set pagetitle = 'metagist.org on ' ~ package %}

{% block content %}

<div class="item item-blue">
    <div class="content">
    <h1>{{package.getIdentifier}}</h1>
    <p>{{package.description}}</p>
    <p>
        {% set homepageInfo = package.getMetaInfos('community', 'homepage').first %}
        {% if homepageInfo %}
        <a href="{{ homepageInfo.getValue }}"><i class="icon-white icon-home"></i> Homepage</a><br />
        {% endif %}
        <a href="http://packagist.org/packages/{{package.identifier}}">
            <i class="icon-white icon-archive"></i> See the package at Packagist.org</a>
        <br />
    </p>
    <div class="clearfix"></div>
    <div class="tabbable">
      <ul class="nav nav-tabs">
          {% for name, data in categories.getCategories() %}
              {% if name != 'flags' %}
              <li class="{% if loop.first %}active{%endif%}"><a href="#tab_{{name}}" data-toggle="tab">{{name | trans}}</a></li>
              {% endif %}
          {% endfor %}
      </ul>
      <div class="tab-content">
          {% for name, data in categories.getCategories() %}
              {% if name != 'flags' %}
              <div class="tab-pane {% if loop.first %}active{%endif%}" id="tab_{{name}}">
                  <div class="pull-right span2">
                    {% if (is_granted('ROLE_USER') or is_granted('ROLE_ADMIN')) %}
                    {% else %}
                        <a class="btn btn-primary btn-block" href="{{ path('login') }}">
                            <i class="icon-white icon-4x icon-rocket"></i><br /> {{ 'Contribute!'|trans }}</a>
                        <br />
                    {% endif %}
                </div>
                  {% for group, groupdata in categories.getGroups(name) %}
                    {% if (groupdata.access == 'ROLE_ADMIN' and is_granted(groupdata.access)) or groupdata.access != 'ROLE_ADMIN' %}
                        {% set infos = package.getMetaInfos(group)%}
                            <dl class="dl-horizontal">
                                 <dt title="{{groupdata.description}}">{{ icon(group) }} {{ (group) | trans}}</dt>
                                 {% if infos.count %}
                                    <dd>{{ renderInfos(infos) }}</dd>
                                 {% else %}
                                    <dd>
                                    {% if is_granted(groupdata.access) %}
                                        <a href="/contribute/{{package.identifier}}/{{group}}">
                                            <i class="icon-pencil"></i> add this information
                                        </a>
                                    {% else %}
                                        <span class="text-warning">Contribution required</span>
                                    {% endif %}
                                    </dd>
                                 {% endif %}
                            </dl>
                    {% endif %}
                  {% endfor %}
              </div>
              {% endif %}
          {% endfor %}
      </div>
    </div>
    
    <small class="pull-right">Last updated: {{ package.getTimeUpdated }}</small>
    {% if is_granted('ROLE_ADMIN') %}
        <br /><a class="btn btn-small" href="/update/{{package.identifier}}"><i class="icon-refresh"></i> Update</a>
    {% endif %}
    <hr />
    {% if (is_granted('ROLE_USER') or is_granted('ROLE_ADMIN')) %}
        <div class="span2 pull-right text-right">
            <a class="btn" href="/rate/{{package.identifier}}"><i class="icon-white icon-star"></i> Rate this package</a><br />
        </div>
    {% endif %}
    <h2>{{ "Reviews" |trans}}</h2>
    <div class="row-fluid">
        {% for rating in ratings %}
            <div class="span2 text-center">
                <h2>{% for i in 1..rating.rating %}<i class="icon icon-star"></i>{% endfor %}</h2>
                <div>
                    <img src="{{rating.getUser.getAvatarUrl}}" alt="User icon" /><br />
                    by {{rating.getUser.getUsername}}
                </div>
            </div>
            <div class="span10">
                <h2>{{rating.title | e}}</h2>
                <p>{{rating.comment | e}}</p>
            </div>
        {% endfor %}
        
            
        <a class="btn btn-small" href="/ratings/{{package.getIdentifier}}">more</a>
    </div>
    
    
    </div>
</div>
{% endblock %}<commit_msg>ui improvement for packge page<commit_after>{% extends 'layout.html.twig' %}
{% set pagetitle = 'metagist.org on ' ~ package %}

{% block content %}

<div class="item item-blue">
    <div class="content">
    <h1>{{package.getIdentifier}}</h1>
    <p>{{package.description}}</p>
    <p>
        {% set homepageInfo = package.getMetaInfos('community', 'homepage').first %}
        {% if homepageInfo %}
        <a href="{{ homepageInfo.getValue }}"><i class="icon-white icon-home"></i> Homepage</a><br />
        {% endif %}
        <a href="http://packagist.org/packages/{{package.identifier}}">
            <i class="icon-white icon-archive"></i> See the package at Packagist.org</a>
        <br />
    </p>
    <div class="clearfix"></div>
    <div class="tabbable">
      <ul class="nav nav-tabs">
          {% for name, data in categories.getCategories() %}
              {% if name != 'flags' %}
              <li class="{% if loop.first %}active{%endif%}"><a href="#tab_{{name}}" data-toggle="tab">{{name | trans}}</a></li>
              {% endif %}
          {% endfor %}
      </ul>
      <div class="tab-content">
          {% for name, data in categories.getCategories() %}
              {% if name != 'flags' %}
              <div class="tab-pane {% if loop.first %}active{%endif%}" id="tab_{{name}}">
                  <div class="pull-right span2">
                    {% if (is_granted('ROLE_USER') or is_granted('ROLE_ADMIN')) %}
                    {% else %}
                        <a class="btn btn-primary btn-block" href="{{ path('login') }}">
                            <i class="icon-white icon-4x icon-rocket"></i><br /> {{ 'Contribute!'|trans }}</a>
                        <br />
                    {% endif %}
                </div>
                  {% for group, groupdata in categories.getGroups(name) %}
                    {% if (groupdata.access == 'ROLE_ADMIN' and is_granted(groupdata.access)) or groupdata.access != 'ROLE_ADMIN' %}
                        {% set infos = package.getMetaInfos(group)%}
                            <dl class="dl-horizontal">
                                 <dt title="{{groupdata.description}}">{{ icon(group) }} {{ (group) | trans}}</dt>
                                 {% if infos.count %}
                                    <dd>{{ renderInfos(infos) }}</dd>
                                 {% else %}
                                    <dd>
                                    {% if is_granted(groupdata.access) %}
                                        <a href="/contribute/{{package.identifier}}/{{group}}">
                                            <i class="icon-pencil"></i> add this information
                                        </a>
                                    {% else %}
                                        <span class="text-warning">Contribution required</span>
                                    {% endif %}
                                    </dd>
                                 {% endif %}
                            </dl>
                    {% endif %}
                  {% endfor %}
              </div>
              {% endif %}
          {% endfor %}
      </div>
    </div>
    
    <small class="pull-right">Last updated: {{ package.getTimeUpdated }}</small>
    {% if is_granted('ROLE_ADMIN') %}
        <br /><a class="btn btn-small" href="/update/{{package.identifier}}"><i class="icon-refresh"></i> Update</a>
    {% endif %}
    <hr />
    <div class="span4 pull-right text-right">
        {% if (is_granted('ROLE_USER') or is_granted('ROLE_ADMIN')) %}
            <a class="btn" href="/rate/{{package.identifier}}"><i class="icon-white icon-star"></i> Rate this package</a> 
        {% endif %}
        <a class="btn" href="/ratings/{{package.getIdentifier}}">more</a>
    </div>
    <h2>{{ "Reviews" |trans}}</h2>
    <div class="row-fluid">
        {% for rating in ratings %}
            <div class="span2 text-center">
                <h2>{% for i in 1..rating.rating %}<i class="icon icon-star"></i>{% endfor %}</h2>
                <div>
                    <img src="{{rating.getUser.getAvatarUrl}}" alt="User icon" /><br />
                    by {{rating.getUser.getUsername}}
                </div>
            </div>
            <div class="span10">
                <h2>{{rating.title | e}}</h2>
                <p>{{rating.comment | e}}</p>
            </div>
        {% endfor %}
    </div>
    </div>
</div>
{% endblock %}
{'fraction_non_alphanumeric': 0.17704844831435587, 'fraction_numerical': 0.003348961821835231, 'mean_word_length': 1.4174311926605505, 'pattern_counts': {'":': 0, '<': 188, '<?xml version=': 0, '>': 188, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 32, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2866665', 'n_tokens_mistral': 2682, 'n_tokens_neox': 2410, 'n_words': 495}