wiki: finish pages

This commit is contained in:
Unknwon committed 2015-11-27 02:16:12 -05:00
1 parent e42fcb033d
commit 5d1f5f32d0
4 files changed
+86 -9

No files matched your search

+2
View File
@@ -548,6 +548,8 @@ wiki.last_commit_info = %s edited this page %s
wiki.edit_page_button = Edit
wiki.new_page_button = New Page
wiki.page_already_exists = Wiki page with same name already exists.
wiki.pages = Pages
wiki.last_updated = Last updated %s
settings = Settings
settings.options = Options
+2 -2
View File
@@ -4364,7 +4364,7 @@ func confLocaleLocale_deDeIni() (*asset, error) {
return a, nil
}
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xbc\xbd\xeb\x72\xdc\x48\xae\x27\xfe\x9d\x4f\xc1\xf6\x84\xc3\x76\x84\x5c\x8e\xee\x3e\xff\xff\x6e\x74\xb4\xdd\x2b\x4b\xed\xcb\x39\x96\xa5\xb1\xd4\xd3\x3b\xeb\x70\xb0\x59\x45\xaa\x8a\xe3\x2a\xb2\x9a\x64\xb9\xac\x39\x71\x22\xf6\x01\xf6\x01\x76\x5f\xef\x3c\xc9\x02\x3f\x00\x79\x21\x59\x92\xdd\x33\xb1\xfe\x60\xb1\x32\x91\x37\x24\x12\x89\x44\x02\xc8\x7c\xbb\xcd\x8a\xb2\x5b\xa4\x4f\xd3\xe3\x74\x9b\x57\xf5\xba\xec\xba\xb4\x2b\xd7\xd7\x8f\x57\x4d\xd7\x97\x45\xfa\xb2\xea\xe9\x77\xfb\xa9\x5a\x94\x49\xb2\x6a\x36\x25\x81\xbe\xa2\x3f\x49\x91\x77\xab\x79\x93\xb7\x05\x25\x9c\xda\x77\x52\x7e\xde\xae\x9b\x96\x81\x7e\x96\xaf\x64\x55\xae\xb7\x5c\x86\xfe\x24\x5d\xb5\xac\xb3\xaa\xa6\x9f\x97\xf4\x95\xbe\xae\x25\xa5\xd9\xf5\x96\x74\xbe\xeb\x25\x6d\xb7\xb5\xa4\x5f\xb6\x49\x5b\x2e\x2b\xea\x4d\x4b\x49\xef\xf4\x33\xd9\x97\xf3\xae\xea\xb9\xa5\x5f\xe5\x2b\xf9\x54\xb6\x5d\xd5\x70\xed\x7f\x91\xaf\x64\x9b\x2f\x19\xe0\x82\xfe\x24\x7d\xb9\xd9\xae\x73\x14\xb8\xd2\xcf\x64\x9d\xd7\xcb\x9d\xc0\xbc\xd1\xcf\x64\xd1\x96\x94\x95\xd5\xe5\x9e\x52\x4f\xf0\x63\x36\x9b\x25\x3b\x42\x42\xb6\x6d\x9b\xeb\x6a\x5d\x66\x79\x5d\x64\x1b\x19\xe6\x2f\x94\x9e\x6a\x7a\x4a\xe9\x29\xa7\x63\x08\x65\x41\x43\xcd\xf2\x4e\xc7\x41\xb8\xa4\x91\xe7\x5d\x82\xaa\xea\x7c\x63\xa5\xf9\x33\x29\x37\x79\xb5\x66\xac\x3d\xe6\x0f\xea\x78\xd7\xed\x1b\xe0\xf6\x42\x3f\x09\x09\x59\x7f\xb3\x2d\x81\x83\xc7\x57\xf4\x95\x2c\xf2\x6d\xbf\x58\xe5\xdc\x4f\xf9\x4a\x08\x68\xdb\x10\x32\x9a\xf6\x06\x70\xf6\x23\x69\xda\x65\x5e\x57\x7f\xcf\x7b\x41\xd0\x79\xf0\x33\xd9\x54\x6d\xdb\x30\x6e\xcf\xf0\x91\xd0\xd0\x33\xae\x87\x52\xde\x12\x16\x82\x5a\x38\x67\x53\x2d\x5b\x41\x23\x67\x9e\xe1\x17\xd7\xc2\x79\xd7\x4d\xfb\x51\x33\x5e\xf0\xe7\xa0\x28\x75\x42\x73\xe3\xf6\xf3\x9a\x10\xaf\xb9\x67\xf8\x11\x01\x74\x49\x5e\x6c\x08\x95\xdb\xbc\x2e\x19\x47\xc7\xfc\x8b\xf0\x42\xbf\x92\x7c\xb1\x68\x76\x75\x9f\x75\x65\xdf\x57\xf5\x92\x91\x7d\x2c\x49\xe9\xa5\x26\x25\x41\x9e\x4b\xbb\x69\x76\x6e\x3a\x29\xfd\xaf\xf4\x33\xbd\x90\x9f\x92\x17\x14\x42\xa6\x2b\xc9\x23\xe9\xb2\xeb\xb2\x2c\x64\x2c\x5d\xfa\x82\xbe\x93\xed\x6e\xbd\x26\xac\xfd\xbe\x2b\xbb\x9e\x0b\x5d\xd0\x6f\x1a\xbf\xfc\x4e\xaa\xae\xa3\x0f\x4a\x7e\x8d\x8f\x84\xa6\xae\x5e\x60\x30\x27\xf8\x48\x92\xf7\x5d\x99\xb7\x8b\xd5\x87\x44\xfe\xa2\xaf\xfc\xc1\xb4\x77\x68\x52\x99\x90\x94\x88\xa4\x05\x6b\x20\x59\x34\x05\xff\x38\xa1\x3f\x54\x75\x55\x77\x7d\xbe\x5e\x7f\x48\xf4\x83\xc1\xe4\x4b\x26\xa0\xaf\x7a\x60\x41\x13\xd3\xcb\xbe\xdc\x76\x3c\x83\xe9\x8b\xaa\xed\xfa\xc7\x7d\x45\xc4\xfa\x6e\x57\x27\x45\xb3\xf8\x48\xcb\x80\x97\x34\x5a\x7e\x7d\x9d\x12\xb2\x1e\xd0\x42\x68\x77\x75\x4d\xe8\x49\x5f\x36\x84\x32\x6a\xa6\xa2\xf6\x4f\x01\x7d\x94\x6e\xd7\x65\xde\x11\x48\x99\x17\xe9\x8f\x79\xda\xe7\xed\xb2\xec\x9f\xde\xcb\xe6\xb4\xfc\x3e\xde\x4b\x57\x6d\x79\xfd\xf4\xde\xfd\xee\xde\xb3\x97\x3b\x2a\xb6\xae\xea\xb2\xfb\xf1\x49\xfe\x2c\x5d\xe4\x94\x43\x68\xbc\x49\xe7\xe5\x35\xaf\x36\x6a\x2b\x25\x2a\xaf\x97\xbc\xd2\x6e\xfa\x15\x37\x48\x94\x40\x1f\x5d\xca\x4b\xfd\x9b\x84\x27\x80\x58\x41\x56\xcc\x8d\xad\xa1\x43\x48\x6e\x69\x02\xce\x6e\x2e\xff\xfc\xe6\x28\xbd\x20\xde\xb6\x6c\x4b\x7c\xd3\x7f\x54\xe2\xfb\x94\x46\x7b\x55\x9d\x3e\x9f\x25\x54\xd6\x10\x72\x9a\xf7\xf9\x9c\xfb\xee\x66\x9f\x33\x65\x11\xba\x3c\x2c\x45\xe6\x96\xe0\x8c\x5d\x1f\x4d\xcb\xd4\x42\xa6\x3a\x74\xf9\xbb\x3a\xde\x32\x0f\xa0\x74\x87\xd9\x0b\xc1\x19\x55\x95\xbe\x7e\xfb\xf6\xfc\xf4\x79\x5a\xd6\x4b\xc2\x4c\xba\xaf\xfa\x55\xba\xeb\xaf\xff\x6b\xb6\x2c\xeb\xb2\xcd\xd7\xd9\xa2\x62\xa4\xb4\x44\xb0\x29\x61\x49\x86\x38\x4b\xba\x6e\x4d\x2c\x0a\x54\x70\x79\xf9\x26\x3d\x63\x4a\xd8\xe6\xfd\x0a\x1d\xe9\x57\x49\xf7\xfb\x9a\x11\xe5\x1a\xbc\x5a\x95\x29\x16\x03\x80\x9a\xeb\x21\x5e\xd2\x42\xfb\x3a\x4b\xca\xb6\xcd\x88\x83\xf6\x37\x8c\x66\xad\xf3\x10\xb4\x54\x47\xd4\x5e\x37\x3d\x4d\x63\x8a\x72\x52\x45\x55\x7f\xca\xd7\x55\x41\xc8\xf6\x08\x89\xcb\x22\xb1\x68\x68\xde\xb8\x34\x51\x66\xb3\xc7\x50\xf3\x05\x6d\x00\x5d\x7a\x6f\x76\x0f\x1c\xf7\xde\xe3\x7b\xb3\xa4\x6e\x32\xe1\x12\xcc\x9b\x8b\xaa\xcb\xe7\xc4\xa7\x65\xdf\x68\x8d\xeb\xfd\x95\xe9\x47\xba\xa2\x10\x69\x04\xc1\xb8\xe5\xbd\x08\x5b\x00\x13\x57\x4e\x0c\x1b\xcc\x46\xd9\x4c\x38\x76\xe3\x49\x6e\x7e\x85\x2d\xb9\x84\xd1\x98\x13\x9b\x30\xa3\xae\xe3\xed\x76\x5d\x2d\xa4\xe9\x97\x92\xe7\x09\x8d\x77\x66\x45\x4a\x08\x07\x42\xb1\xbc\x80\x5c\xa8\xd7\xcc\xb6\xd2\x88\xcf\xa3\xfc\xaa\xa4\x95\xb3\xda\x2d\x65\x77\x5a\x37\xbb\xe2\x1b\x30\x14\x9b\x39\xcf\x4f\xd2\x77\x0d\x75\x18\xd4\xe1\x00\x7c\x13\xc7\xc4\x18\x58\x18\x68\xcb\x4d\xd3\x33\xe2\xb4\x58\x45\xd3\xb3\xaf\x28\x93\x46\xda\xe5\x9f\x88\x2d\xf6\x8d\x2c\xc9\x82\x96\xdc\x82\x2b\x26\x0e\xb6\xa3\x1d\x5d\x96\x05\xf1\x11\x59\x1a\x96\x16\xd3\x20\xa0\x36\x3b\x5a\x4d\x2b\xaa\x8c\x11\xcf\x12\x09\x55\x39\xd5\x4f\x0c\x89\xea\xc1\x2a\xa7\x95\xdb\xd0\xe6\xc9\x13\x7d\x8a\x0f\xfd\x1d\xd6\x4f\xbd\xca\xaf\xaf\xa9\x57\x1d\xad\x8a\x57\xe9\x62\xdd\xd0\x92\xfa\xe5\xdd\x9b\x8e\x17\xcc\x2a\xdb\x36\x2d\x24\x11\xca\xba\xa0\x4f\x97\x16\x20\x9a\x21\xea\xdd\x66\x4e\xbf\xf6\xab\x8a\x18\x35\xd0\xce\x25\x58\x4a\xa2\x54\x6a\x62\xd7\xd1\x14\x1e\xaLine truncated
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xbc\xbd\xeb\x72\xdc\x48\xae\x27\xfe\x9d\x4f\xc1\xf6\x84\xc3\xed\x08\xb9\x1c\xdd\x7d\xfe\xff\xdd\xe8\x68\xbb\x57\x96\xda\x97\x73\x2c\x4b\x63\xc9\xd3\x3b\xeb\x70\xb0\x59\x45\xaa\x8a\xe3\x2a\xb2\x9a\x64\xb9\xac\x39\x71\x22\xf6\x01\xf6\x01\x76\x5f\xef\x3c\xc9\x02\x3f\x00\x79\x21\x59\x92\xdd\x33\xb1\xfe\x60\xb1\x32\x91\x37\x24\x12\x89\x44\x02\xc8\x7c\xbb\xcd\x8a\xb2\x5b\xa4\x4f\xd2\xe3\x74\x9b\x57\xf5\xba\xec\xba\xb4\x2b\xd7\xd7\x8f\x56\x4d\xd7\x97\x45\xfa\xa2\xea\xe9\x77\xfb\xa9\x5a\x94\x49\xb2\x6a\x36\x25\x81\xbe\xa4\x3f\x49\x91\x77\xab\x79\x93\xb7\x05\x25\x9c\xda\x77\x52\x7e\xde\xae\x9b\x96\x81\x7e\x91\xaf\x64\x55\xae\xb7\x5c\x86\xfe\x24\x5d\xb5\xac\xb3\xaa\xa6\x9f\x97\xf4\x95\xbe\xaa\x25\xa5\xd9\xf5\x96\x74\xbe\xeb\x25\x6d\xb7\xb5\xa4\x77\xdb\xa4\x2d\x97\x15\xf5\xa6\xa5\xa4\xb7\xfa\x99\xec\xcb\x79\x57\xf5\xdc\xd2\xaf\xf2\x95\x7c\x2a\xdb\xae\x6a\xb8\xf6\xbf\xc8\x57\xb2\xcd\x97\x0c\x70\x41\x7f\x92\xbe\xdc\x6c\xd7\x39\x0a\x5c\xe9\x67\xb2\xce\xeb\xe5\x4e\x60\x5e\xeb\x67\xb2\x68\x4b\xca\xca\xea\x72\x4f\xa9\x27\xf8\x31\x9b\xcd\x92\x1d\x21\x21\xdb\xb6\xcd\x75\xb5\x2e\xb3\xbc\x2e\xb2\x8d\x0c\xf3\x1d\xa5\xa7\x9a\x9e\x52\x7a\xca\xe9\x18\x42\x59\xd0\x50\xb3\xbc\xd3\x71\x10\x2e\x69\xe4\x79\x97\xa0\xaa\x3a\xdf\x58\x69\xfe\x4c\xca\x4d\x5e\xad\x19\x6b\x8f\xf8\x83\x3a\xde\x75\xfb\x06\xb8\xbd\xd0\x4f\x42\x42\xd6\xdf\x6c\x4b\xe0\xe0\xd1\x15\x7d\x25\x8b\x7c\xdb\x2f\x56\x39\xf7\x53\xbe\x12\x02\xda\x36\x84\x8c\xa6\xbd\x01\x9c\xfd\x48\x9a\x76\x99\xd7\xd5\xdf\xf3\x5e\x10\x74\x1e\xfc\x4c\x36\x55\xdb\x36\x8c\xdb\x33\x7c\x24\x34\xf4\x8c\xeb\xa1\x94\x37\x84\x85\xa0\x16\xce\xd9\x54\xcb\x56\xd0\xc8\x99\x67\xf8\xc5\xb5\x70\xde\x75\xd3\x7e\xd4\x8c\xe7\xfc\x39\x28\x4a\x9d\xd0\xdc\xb8\xfd\xbc\x26\xc4\x6b\xee\x19\x7e\x44\x00\x5d\x92\x17\x1b\x42\xe5\x36\xaf\x4b\xc6\xd1\x31\xff\x22\xbc\xd0\xaf\x24\x5f\x2c\x9a\x5d\xdd\x67\x5d\xd9\xf7\x55\xbd\x64\x64\x1f\x4b\x52\x7a\xa9\x49\x49\x90\xe7\xd2\x6e\x9a\x9d\x9b\x4e\x4a\xff\x2b\xfd\x4c\x2f\xe4\xa7\xe4\x05\x85\x90\xe9\x4a\xf2\x48\xba\xec\xba\x2c\x0b\x19\x4b\x97\x3e\xa7\xef\x64\xbb\x5b\xaf\x09\x6b\xbf\xef\xca\xae\xe7\x42\x17\xf4\x9b\xc6\x2f\xbf\x93\xaa\xeb\xe8\x83\x92\x5f\xe1\x23\xa1\xa9\xab\x17\x18\xcc\x09\x3e\x92\xe4\x7d\x57\xe6\xed\x62\xf5\x21\x91\xbf\xe8\x2b\x7f\x30\xed\x1d\x9a\x54\x26\x24\x25\x22\x69\xc1\x1a\x48\x16\x4d\xc1\x3f\x4e\xe8\x0f\x55\x5d\xd5\x5d\x9f\xaf\xd7\x1f\x12\xfd\x60\x30\xf9\x92\x09\xe8\xab\x1e\x58\xd0\xc4\xf4\xb2\x2f\xb7\x1d\xcf\x60\xfa\xbc\x6a\xbb\xfe\x51\x5f\x11\xb1\xbe\xdd\xd5\x49\xd1\x2c\x3e\xd2\x32\xe0\x25\x8d\x96\x5f\x5d\xa7\x84\xac\x07\xb4\x10\xda\x5d\x5d\x13\x7a\xd2\x17\x0d\xa1\x8c\x9a\xa9\xa8\xfd\x53\x40\x1f\xa5\xdb\x75\x99\x77\x04\x52\xe6\x45\xfa\x53\x9e\xf6\x79\xbb\x2c\xfb\x27\xf7\xb2\x39\x2d\xbf\x8f\xf7\xd2\x55\x5b\x5e\x3f\xb9\x77\xbf\xbb\xf7\xf4\xc5\x8e\x8a\xad\xab\xba\xec\x7e\x7a\x9c\x3f\x4d\x17\x39\xe5\x10\x1a\x6f\xd2\x79\x79\xcd\xab\x8d\xda\x4a\x89\xca\xeb\x25\xaf\xb4\x9b\x7e\xc5\x0d\x12\x25\xd0\x47\x97\xf2\x52\xff\x26\xe1\x09\x20\x56\x90\x15\x73\x63\x6b\xe8\x10\x92\x5b\x9a\x80\xb3\x9b\xcb\x3f\xbf\x3e\x4a\x2f\x88\xb7\x2d\xdb\x12\xdf\xf4\x1f\x95\xf8\x21\xa5\xd1\x5e\x55\xa7\xcf\x66\x09\x95\x35\x84\x9c\xe6\x7d\x3e\xe7\xbe\xbb\xd9\xe7\x4c\x59\x84\x2e\x0f\x4b\x91\xb9\x25\x38\x63\xd7\x47\xd3\x32\xb5\x90\xa9\x0e\x5d\xfe\xae\x8e\x37\xcc\x03\x28\xdd\x61\xf6\x42\x70\x46\x55\xa5\xaf\xde\xbc\x39\x3f\x7d\x96\x96\xf5\x92\x30\x93\xee\xab\x7e\x95\xee\xfa\xeb\xff\x9a\x2d\xcb\xba\x6c\xf3\x75\xb6\xa8\x18\x29\x2d\x11\x6c\x4a\x58\x92\x21\xce\x92\xae\x5b\x13\x8b\x02\x15\x5c\x5e\xbe\x4e\xcf\x98\x12\xb6\x79\xbf\x42\x47\xfa\x55\xd2\xfd\xbe\x66\x44\xb9\x06\xaf\x56\x65\x8a\xc5\x00\xa0\xe6\x7a\x88\x97\xb4\xd0\xbe\xce\x92\xb2\x6d\x33\xe2\xa0\xfd\x0d\xa3\x59\xeb\x3c\x04\x2d\xd5\x11\xb5\xd7\x4d\x4f\xd3\x98\xa2\x9c\x54\x51\xd5\x9f\xf2\x75\x55\x10\xb2\x3d\x42\xe2\xb2\x48\x2c\x1a\x9a\x37\x2e\x4d\x94\xd9\xec\x31\xd4\x7c\x41\x1b\x40\x97\xde\x9b\xdd\x03\xc7\xbd\xf7\xe8\xde\x2c\xa9\x9b\x4c\xb8\x04\xf3\xe6\xa2\xea\xf2\x39\xf1\x69\xd9\x37\x5a\xe3\x7a\x7f\x65\xfa\x91\xae\x28\x44\x1a\x41\x30\x6e\x79\x2f\xc2\x16\xc0\xc4\x95\x13\xc3\x06\xb3\x51\x36\x13\x8e\xdd\x78\x92\x9b\x5f\x61\x4b\x2e\x61\x34\xe6\xc4\x26\xcc\xa8\xeb\x78\xbb\x5d\x57\x0b\x69\xfa\x85\xe4\x79\x42\xe3\x9d\x59\x91\x12\xc2\x81\x50\x2c\x2f\x20\x17\xea\x35\xb3\xad\x34\xe2\xf3\x28\xbf\x2a\x69\xe5\xac\x76\x4b\xd9\x9d\xd6\xcd\xae\xf8\x06\x0c\xc5\x66\xce\xf3\x93\xf4\x6d\x43\x1d\x06\x75\x38\x00\xdf\xc4\x31\x31\x06\x16\x06\xda\x72\xd3\xf4\x8c\x38\x2d\x56\xd1\xf4\xec\x2b\xca\xa4\x91\x76\xf9\x27\x62\x8b\x7d\x23\x4b\xb2\xa0\x25\xb7\xe0\x8a\x89\x83\xed\x68\x47\x97\x65\x41\x7c\x44\x96\x86\xa5\xc5\x34\x08\xa8\xcd\x8e\x56\xd3\x8a\x2a\x63\xc4\xb3\x44\x42\x55\x4e\xf5\x13\x43\xa2\x7a\xb0\xca\x69\xe5\x36\xb4\x79\xf2\x44\x9f\xe2\x43\x7f\x87\xf5\x53\xaf\xf2\xeb\x6b\xea\x55\x47\xab\xe2\x65\xba\x58\x37\xb4\xa4\xde\xbd\x7d\xdd\xf1\x82\x59\x65\xdb\xa6\x85\x24\x42\x59\x17\xf4\xe9\xd2\x02\x44\x33\x44\xbd\xdb\xcc\xe9\xd7\x7e\x55\x11\xa3\x06\xda\xb9\x04\x4b\x49\x94\x4a\x4d\xec\x3a\x9a\xc2\xa3\x9Line truncated
func confLocaleLocale_enUsIniBytes() ([]byte, error) {
return bindataRead(
@@ -4379,7 +4379,7 @@ func confLocaleLocale_enUsIni() (*asset, error) {
return nil, err
}
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 46176, mode: os.FileMode(420), modTime: time.Unix(1448605845, 0)}
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 46231, mode: os.FileMode(420), modTime: time.Unix(1448608455, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
+54 -7
View File
@@ -7,6 +7,7 @@ package repo
import (
"io/ioutil"
"strings"
"time"
"github.com/gogits/git-shell"
@@ -20,11 +21,13 @@ const (
WIKI_START base.TplName = "repo/wiki/start"
WIKI_VIEW base.TplName = "repo/wiki/view"
WIKI_NEW base.TplName = "repo/wiki/new"
WIKI_PAGES base.TplName = "repo/wiki/pages"
)
type PageMeta struct {
Name string
URL string
Name string
URL string
Updated time.Time
}
func renderWikiPage(ctx *middleware.Context, isViewPage bool) (*git.Repository, string) {
@@ -46,12 +49,14 @@ func renderWikiPage(ctx *middleware.Context, isViewPage bool) (*git.Repository,
ctx.Handle(500, "ListEntries", err)
return nil, ""
}
pages := make([]PageMeta, len(entries))
pages := make([]PageMeta, 0, len(entries))
for i := range entries {
name := strings.TrimSuffix(entries[i].Name(), ".md")
pages[i] = PageMeta{
Name: name,
URL: models.ToWikiPageURL(name),
if entries[i].Type == git.OBJECT_BLOB {
name := strings.TrimSuffix(entries[i].Name(), ".md")
pages = append(pages, PageMeta{
Name: name,
URL: models.ToWikiPageURL(name),
})
}
}
ctx.Data["Pages"] = pages
@@ -123,7 +128,49 @@ func Wiki(ctx *middleware.Context) {
}
func WikiPages(ctx *middleware.Context) {
ctx.Data["Title"] = ctx.Tr("repo.wiki.pages")
ctx.Data["PageIsWiki"] = true
if !ctx.Repo.Repository.HasWiki() {
ctx.Redirect(ctx.Repo.RepoLink + "/wiki")
return
}
wikiRepo, err := git.OpenRepository(ctx.Repo.Repository.WikiPath())
if err != nil {
ctx.Handle(500, "OpenRepository", err)
return
}
commit, err := wikiRepo.GetCommitOfBranch("master")
if err != nil {
ctx.Handle(500, "GetCommitOfBranch", err)
return
}
entries, err := commit.ListEntries()
if err != nil {
ctx.Handle(500, "ListEntries", err)
return
}
pages := make([]PageMeta, 0, len(entries))
for i := range entries {
if entries[i].Type == git.OBJECT_BLOB {
c, err := wikiRepo.GetCommitByPath(entries[i].Name())
if err != nil {
ctx.Handle(500, "GetCommit", err)
return
}
name := strings.TrimSuffix(entries[i].Name(), ".md")
pages = append(pages, PageMeta{
Name: name,
URL: models.ToWikiPageURL(name),
Updated: c.Author.When,
})
}
}
ctx.Data["Pages"] = pages
ctx.HTML(200, WIKI_PAGES)
}
func NewWiki(ctx *middleware.Context) {
+28
View File
@@ -0,0 +1,28 @@
{{template "base/head" .}}
<div class="repository wiki pages">
{{template "repo/header" .}}
<div class="ui container">
{{template "repo/sidebar" .}}
<div class="ui header">
{{.i18n.Tr "repo.wiki.pages"}}
<div class="ui right">
<a class="ui green small button" href="{{.RepoLink}}/wiki/_new">{{.i18n.Tr "repo.wiki.new_page_button"}}</a>
</div>
</div>
<table class="ui table">
<tbody>
{{range .Pages}}
<tr>
<td>
<i class="icon octicon octicon-file-text"></i>
<a href="{{$.RepoLink}}/wiki/{{.URL}}">{{.Name}}</a>
</td>
{{$timeSince := TimeSince .Updated $.Lang}}
<td class="text right grey">{{$.i18n.Tr "repo.wiki.last_updated" $timeSince | Safe}}</td>
</tr>
{{end}}
</tbody>
</table>
</div>
</div>
{{template "base/footer" .}}