<commit_before>##This file is based on the template from the SimpleWiki source which carries the GPL license

<%inherit file="simplewiki_base.html"/>

<%!
    from django.core.urlresolvers import reverse
%>

<%block name="wiki_page_title">
${ wiki_article.title }
</%block>

<%block name="wiki_body">
<form method="POST">
<div style="display:none">
    <input type="hidden" name="csrfmiddlewaretoken" value="${csrf_token}"/>
</div>
<table id="wiki_history_table">
    <thead>
        <tr>
            <th id="revision">Revision</th>
            <th id="comment">Comment</th>
            <th id="diff">Diff</th>
            <th id="modified">Modified</th>
        </tr>
    </thead>
    <tbody>
		<% loopCount = 0 %>
        %for revision in wiki_history:
			%if revision.deleted < 2 or show_delete_revision:
				<% loopCount += 1 %>
	            <tr style="border-top: 1px" class="${'dark ' if (loopCount % 2) == 0 else ''}${'deleted ' if (revision.deleted==2) else ''}" >
	                <td width="15px">
	                    <input  type="radio" name="revision" id="${revision.id}" value="${revision.id}"${"checked" if wiki_article.current_revision.id == revision.id else ""}/>
	                    <label for="${revision.id}">
	                        ${ revision }
	                        %if revision.previous_revision:
	                            %if not revision.counter == revision.previous_revision.counter + 1:
	                                <br/>(based on ${revision.previous_revision})
	                            %endif
	                        %endif
	                    </label>
	                </td>
	                <td>
					${ revision.revision_text if revision.revision_text else "<i>None</i>" }</td>
	                <td class="diff">
					%for x in revision.get_diff():
					${x|h}<br/>
					%endfor </td>
	                <td>${revision.get_user()}
	                    <br/>
						${revision.revision_date.strftime("%b %d, %Y, %I:%M %p")}
	                </td>
	            </tr>
			%endif
        %endfor
    </tbody>
    %if wiki_prev_page or wiki_next_page:
        <tfoot>
            <tr>
                <td colspan="4">
                    %if wiki_prev_page:
                        <a href="${reverse("wiki_history", args=[wiki_article.get_url(), wiki_prev_page])}">trans "Previous page"</a>
                    %endif
                    %if wiki_next_page:
                        <a href="${reverse("wiki_history", args=[wiki_article.get_url(), wiki_next_page])}">"Next page"</a>
                    %endif
                </td>
            </tr>
        </tfoot>
    %endif
</table>
<input type="submit" name="change" value="Change revision"
%if not wiki_write:
	disabled="true"
%endif
/>
%if show_delete_revision:
<input type="submit" name="delete" value="Delete revision"/>
<input type="submit" name="restore" value="Restore revision"/>
<input type="submit" name="delete_all" value="Delete all revisions">
%endif
</form>
</%block>
<commit_msg>Added UI for locking article. Did more testing/bug fixes on deletion. Seems stable.<commit_after>##This file is based on the template from the SimpleWiki source which carries the GPL license

<%inherit file="simplewiki_base.html"/>

<%!
    from django.core.urlresolvers import reverse
%>

<%block name="wiki_page_title">
${ wiki_article.title }
</%block>

<%block name="wiki_body">
<form method="POST">
<div style="display:none">
    <input type="hidden" name="csrfmiddlewaretoken" value="${csrf_token}"/>
</div>
<table id="wiki_history_table">
    <thead>
        <tr>
            <th id="revision">Revision</th>
            <th id="comment">Comment</th>
            <th id="diff">Diff</th>
            <th id="modified">Modified</th>
        </tr>
    </thead>
    <tbody>
		<% loopCount = 0 %>
        %for revision in wiki_history:
			%if revision.deleted < 2 or show_delete_revision:
				<% loopCount += 1 %>
	            <tr style="border-top: 1px" class="${'dark ' if (loopCount % 2) == 0 else ''}${'deleted ' if (revision.deleted==2) else ''}" >
	                <td width="15px">
	                    <input  type="radio" name="revision" id="${revision.id}" value="${revision.id}"${"checked" if wiki_article.current_revision.id == revision.id else ""}/>
	                    <label for="${revision.id}">
	                        ${ revision }
	                        %if revision.previous_revision:
	                            %if not revision.counter == revision.previous_revision.counter + 1:
	                                <br/>(based on ${revision.previous_revision})
	                            %endif
	                        %endif
	                    </label>
	                </td>
	                <td>
					${ revision.revision_text if revision.revision_text else "<i>None</i>" }</td>
	                <td class="diff">
					%for x in revision.get_diff():
					${x|h}<br/>
					%endfor </td>
	                <td>${revision.get_user()}
	                    <br/>
						${revision.revision_date.strftime("%b %d, %Y, %I:%M %p")}
	                </td>
	            </tr>
			%endif
        %endfor
    </tbody>
    %if wiki_prev_page or wiki_next_page:
        <tfoot>
            <tr>
                <td colspan="4">
                    %if wiki_prev_page:
                        <a href="${reverse("wiki_history", args=[wiki_article.get_url(), wiki_prev_page])}">trans "Previous page"</a>
                    %endif
                    %if wiki_next_page:
                        <a href="${reverse("wiki_history", args=[wiki_article.get_url(), wiki_next_page])}">"Next page"</a>
                    %endif
                </td>
            </tr>
        </tfoot>
    %endif
</table>
<input type="submit" name="change" value="Change revision"
%if not wiki_write:
	disabled="true"
%endif
/>
%if show_delete_revision:
<input type="submit" name="delete" value="Admin Delete revision"/>
<input type="submit" name="restore" value="Admin Restore revision"/>
<input type="submit" name="delete_all" value="Admin Delete all revisions">
<input type="submit" name="lock_article" value="${'Lock Article' if not wiki_article.locked else 'Unlock Article'}">
%endif
</form>
</%block>

{'fraction_non_alphanumeric': 0.15559864275327193, 'fraction_numerical': 0.003554693811601228, 'mean_word_length': 2.007774538386783, 'pattern_counts': {'":': 0, '<': 128, '<?xml version=': 0, '>': 126, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5770172', 'n_tokens_mistral': 2009, 'n_tokens_neox': 1797, 'n_words': 416}