Commit 4a734bf1 by Reda Lemeden

Fixed wiki history table and header alignment issues

parent 919cf9b1
......@@ -11,7 +11,7 @@
@import "textbook";
@import "info";
@import "profile";
@import "wiki/basic-html", "wiki/sidebar", "wiki/create", "wiki/wiki";
@import "wiki/basic-html", "wiki/sidebar", "wiki/create", "wiki/wiki", "wiki/table";
@import "help";
@import "discussion/askbot-original", "discussion/discussion","discussion/sidebar", "discussion/questions", "discussion/tags", "discussion/question-view" , "discussion/answers", "discussion/forms", "discussion/form-wmd-toolbar", "discussion/modals", "discussion/profile";
table.wiki-history {
thead {
background: #ddd;
// border-bottom: 1px solid #ddd;
tr {
height: 40px;
th {
padding-top: 10px;
padding-left: 15px;
&#revision {
width: 5%;
}
&#comment {
width: 15%;
}
&#diff {
width: 60%;
}
&#modified {
width:20%;
}
}
}
}
tbody {
tr td {
padding: 8px 15px;
}
}
tr.dark {
background-color: #efefef;
}
}
div.history-controls {
margin-top: 20px;
input[type="submit"] {
@extend .light-button;
}
}
......@@ -7,6 +7,8 @@ div.wiki-wrapper {
header {
@extend .topbar;
height:46px;
@include box-shadow(inset 0 1px 0 white);
&:empty {
display: none !important;
......@@ -43,7 +45,7 @@ div.wiki-wrapper {
font-size: 12px;
text-transform: uppercase;
letter-spacing: 1px;
padding: 14px;
padding: 14.9px;
padding-left: 38px;
margin: 0;
......@@ -93,10 +95,5 @@ div.wiki-wrapper {
}
}
#wiki_history_table {
tr.dark {
background-color: $light-gray;
}
}
}
}
......@@ -17,7 +17,7 @@ ${ wiki_article.title }
<div style="display:none">
<input type="hidden" name="csrfmiddlewaretoken" value="${csrf_token}"/>
</div>
<table id="wiki_history_table">
<table id="wiki_history_table" class="wiki-history">
<thead>
<tr>
<th id="revision">Revision</th>
......@@ -27,34 +27,34 @@ ${ wiki_article.title }
</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
<% 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:
......@@ -72,17 +72,18 @@ ${ wiki_article.title }
</tfoot>
%endif
</table>
<input type="submit" name="view" value="View revision"/>
<input type="submit" name="change" value="Change to 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
<div class="history-controls"><input type="submit" name="view" value="View revision"/>
<input type="submit" name="change" value="Change to 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">
<input type="submit" name="lock_article" value="${'Lock Article' if not wiki_article.locked else 'Unlock Article'}">
%endif
</div>
</form>
</%block>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment