<commit_before>{% extends "grid/base.html" %}

{% comment %}
    Finish the add/edit/delete for features
    Finish the add/edit/delete for packages    
    Finish the edit for elements
    Figure out how to use facebox for the forms cause right now the edits don't stick
     rel="facebox"
{% endcomment %}

{% load i18n %}
{% load grid_tags %}

{% block head_title %}{{ object.title }}{% endblock %}


{% block body %}
    
    <h1 id="grid-name">{{ grid.title }}</h1>
    <div id="grid-editlink">
        <a href="{% url edit_grid grid.slug %}">Edit</a>
    </div>    
    
    <div id="grid-description">
        {{ grid.description|urlize|linebreaksbr }}
    </div>
    
    {% with grid.feature_set.all as features %}
    
    <div id="grid-features">
        <h2>Features currently being evaluated</h2>
        <table id="grid" border="3">      
            <thead>
                <tr>
                    {% if request.user.is_authenticated %}
                        <th>Action</th>
                    {% endif %}
                    <th>Feature</th>
                    <th>Description</th>
                </tr> 
            </thead>
            <tbody>
                {% for feature in features %}
                    <tr>
                        {% if request.user.is_authenticated %}
                            <td><a href="">Edit</a>/<a href="#" id="feature-delete-{{ feature.id }}">Delete</a></td>
                        {% endif %}
                        
                        <td>{{ feature.title }}</td>
                        <td>{{ feature.description }}</td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
        
        <p><a href="#TODO">Add new feature to the grid</a></p>
    </div>
    
    {% with grid.gridpackage_set.all as grid_packages %}
    <div id="grid-parent">
    
        <table id="grid" border="3">
            <thead>
                <tr>
                    <th>Package</th>
                    {% for package in grid_packages %}
                        <th><a href="{% url package package.package.slug %}">{{ package.package.title }}</a></th>                
                    {% endfor %}
                </tr>
            </thead>
            <tbody>
                <tr class="odd">
                    <td>Version</td>
                    {% for package in grid_packages %}
                        <td>{{ package.package.pypi_version }}</td>
                    {% endfor %}
                
                </tr>
                <tr class="even">
                    <td>Downloads</td>
                    {% for package in grid_packages %}
                        <td>
                            {% if package.package.pypi_version %}
                                {{ package.package.pypi_downloads }}
                            {% else %}
                                n/a
                            {% endif %}
                        
                        </td>
                    {% endfor %}
                </tr>
                <tr class="odd">
                    <td>Category</td>
                    {% for package in grid_packages %}
                        <td>{{ package.package.category }}</td>
                    {% endfor %}
                </tr>                
                <tr class="even">
                    <td>Repo</td>
                    {% for package in grid_packages %}
                        <td>{{ package.package.repo }}</td>
                    {% endfor %}
                </tr>            
                <tr class="odd">
                    <td>Repo Watchers</td>
                    {% for package in grid_packages %}
                        <td>{{ package.package.repo_watchers }}</td>
                    {% endfor %}
                </tr>
                <tr class="even">
                    <td>Repo Forks</td>
                    {% for package in grid_packages %}
                        <td>{{ package.package.repo_forks }}</td>
                    {% endfor %}
                </tr>
                <tr class="odd">
                    <td>Participants</td>
                    {% for package in grid_packages %}
                        <td>
                            {% for collaborator in package.package.participant_list %}
                                <a href="{{ package.package.repo.url }}/{{ collaborator }}">{{ collaborator }}</a>
                            {% endfor %}                        
                        </td>
                    {% endfor %}
                </tr>
                {% for feature in features %}
                    <tr class="{% cycle 'even' 'odd' %}">
                        <td>{{ feature.title }}</td>
                        {% for package in grid_packages %}
                            {% get_or_create_grid_element package feature %}
                                <td id="element-f{{ element.feature_id }}-p{{ element.grid_package_id }}">{{ element.text|style_element }}</td>
                        {% endfor %}
                    </tr>
                {% endfor %}
            
            </tbody>
        
        </table>
    </div>
    
    {% if request.user.is_authenticated %}
        <p>Click on editable cells to change text.</p>
    {% endif %}
    
    {% endwith %}
    {% endwith %}    

{% endblock %}

{% block extra_body %}
    {% with grid.gridpackage_set.all as grid_packages %}
        <script type="text/javascript">
        //what
            $(function() {  

                {% for element in grid.elements %}
                    $("td#element-f{{ element.feature_id }}-p{{ element.grid_package_id }}").click(function() {
                        var url = "{% url edit_element element.feature_id element.grid_package_id %}";    
                        $(location).attr('href',url);                        
                    });
                {% endfor %}                
                
              $(".button").click(function() {  
                // validate and process form here  
              });  
            });    
        </script>
    {% endwith %}        
{% endblock %}<commit_msg>Grid elements only pull up edit form if the user is authenticated<commit_after>{% extends "grid/base.html" %}

{% comment %}
    Finish the add/edit/delete for features
    Finish the add/edit/delete for packages    
    Finish the edit for elements
    Figure out how to use facebox for the forms cause right now the edits don't stick
     rel="facebox"
{% endcomment %}

{% load i18n %}
{% load grid_tags %}

{% block head_title %}{{ object.title }}{% endblock %}


{% block body %}
    
    <h1 id="grid-name">{{ grid.title }}</h1>
    <div id="grid-editlink">
        <a href="{% url edit_grid grid.slug %}">Edit</a>
    </div>    
    
    <div id="grid-description">
        {{ grid.description|urlize|linebreaksbr }}
    </div>
    
    {% with grid.feature_set.all as features %}
    
    <div id="grid-features">
        <h2>Features currently being evaluated</h2>
        <table id="grid" border="3">      
            <thead>
                <tr>
                    {% if request.user.is_authenticated %}
                        <th>Action</th>
                    {% endif %}
                    <th>Feature</th>
                    <th>Description</th>
                </tr> 
            </thead>
            <tbody>
                {% for feature in features %}
                    <tr>
                        {% if request.user.is_authenticated %}
                            <td><a href="">Edit</a>/<a href="#" id="feature-delete-{{ feature.id }}">Delete</a></td>
                        {% endif %}
                        
                        <td>{{ feature.title }}</td>
                        <td>{{ feature.description }}</td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
        
        <p><a href="#TODO">Add new feature to the grid</a></p>
    </div>
    
    {% with grid.gridpackage_set.all as grid_packages %}
    <div id="grid-parent">
    
        <table id="grid" border="3">
            <thead>
                <tr>
                    <th>Package</th>
                    {% for package in grid_packages %}
                        <th><a href="{% url package package.package.slug %}">{{ package.package.title }}</a></th>                
                    {% endfor %}
                </tr>
            </thead>
            <tbody>
                <tr class="odd">
                    <td>Version</td>
                    {% for package in grid_packages %}
                        <td>{{ package.package.pypi_version }}</td>
                    {% endfor %}
                
                </tr>
                <tr class="even">
                    <td>Downloads</td>
                    {% for package in grid_packages %}
                        <td>
                            {% if package.package.pypi_version %}
                                {{ package.package.pypi_downloads }}
                            {% else %}
                                n/a
                            {% endif %}
                        
                        </td>
                    {% endfor %}
                </tr>
                <tr class="odd">
                    <td>Category</td>
                    {% for package in grid_packages %}
                        <td>{{ package.package.category }}</td>
                    {% endfor %}
                </tr>                
                <tr class="even">
                    <td>Repo</td>
                    {% for package in grid_packages %}
                        <td>{{ package.package.repo }}</td>
                    {% endfor %}
                </tr>            
                <tr class="odd">
                    <td>Repo Watchers</td>
                    {% for package in grid_packages %}
                        <td>{{ package.package.repo_watchers }}</td>
                    {% endfor %}
                </tr>
                <tr class="even">
                    <td>Repo Forks</td>
                    {% for package in grid_packages %}
                        <td>{{ package.package.repo_forks }}</td>
                    {% endfor %}
                </tr>
                <tr class="odd">
                    <td>Participants</td>
                    {% for package in grid_packages %}
                        <td>
                            {% for collaborator in package.package.participant_list %}
                                <a href="{{ package.package.repo.url }}/{{ collaborator }}">{{ collaborator }}</a>
                            {% endfor %}                        
                        </td>
                    {% endfor %}
                </tr>
                {% for feature in features %}
                    <tr class="{% cycle 'even' 'odd' %}">
                        <td>{{ feature.title }}</td>
                        {% for package in grid_packages %}
                            {% get_or_create_grid_element package feature %}
                                <td id="element-f{{ element.feature_id }}-p{{ element.grid_package_id }}">{{ element.text|style_element }}</td>
                        {% endfor %}
                    </tr>
                {% endfor %}
            
            </tbody>
        
        </table>
    </div>
    
    {% if request.user.is_authenticated %}
        <p>Click on editable cells to change text.</p>
    {% endif %}
    
    {% endwith %}
    {% endwith %}    

{% endblock %}

{% block extra_body %}
    {% with grid.gridpackage_set.all as grid_packages %}
        <script type="text/javascript">

            $(function() {  
                
                {% if request.user.is_authenticated %}
                    {% for element in grid.elements %}
                        $("td#element-f{{ element.feature_id }}-p{{ element.grid_package_id }}").click(function() {
                            var url = "{% url edit_element element.feature_id element.grid_package_id %}";    
                            $(location).attr('href',url);                        
                        });
                    {% endfor %}                
                 {% endif %}
            });    
        </script>
    {% endwith %}        
{% endblock %}
{'fraction_non_alphanumeric': 0.13212288238631759, 'fraction_numerical': 0.0012969117289454487, 'mean_word_length': 0.9759769378603459, 'pattern_counts': {'":': 0, '<': 227, '<?xml version=': 0, '>': 227, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 13, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4310901', 'n_tokens_mistral': 3405, 'n_tokens_neox': 2943, 'n_words': 665}