<commit_before></div>

{% load staticfiles %}

<div class="navbar-fixed navbar-fixed--admin">
    <nav>
        <div class="nav-wrapper orange">
            <a id="icon-container" class="left" href="{% url 'approver:index' %}">
                <div class="container">
                    <h4>Administrator</h4>
                </div>
            </a>
        </div>
    </nav>
</div>

<div class="row dashboard_border ">
    <div class="col s12 m2 dashboard_menu">
        <ul>
            <li class="dashboard_menu-item-active"><a href="{% url 'approver:dashboard_su' %}">Modify Projects</a></li>
            <li class="dashboard_menu-item"><a href="{% url 'approver:userlist' %}">Modify Users</a></li>
        </ul>
    </div>

    <div class="col s12 m10 dashboard_border-left">
       <div class="row margin-top">
            <div class="headerbg__admin center">
                <div class="container">
                  <h1 class="question__header font__opensans"><i class="icon__admin medium material-icons">settings</i> QI Project List</h1>
                  <p class="question__header--sub"></p>
                </div>
            </div>

            <div class="col s12 m12">
                <div class="row">
                     <div class="col s12">
                        <div class="input-field dashboard_search">
                            <form method="post" action="{% url 'approver:dashboard_su' %}">
                                {% csrf_token %}
                                <input placeholder="Search your project title" class="dashboard_search-input" id="dash-search-text" type="search" name="search" value={{ search_query }} >
                                
                                <input class="dashboard__search--projects" id="dash-search-button" type="submit" value="&#128270;">
                            </form>
                        </div>
                    </div>
                </div>
            </div>

            <table class="striped">
                <thead>
                    <tr>
                        <th class="dashboard_row-title" data-field="title"><h5>Title</h5></th>
                        
                        <th class="dashboard_row-title dashboard_row-title-project project__title--forms" data-field="Approval"><h5>QI Forms <a class="waves-effect waves-light dashboard__question modal-trigger" href="#modal1">?</a></h5>

                        <!-- Modal Structure -->
                                <div id="modal1" class="modal">
                                    <div class="modal-content">
                                      <h4>How do I know if my documents are complete?</h4>
                                      <ul>
                                        <li><p><div class="dashboard__check">&#10003;</div>If you see a green check mark, it means you have <span class="dashboard__green">completed</span> all requirements of the document.</p></li>
                                        <li><p><div class="dashboard__exclaimation">!</div>If you see a red exclaimation mark, it means your document is <span class="dashboard__red">incomplete and requires edits</span>.</p></li>
                                        <li><p><div class="dashboard__star">&#9733;</div> If you see a blue star, it means your project is similar to another existing QI project. It is strongly encouraged that any time a similar project exists, you explore the option of collaborating with that existing project. By clicking the Similar Projects link, you will be able to view what similar projects are available to collaborate on.
                                            <br><br>*NOTE* Similar Projects will only appear if there is at lease 1 project out there that is similar to yours. If any similar projects exist, you have access to view them at any time by clicking the similar projects link. If there are no similar projects to yours, you will not have access to this link.</p></li>
                                      </ul>
                                    </div>
                                    <div class="modal-footer">
                                      <a href="#!" class=" modal-action modal-close waves-effect waves-green btn-flat">Close</a>
                                    </div>
                                </div>
                        </th>
                    </tr>
                </thead>
                <tbody>
                    {% for project in projects %}
                        <tr>
                            <td class="project__title">{{ project.title }}
                                <div class="dashboard__updated">This project was last updated {{ project.last_modified | date:'M d Y' }}</div>
                                <div class="dashboard_btns-admin">
                                    <form class="dashboard_delete--form" action="{% url 'approver:dashboard_su_action' action='delete' project_id=project.pk %}" method="post" onSubmit="return confirm('Are you really sure you want to delete this project?');">{% csrf_token %} <input class="dashboard_delete" type="submit" value="Delete" /></form>
                                </div>

                                <span>|</span>

                                <!-- ARCHIVE BUTTON -->
                            {% if request.session.su %}
                                {% if project.is_archived == 0 %}
                                    <div class="dashboard_btns-admin">
                                        <form class="dashboard_delete--form" action="{% url 'approver:dashboard_su_action' action='archive' project_id=project.pk %}" method="post" onSubmit="return confirm('Are you really sure you want to archive this project?');">{% csrf_token %} <input class="dashboard_delete" type="submit" value="Archive Project" /></form>
                                    </div>
                                {% else %}
                                    <div class="dashboard_btns-admin">
                                        <form class="dashboard_delete--form" action="{% url 'approver:dashboard_su_action' action='unarchive' project_id=project.pk %}" method="post" onSubmit="return confirm('Are you really sure you want to unarchive this project?');">{% csrf_token %} <input class="dashboard_delete" type="submit" value="UnArchive Project" /></form>
                                    </div>
                                {% endif %}
                            {% endif %}
                            <!-- END ARCHIVE BUTTON -->
                            </td>

                            <td class="dashboard_status project__title--forms"><a href="{% url 'approver:approve' project_id=project.pk %}">
                                <ul>
                                    {% if project.is_approved %}
                                        <li class="dashboard__list">
                                            <div class="dashboard__edit">
                                                <i class="material-icons">mode_edit</i>
                                            </div>
                                            <a href="{% url 'approver:project_status' project_id=project.pk %}">Certificate</a>
                                        </li>
                                    {% endif %}

                                    <li class="dashboard__list">
                                        <div class="dashboard__edit">
                                            <i class="material-icons">mode_edit</i>
                                        </div>
                                        <a href="{% url 'approver:projects' project_id=project.pk %}">Project Details</a></li>
                                    <li class="dashboard__list">
                                        <div class="dashboard__edit">
                                            <i class="material-icons">mode_edit</i>
                                        </div>
                                        <a href="{% url 'approver:approve' project_id=project.pk %}">Self Certification</a>
                                    </li>
                                    {% if project.has_similar_projects != 0 %}
                                        <li class="dashboard__edit">
                                            <div class="dashboard__edit">
                                                <i class="material-icons">mode_edit</i>
                                            </div>
                                            <a href="{% url 'approver:similar_projects' project_id=project.pk from_page='dashboard' %}">Similar Projects</a>
                                        </li>
                                    {% endif %}
                                </ul></a>
                            </td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>

      <div class="row">
          <div class="col s12">
            {% if show_all %}
              <div class="pagination center-align">
                  <span class="step-links">
                      <a href="{% url 'approver:dashboard' %}">Paginate Projects</a>
                  </span>
              </div>
            {% endif %}
            {% if not show_all %}
              <div class="pagination center-align">
                  <span class="step-links">
                      {% if projects.has_previous %}
                          <a href="?page={{ projects.previous_page_number }}"> &lt; </a>
                      {% endif %}

                      <span class="current">
                          Page {{ projects.number }} of {{ projects.paginator.num_pages }}
                      </span>

                      {% if projects.has_next %}
                          <a href="?page={{ projects.next_page_number }}"> &gt; </a>
                      {% endif %}
                      {% if projects.has_next or projects.has_previous %}
                          <br>
                          <a href="?page=all">Show All</a>
                      {% endif %}
                  </span>
            {% endif %}
          </div>
      </div>
        </div> <!-- end margin-top -->
    </div><!-- end dashboard_border-left -->
</div><!-- end dashboard_border -->
<commit_msg>fix bug that was preventing admin from archiving a project<commit_after></div>

{% load staticfiles %}

<div class="navbar-fixed navbar-fixed--admin">
    <nav>
        <div class="nav-wrapper orange">
            <a id="icon-container" class="left" href="{% url 'approver:index' %}">
                <div class="container">
                    <h4>Administrator</h4>
                </div>
            </a>
        </div>
    </nav>
</div>

<div class="row dashboard_border ">
    <div class="col s12 m2 dashboard_menu">
        <ul>
            <li class="dashboard_menu-item-active"><a href="{% url 'approver:dashboard_su' %}">Modify Projects</a></li>
            <li class="dashboard_menu-item"><a href="{% url 'approver:userlist' %}">Modify Users</a></li>
        </ul>
    </div>

    <div class="col s12 m10 dashboard_border-left">
       <div class="row margin-top">
            <div class="headerbg__admin center">
                <div class="container">
                  <h1 class="question__header font__opensans"><i class="icon__admin medium material-icons">settings</i> QI Project List</h1>
                  <p class="question__header--sub"></p>
                </div>
            </div>

            <div class="col s12 m12">
                <div class="row">
                     <div class="col s12">
                        <div class="input-field dashboard_search">
                            <form method="post" action="{% url 'approver:dashboard_su' %}">
                                {% csrf_token %}
                                <input placeholder="Search your project title" class="dashboard_search-input" id="dash-search-text" type="search" name="search" value={{ search_query }} >
                                
                                <input class="dashboard__search--projects" id="dash-search-button" type="submit" value="&#128270;">
                            </form>
                        </div>
                    </div>
                </div>
            </div>

            <table class="striped">
                <thead>
                    <tr>
                        <th class="dashboard_row-title" data-field="title"><h5>Title</h5></th>
                        
                        <th class="dashboard_row-title dashboard_row-title-project project__title--forms" data-field="Approval"><h5>QI Forms <a class="waves-effect waves-light dashboard__question modal-trigger" href="#modal1">?</a></h5>

                        <!-- Modal Structure -->
                                <div id="modal1" class="modal">
                                    <div class="modal-content">
                                      <h4>How do I know if my documents are complete?</h4>
                                      <ul>
                                        <li><p><div class="dashboard__check">&#10003;</div>If you see a green check mark, it means you have <span class="dashboard__green">completed</span> all requirements of the document.</p></li>
                                        <li><p><div class="dashboard__exclaimation">!</div>If you see a red exclaimation mark, it means your document is <span class="dashboard__red">incomplete and requires edits</span>.</p></li>
                                        <li><p><div class="dashboard__star">&#9733;</div> If you see a blue star, it means your project is similar to another existing QI project. It is strongly encouraged that any time a similar project exists, you explore the option of collaborating with that existing project. By clicking the Similar Projects link, you will be able to view what similar projects are available to collaborate on.
                                            <br><br>*NOTE* Similar Projects will only appear if there is at lease 1 project out there that is similar to yours. If any similar projects exist, you have access to view them at any time by clicking the similar projects link. If there are no similar projects to yours, you will not have access to this link.</p></li>
                                      </ul>
                                    </div>
                                    <div class="modal-footer">
                                      <a href="#!" class=" modal-action modal-close waves-effect waves-green btn-flat">Close</a>
                                    </div>
                                </div>
                        </th>
                    </tr>
                </thead>
                <tbody>
                    {% for project in projects %}
                        <tr>
                            <td class="project__title">{{ project.title }}
                                <div class="dashboard__updated">This project was last updated {{ project.last_modified | date:'M d Y' }}</div>
                                <div class="dashboard_btns-admin">
                                    <form class="dashboard_delete--form" action="{% url 'approver:dashboard_su_action' action='delete' project_id=project.pk %}" method="post" onSubmit="return confirm('Are you really sure you want to delete this project?');">{% csrf_token %} <input class="dashboard_delete" type="submit" value="Delete" /></form>
                                </div>

                                <span>|</span>

                                <!-- ARCHIVE BUTTON -->
                                {% if project.is_archived == 0 %}
                                    <div class="dashboard_btns-admin">
                                        <form class="dashboard_delete--form" action="{% url 'approver:dashboard_su_action' action='archive' project_id=project.pk %}" method="post" onSubmit="return confirm('Are you really sure you want to archive this project?');">{% csrf_token %} <input class="dashboard_delete" type="submit" value="Archive Project" /></form>
                                    </div>
                                {% else %}
                                    <div class="dashboard_btns-admin">
                                        <form class="dashboard_delete--form" action="{% url 'approver:dashboard_su_action' action='unarchive' project_id=project.pk %}" method="post" onSubmit="return confirm('Are you really sure you want to unarchive this project?');">{% csrf_token %} <input class="dashboard_delete" type="submit" value="UnArchive Project" /></form>
                                    </div>
                                {% endif %}
                            <!-- END ARCHIVE BUTTON -->
                            </td>

                            <td class="dashboard_status project__title--forms"><a href="{% url 'approver:approve' project_id=project.pk %}">
                                <ul>
                                    {% if project.is_approved %}
                                        <li class="dashboard__list">
                                            <div class="dashboard__edit">
                                                <i class="material-icons">mode_edit</i>
                                            </div>
                                            <a href="{% url 'approver:project_status' project_id=project.pk %}">Certificate</a>
                                        </li>
                                    {% endif %}

                                    <li class="dashboard__list">
                                        <div class="dashboard__edit">
                                            <i class="material-icons">mode_edit</i>
                                        </div>
                                        <a href="{% url 'approver:projects' project_id=project.pk %}">Project Details</a></li>
                                    <li class="dashboard__list">
                                        <div class="dashboard__edit">
                                            <i class="material-icons">mode_edit</i>
                                        </div>
                                        <a href="{% url 'approver:approve' project_id=project.pk %}">Self Certification</a>
                                    </li>
                                    {% if project.has_similar_projects != 0 %}
                                        <li class="dashboard__edit">
                                            <div class="dashboard__edit">
                                                <i class="material-icons">mode_edit</i>
                                            </div>
                                            <a href="{% url 'approver:similar_projects' project_id=project.pk from_page='dashboard' %}">Similar Projects</a>
                                        </li>
                                    {% endif %}
                                </ul></a>
                            </td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>

      <div class="row">
          <div class="col s12">
            {% if show_all %}
              <div class="pagination center-align">
                  <span class="step-links">
                      <a href="{% url 'approver:dashboard' %}">Paginate Projects</a>
                  </span>
              </div>
            {% endif %}
            {% if not show_all %}
              <div class="pagination center-align">
                  <span class="step-links">
                      {% if projects.has_previous %}
                          <a href="?page={{ projects.previous_page_number }}"> &lt; </a>
                      {% endif %}

                      <span class="current">
                          Page {{ projects.number }} of {{ projects.paginator.num_pages }}
                      </span>

                      {% if projects.has_next %}
                          <a href="?page={{ projects.next_page_number }}"> &gt; </a>
                      {% endif %}
                      {% if projects.has_next or projects.has_previous %}
                          <br>
                          <a href="?page=all">Show All</a>
                      {% endif %}
                  </span>
            {% endif %}
          </div>
      </div>
        </div> <!-- end margin-top -->
    </div><!-- end dashboard_border-left -->
</div><!-- end dashboard_border -->

{'fraction_non_alphanumeric': 0.11949411251635413, 'fraction_numerical': 0.00436109899694723, 'mean_word_length': 1.1846088705409124, 'pattern_counts': {'":': 0, '<': 395, '<?xml version=': 0, '>': 395, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 144, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6343811', 'n_tokens_mistral': 4923, 'n_tokens_neox': 4567, 'n_words': 1196}