This repository has been archived by the owner on Jan 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Issues 78-80, 25 #81
Open
LeviPetty
wants to merge
76
commits into
master
Choose a base branch
from
Field_Session
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Issues 78-80, 25 #81
Changes from all commits
Commits
Show all changes
76 commits
Select commit
Hold shift + click to select a range
83cb9cc
Added site name and short site name to dev.ini and updated templates …
nklonne 3ad8517
Merge branch 'Field_Session' of https://github.com/ColoradoSchoolOfMi…
69855ec
Image alt and class fixed.
murchison 62b42e1
Set up custom logo loading: Relative path only
652e5b4
Resolved merge conflict by changing alt to 'Club Logo' and class to '…
c450a00
Commented out site_name and short_site_name in development.ini to mak…
nklonne 23a2341
Implemented custom logo loading.
f1f6012
Simplified custom logo loading.
263c1d8
Implemented custom CSS loading
JadElClemens 447f01c
Documented new config options
JadElClemens f9b1b39
Fixed documentation on static assets config
JadElClemens ef1eddb
Really fixed documentation this time
JadElClemens 93220e9
Changes to development.ini items
JadElClemens a788600
Added site name to config defaults
JadElClemens 9c82e5b
Default value for site.name is now Mozzarella.
aae73d2
There is now a default image name for the site logo.
e467d68
Shows site name in place of logo if the file for the logo cannot be f…
140e84c
Site no longer requires custom_assets config options to be set
JadElClemens f2fa2ff
Commented out custom assets directory in development.ini.sample and r…
52a1b9c
Fixed up master.xhtml - no longer uses config-based file locations
JadElClemens 8fe387a
Created basic views and controller for wiki
JadElClemens d644c3e
Added a link to wiki page
eafcdfe
Beginning of wiki functionality
JadElClemens 5135258
Merge branch 'fs-wiki' of https://github.com/ColoradoSchoolOfMines/mo…
JadElClemens 382434a
Added wiki location config to development.ini.sample
JadElClemens c20008e
Wiki now adds .rst extension automatically, properly errors when file…
JadElClemens 302e734
Added example config for site.custom_assets
JadElClemens 11cb19e
Added wiki view template
JadElClemens b3fcb5d
Site now initializes a wiki at the specified location if none exists
JadElClemens 90c2a4f
Removed unnecessary edit and save functions from wiki.py
a282a02
Wiki repository is now bare
JadElClemens fa1681d
Merge branch 'fs-wiki' of https://github.com/ColoradoSchoolOfMines/mo…
JadElClemens d590c31
Wiki now accepts positional parameters in URL (/wiki/[pagename] is va…
JadElClemens 5ed344b
Changed wiki controller and template to be in line with running conve…
JadElClemens 0a4a1d4
Partially implemented parsing.
a4a2d2d
Wiki page now displays in page title
JadElClemens dec0bb1
removed wiki directory
JadElClemens 8651e63
Cleaned up wiki controller code
JadElClemens 870a305
Added a front page to the wiki.
8adc66e
Added to the main page a panel about the wiki.
df096eb
Added info about wiki to README
JadElClemens bf5c080
Further expanded wiki section in README
JadElClemens 20a6590
Created instructions for Wiki contribution.
3ad61a4
Wiki revision history now live at /wiki/history/[pagename]
JadElClemens e988169
Merge branch 'fs-wiki' of https://github.com/ColoradoSchoolOfMines/mo…
JadElClemens d596a6c
Removed wiki dir
JadElClemens c8ea21b
History page now links back to content page
JadElClemens 539698c
Wiki pages now have a 'links' panel, only includes history page for now
JadElClemens f115332
revision history page now shows edits in reverse order
JadElClemens 366f0b9
The folder 'wiki' is now ignored.
81b39f5
Merge branch 'fs-wiki' of https://github.com/ColoradoSchoolOfMines/mo…
3ce08e7
Wiki pages now take their title from the ReST document
JadElClemens c79b3a2
Index now redirects to FrontPage. FrontPage is now copied from filesy…
JadElClemens 41f1ded
Added a skeleton page for the Page List.
9385621
Implemented the Page List. TODO: It only lists the name, it doesn't g…
8ce0381
Slight changes to default wiki frontpage
JadElClemens ee9c098
Merge branch 'fs-wiki' of https://github.com/ColoradoSchoolOfMines/mo…
JadElClemens 0fba5fb
Made wiki pagelist link to pages, files with spaces now supported
JadElClemens a7fc457
Changed page list to use XML templating rather than filling out a ReS…
JadElClemens d030827
Cleaned up wiki controller code
JadElClemens 5b761f7
Fixed the auto-initializing an extra PageList page.
56bb645
Homepage no longer reserves space for banner if banner does not exist
JadElClemens dfd8763
wiki view page no longer uses containers
JadElClemens 72d81e5
Merge branch 'fs-wiki' of https://github.com/ColoradoSchoolOfMines/mo…
JadElClemens 36f5ee8
Removed unnecessary PageList.rst from the wiki-assets directory.
db1c91e
Merge branch 'fs-wiki' of https://github.com/ColoradoSchoolOfMines/mo…
de04840
Merge branch 'fs-wiki' into Field_Session
JadElClemens f1c95ae
Deleted assets dir
JadElClemens 615b2ac
Site configuration values in development.ini.sample are now together.
93a3ba9
Changed acm-logo CSS class to logo
JadElClemens a1141bb
Wiki not enabled now results in a 404, imports fixed up, external lin…
JadElClemens 442381b
Merge branch 'fs-wiki' into Field_Session
JadElClemens a8190ec
Wiki pages no longer use old-style formatting
JadElClemens f30995d
Began implementing wiki controller in OO manner
JadElClemens 31c0537
Change wiki initialization method
jackrosenthal 3f9090c
fixed initialization of wiki controller
jordannewport File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
"""Wiki controller module""" | ||
import os | ||
import tg | ||
import pygit2 as pg | ||
|
||
from tg import expose | ||
|
||
from acmwebsite.lib.base import BaseController | ||
|
||
from pygit2 import Repository,init_repository | ||
from pygit2 import Tree | ||
from pygit2 import Signature | ||
|
||
from docutils.core import publish_parts | ||
|
||
|
||
__all__ = ['WikiController'] | ||
|
||
class WikiController(BaseController): | ||
"""Controls the wiki""" | ||
|
||
def __init__(self, repo, entry): | ||
self.repo = repo | ||
self.entry = entry | ||
|
||
@expose('acmwebsite.templates.wiki_view') | ||
def _default(self): | ||
"""Display a specific page""" | ||
settings = {'initial_header_level': 2, | ||
'file_insertion_enabled': 0, | ||
'raw_enabled': 0, | ||
'disable_config': 1, | ||
} | ||
|
||
blob = self.repo.get(self.entry.id) | ||
document = publish_parts(blob.data, writer_name='html5', settings_overrides=settings) | ||
return dict(pagename=self.entry.name.strip('.rst'), parts=document) | ||
|
||
@expose('acmwebsite.templates.wiki_history') | ||
def history(self): | ||
revision_list = [] | ||
last_id = None | ||
|
||
#Get a list of commits that include the queried file | ||
for commit in self.repo.walk(self.repo.head.target, pg.GIT_SORT_TIME): | ||
if filename in commit.tree: | ||
entry = commit.tree[filename] | ||
if entry.id != last_id: #Only add to history if it file chnaged. | ||
revision_list.append({"author": commit.author, | ||
"time": commit.commit_time, | ||
"message": commit.message}) | ||
last_id = entry.id | ||
|
||
if not revision_list: #No commits include file - possibly faulty? | ||
tg.abort(404, "Page not found") | ||
return dict(page=pagename, revisions=revision_list) | ||
|
||
class WikiPagesController(BaseController): | ||
def __new__(cls, repo_path=None): | ||
if not repo_path: | ||
repo_path = tg.config.get('wiki.repo') | ||
if not repo_path: | ||
return None | ||
|
||
obj = super().__new__(cls) | ||
obj.repo = Repository(repo_path) | ||
return obj | ||
|
||
@expose() | ||
def _lookup(self, pagename=None, *args): | ||
entry = None | ||
if pagename: | ||
tb = self.repo.TreeBuilder(self.repo.head.peel(Tree)) | ||
entry = tb.get(pagename + '.rst') | ||
if not entry: | ||
tg.abort(404, "Page not found") | ||
return WikiController(self.repo, entry), args | ||
|
||
@expose() | ||
def index(self): | ||
tg.redirect('/wiki/FrontPage') | ||
|
||
@expose('acmwebsite.templates.wiki_pagelist') | ||
def pagelist(self): | ||
pages = [entry.name[:-4] for entry in self.repo.head.peel(Tree)] | ||
return dict(pages=pages) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,7 +80,7 @@ | |
} | ||
|
||
/* Logo */ | ||
.acm-logo { | ||
.logo { | ||
margin: 20px 0; | ||
max-width: 400px; | ||
width: 100%; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<html py:strip="" | ||
xmlns:py="http://genshi.edgewall.org/" | ||
xmlns:xi="http://www.w3.org/2001/XInclude"> | ||
|
||
<py:extends href="master.xhtml" /> | ||
|
||
<head py:block="head" py:strip="True"> | ||
<title>${tg.config.get('site.name')} Wiki - $page History</title> | ||
</head> | ||
|
||
<body py:block="body" py:strip="True"> | ||
<py:def function="revision(item)"> | ||
<td> | ||
${item["message"]} | ||
</td> | ||
<td> | ||
${item["author"].name} | ||
</td> | ||
<td> | ||
${item["time"]} | ||
</td> | ||
</py:def> | ||
|
||
|
||
<h1 class="page-header">History: <a href="${tg.url('/wiki/{}'.format(page))}">$page</a></h1> | ||
|
||
<table class="table table-striped"> | ||
<thead> | ||
<tr> | ||
<th>Commit Message</th> | ||
<th>Author</th> | ||
<th>Commit time</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr py:for="entry in revisions">${revision(entry)}</tr> | ||
</tbody> | ||
</table> | ||
</body> | ||
</html> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Careful ... Was css class adjusted as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed acm-logo to logo in style.css