updated gitignore, added wrongly ignored files
This commit is contained in:
parent
672856e9af
commit
142050d804
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -12,6 +12,6 @@ config.sls
|
||||||
config.json
|
config.json
|
||||||
realms/static/vendor
|
realms/static/vendor
|
||||||
realms/static/assets/*
|
realms/static/assets/*
|
||||||
wiki.db
|
/wiki.db
|
||||||
wiki
|
/wiki
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
|
|
32
realms/modules/wiki/tests.py
Normal file
32
realms/modules/wiki/tests.py
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
from nose.tools import *
|
||||||
|
from flask import url_for
|
||||||
|
from realms import app, g
|
||||||
|
from realms.modules.wiki.models import Wiki, cname_to_filename, filename_to_cname
|
||||||
|
from flask.ext.testing import TestCase
|
||||||
|
|
||||||
|
|
||||||
|
class WikiTest(TestCase):
|
||||||
|
|
||||||
|
def create_app(self):
|
||||||
|
app.config['TESTING'] = True
|
||||||
|
return app
|
||||||
|
|
||||||
|
def test_wiki_routes(self):
|
||||||
|
|
||||||
|
self.assert_200(self.client.get(url_for("wiki.create")))
|
||||||
|
|
||||||
|
for route in ['page', 'edit', 'history', 'index']:
|
||||||
|
rv = self.client.get(url_for("wiki.%s" % route, name='test'))
|
||||||
|
self.assert_200(rv, "wiki.%s: %s" % (route, rv.status_code))
|
||||||
|
|
||||||
|
def test_write_page(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_revert(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_cname_to_filename(self):
|
||||||
|
eq_(cname_to_filename('test'), 'test.md')
|
||||||
|
|
||||||
|
def test_filename_to_cname(self):
|
||||||
|
eq_(filename_to_cname('test-1-2-3.md'), 'test-1-2-3')
|
30
realms/templates/wiki/index.html
Normal file
30
realms/templates/wiki/index.html
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
{% extends 'layout.html' %}
|
||||||
|
|
||||||
|
{% block js %}
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('.data-table').dataTable();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<table class="table table-bordered data-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th class="hidden-xs">Bytes</th>
|
||||||
|
<th>Modified</th>
|
||||||
|
<th class="hidden-xs hidden-sm">Created</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
{% for file in index %}
|
||||||
|
<tr>
|
||||||
|
<td><a href="{{ url_for('wiki.page', name=file['name']) }}">{{ file['name'] }}</a></td>
|
||||||
|
<td class="hidden-xs">{{ file['size'] }}</td>
|
||||||
|
<td>{{ file['ctime']|datetime }}</td>
|
||||||
|
<td class="hidden-xs hidden-sm">{{ file['mtime']|datetime }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</table>
|
||||||
|
{% endblock %}
|
Loading…
Reference in a new issue