Commit 4a734bf1 by Reda Lemeden

Fixed wiki history table and header alignment issues

parent 919cf9b1
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
@import "textbook"; @import "textbook";
@import "info"; @import "info";
@import "profile"; @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 "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"; @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 { ...@@ -7,6 +7,8 @@ div.wiki-wrapper {
header { header {
@extend .topbar; @extend .topbar;
height:46px;
@include box-shadow(inset 0 1px 0 white);
&:empty { &:empty {
display: none !important; display: none !important;
...@@ -43,7 +45,7 @@ div.wiki-wrapper { ...@@ -43,7 +45,7 @@ div.wiki-wrapper {
font-size: 12px; font-size: 12px;
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 1px; letter-spacing: 1px;
padding: 14px; padding: 14.9px;
padding-left: 38px; padding-left: 38px;
margin: 0; margin: 0;
...@@ -93,10 +95,5 @@ div.wiki-wrapper { ...@@ -93,10 +95,5 @@ div.wiki-wrapper {
} }
} }
#wiki_history_table {
tr.dark {
background-color: $light-gray;
}
}
} }
} }
...@@ -17,7 +17,7 @@ ${ wiki_article.title } ...@@ -17,7 +17,7 @@ ${ wiki_article.title }
<div style="display:none"> <div style="display:none">
<input type="hidden" name="csrfmiddlewaretoken" value="${csrf_token}"/> <input type="hidden" name="csrfmiddlewaretoken" value="${csrf_token}"/>
</div> </div>
<table id="wiki_history_table"> <table id="wiki_history_table" class="wiki-history">
<thead> <thead>
<tr> <tr>
<th id="revision">Revision</th> <th id="revision">Revision</th>
...@@ -27,34 +27,34 @@ ${ wiki_article.title } ...@@ -27,34 +27,34 @@ ${ wiki_article.title }
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% loopCount = 0 %> <% loopCount = 0 %>
%for revision in wiki_history: %for revision in wiki_history:
%if revision.deleted < 2 or show_delete_revision: %if revision.deleted < 2 or show_delete_revision:
<% loopCount += 1 %> <% loopCount += 1 %>
<tr style="border-top: 1px" class="${'dark ' if (loopCount % 2) == 0 else ''}${'deleted ' if (revision.deleted==2) else ''}" > <tr style="border-top: 1px" class="${'dark ' if (loopCount % 2) == 0 else ''}${'deleted ' if (revision.deleted==2) else ''}" >
<td width="15px"> <td width="15px">
<input type="radio" name="revision" id="${revision.id}" value="${revision.id}"${"checked" if wiki_article.current_revision.id == revision.id else ""}/> <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}"> <label for="${revision.id}">
${ revision } ${ revision }
%if revision.previous_revision: %if revision.previous_revision:
%if not revision.counter == revision.previous_revision.counter + 1: %if not revision.counter == revision.previous_revision.counter + 1:
<br/>(based on ${revision.previous_revision}) <br/>(based on ${revision.previous_revision})
%endif %endif
%endif %endif
</label> </label>
</td> </td>
<td> <td>
${ revision.revision_text if revision.revision_text else "<i>None</i>" }</td> ${ revision.revision_text if revision.revision_text else "<i>None</i>" }</td>
<td class="diff"> <td class="diff">
%for x in revision.get_diff(): %for x in revision.get_diff():
${x|h}<br/> ${x|h}<br/>
%endfor </td> %endfor </td>
<td>${revision.get_user()} <td>${revision.get_user()}
<br/> <br/>
${revision.revision_date.strftime("%b %d, %Y, %I:%M %p")} ${revision.revision_date.strftime("%b %d, %Y, %I:%M %p")}
</td> </td>
</tr> </tr>
%endif %endif
%endfor %endfor
</tbody> </tbody>
%if wiki_prev_page or wiki_next_page: %if wiki_prev_page or wiki_next_page:
...@@ -72,17 +72,18 @@ ${ wiki_article.title } ...@@ -72,17 +72,18 @@ ${ wiki_article.title }
</tfoot> </tfoot>
%endif %endif
</table> </table>
<input type="submit" name="view" value="View revision"/> <div class="history-controls"><input type="submit" name="view" value="View revision"/>
<input type="submit" name="change" value="Change to revision" <input type="submit" name="change" value="Change to revision"
%if not wiki_write: %if not wiki_write:
disabled="true" disabled="true"
%endif %endif
/> />
%if show_delete_revision: %if show_delete_revision:
<input type="submit" name="delete" value="Admin Delete revision"/> <input type="submit" name="delete" value="Delete revision"/>
<input type="submit" name="restore" value="Admin Restore revision"/> <input type="submit" name="restore" value="Restore revision"/>
<input type="submit" name="delete_all" value="Admin Delete all revisions"> <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'}"> <input type="submit" name="lock_article" value="${'Lock Article' if not wiki_article.locked else 'Unlock Article'}">
%endif %endif
</div>
</form> </form>
</%block> </%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