-
Notifications
You must be signed in to change notification settings - Fork 3
Issues 78-80, 25 #81
base: master
Are you sure you want to change the base?
Issues 78-80, 25 #81
Conversation
…club-logo' on line 19 of master.xhtml.
…e not configured show up
acmwebsite/templates/archives.xhtml
Outdated
@@ -5,7 +5,7 @@ | |||
<py:extends href="master.xhtml" /> | |||
|
|||
<head py:block="head" py:strip="True"> | |||
<title>Mines ACM - Mailing List Archives</title> | |||
<title>${tg.config.get('short_site_name', 'not configured')} - Mailing List Archives</title> |
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.
Default value should be in config/app_config.py
and have a default of "Mozzarella".
acmwebsite/templates/contact.xhtml
Outdated
@@ -1,6 +1,6 @@ | |||
<html py:extends="master.xhtml" py:strip="True"> | |||
<head py:block="head" py:strip="True"> | |||
<title>Mines ACM - Contact</title> | |||
<title>${tg.config.get('short_site_name', 'not configured')} - Contact</title> |
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.
same
acmwebsite/templates/error.xhtml
Outdated
@@ -1,6 +1,6 @@ | |||
<html py:extends="master.xhtml" py:strip="True"> | |||
<head py:block="head" py:strip="True"> | |||
<title>Mines ACM - Error</title> | |||
<title>${tg.config.get('short_site_name', 'not configured')} - Error</title> |
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.
same
acmwebsite/templates/index.xhtml
Outdated
@@ -4,7 +4,7 @@ | |||
|
|||
<py:extends href="master.xhtml" /> | |||
<head py:block="head" py:strip="True"> | |||
<title>Mines ACM</title> | |||
<title>${tg.config.get('short_site_name', 'not configured')}</title> |
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.
same
acmwebsite/templates/index.xhtml
Outdated
@@ -16,7 +16,7 @@ | |||
</div> | |||
<div class="col-md-5"> | |||
<div class="intro-block"> | |||
<h2>Mines ACM Student Chapter</h2> | |||
<h2>${tg.config.get('site_name', 'not configured')}</h2> |
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.
same
acmwebsite/templates/index.xhtml
Outdated
@@ -32,7 +32,7 @@ | |||
<div class="col-md-6"> | |||
<div class="panel panel-default"> | |||
<div class="panel-heading"> | |||
<h3 class="panel-title">Join our ACM Chapter!</h3> | |||
<h3 class="panel-title">Join our ${tg.config.get('site_name', 'not configured')}!</h3> |
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.
same
@@ -4,7 +4,7 @@ | |||
py:extends="master.xhtml"> | |||
|
|||
<head py:block="head" py:strip="True"> | |||
<title>Mines ACM - Survey ${survey_id} Responses</title> | |||
<title>${tg.config.get('short_site_name', 'not configured')} - Survey ${survey_id} Responses</title> |
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.
same
development.ini.sample
Outdated
@@ -46,6 +46,10 @@ port = 8080 | |||
[app:main] | |||
use = egg:acm-website | |||
|
|||
# Set site name and short site name | |||
#site_name = | |||
#short_site_name = |
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.
use a key like site.name
and site.short_name
.
It is not clear what the purpose of name vs short name is. Please document or just use one.
Also, document the behavior when only one is specified.
development.ini.sample
Outdated
@@ -135,6 +139,11 @@ meetings.timezone = America/Denver | |||
meetings.default_duration = 7200 | |||
meetings.icalendar.prodid = -//Mines ACM//web//EN | |||
|
|||
# Custom Assets Configuration | |||
custom_assets.dir = /home/lpetty/mozzarella/assets |
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.
should be commented out by default, as this directory definately wont exist for anyone but you.
README.rst
Outdated
Static Assets | ||
~~~~~~~~~~~~~ | ||
|
||
The location of site-specific assets for development can be configured in ``development.ini``: |
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.
The site configuration might not be named development.ini
.
acmwebsite/templates/master.xhtml
Outdated
</head> | ||
|
||
<body> | ||
<!-- Navbar --> | ||
<div class="container"> | ||
<div class="header-logo"> | ||
<a href="${tg.url('/')}"> | ||
<img src="${tg.url('/img/full.svg')}" alt="Mines ACM" class="acm-logo" /> | ||
<img src="${tg.url(tg.config.get('custom_assets.logo'))}" alt="Club Logo" class="club-logo" /> |
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.
What's the default when no logo was specified? Can the site name be inserted instead?
Should be up to par now |
development.ini.sample
Outdated
@@ -135,6 +138,11 @@ meetings.timezone = America/Denver | |||
meetings.default_duration = 7200 | |||
meetings.icalendar.prodid = -//Mines ACM//web//EN | |||
|
|||
# Custom Assets Configuration | |||
custom_assets.dir = / |
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.
It's a VERY bad idea to set the root of the filesystem as the custom assets dir, I would not reccomend this in the sample development.ini.
Try visiting /etc/passwd
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.
Just use site.custom_assets
for this name
development.ini.sample
Outdated
@@ -13,6 +13,9 @@ | |||
# execute malicious code after an exception is raised. | |||
debug = true | |||
|
|||
# Site name configuration | |||
#site.name = CSM Mozzarella |
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.
Just "Mozzarella"
development.ini.sample
Outdated
# Custom Assets Configuration | ||
custom_assets.dir = / | ||
custom_assets.css = custom.css | ||
custom_assets.logo = custom.png |
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.
I think it's a good idea to just have the paths be equivalent to the logos under public, rather than configuring the file name. This allows the sysadmin the guaruntee that the only overridden assets will have the same paths as the public directory.
So these keys should not be necessary.
acmwebsite/templates/master.xhtml
Outdated
</head> | ||
|
||
<body> | ||
<!-- Navbar --> | ||
<div class="container"> | ||
<div class="header-logo"> | ||
<a href="${tg.url('/')}"> | ||
<img src="${tg.url('/img/full.svg')}" alt="Mines ACM" class="acm-logo" /> | ||
<img src="${tg.url(tg.config.get('custom_assets.logo', 'logo.jpg'))}" alt="${tg.config.get('site.name')}" class="club-logo" /> |
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.
See below comments, this will need changed.
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.
Just use the CSS class "logo". Also make sure to change the css class if you adjust this. BOTH sides need adjusted.
…emoved the configuration for css and logo.
Links to pages on the wiki should substitute spaces for %20 or the docutils publisher will strip the spaces and make the link invalid.
seems to align better
Now includes changes per #25, minus access control for certain pages and a web-based editor |
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.
Overall looks good. The wiki controller needs converted to OO style Page and Pages controllers. I can do if you do not have time.
I will also pull and test soon ... On mobile now.
acmwebsite/controllers/wiki.py
Outdated
|
||
def _init_wiki_repo(self): | ||
self.repo = init_repository(tg.config.get('wiki.repo'), True) | ||
signature = Signature("Example McPersonson", "[email protected]") #TODO: Replace me |
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.
Explain?
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.
Explain what - the TODO?
If so - I just mean that this Signature can be replaced if need be, though it is only used for the inital commit. Presumably page commits using the web editor (once implemented) will pull signature details from the logged in profile.
acmwebsite/controllers/wiki.py
Outdated
try: | ||
repo_path = tg.config.get('wiki.repo') | ||
if not repo_path: | ||
tg.abort(400, "Wiki not enabled") |
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.
404
acmwebsite/controllers/wiki.py
Outdated
from docutils.core import publish_parts | ||
|
||
import os | ||
import tg |
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.
Import modules before from import
acmwebsite/controllers/wiki.py
Outdated
return dict(pagename=pagename, parts=document) | ||
|
||
@expose('acmwebsite.templates.wiki_history') | ||
def history(self, pagename): |
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.
Can we do in OO-manner like user profile controller?
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.
See f30995d - I attempted to follow the style of the user controller but it still seems a little dirty to me. Let me know what you think.
I moved the repo check/initialization logic from WikiController to WikiPagesController, but I had to change _before to init as it seems WikiPagesController wasn't calling _before like WikiController did.
</head> | ||
|
||
<body> | ||
<!-- Navbar --> | ||
<div class="container"> | ||
<div class="header-logo"> | ||
<a href="${tg.url('/')}"> | ||
<img src="${tg.url('/img/full.svg')}" alt="Mines ACM" class="acm-logo" /> |
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
</py:def> | ||
|
||
|
||
<h1 class="page-header">History: <a href="${tg.url('/wiki/%s' % page)}">$page</a></h1> |
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.
Do not use oldstyle string formatting
acmwebsite/templates/wiki_view.xhtml
Outdated
<nav class="navbar navbar-default"> | ||
<ul class="nav navbar-nav"> | ||
<li class="nav-item"> | ||
<a class="nav-link" href="${tg.url('/wiki/history/%s' % pagename)}">History</a> |
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.
Old style string formatting
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.
How would you recommend formatting these URLs instead? I tried just doing '/wiki/history/$pagename' put that seemed to mangle the URL pretty bad.
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.
This is now fixed - wiki pages now follow the example from other controllers of using '[url]/{}'.format(var)
|
||
.. FIXME this still resolves to a local url | ||
.. _reStructuredText format: <http://docutils.sourceforge.net/rst.html> | ||
|
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.
Is this FIXME resolved?
Programming for field session actually ended this past Friday, but I'm willing to see this PR through. |
…k on wiki FrontPage fixed
Seems like page history is now at /wiki/[pagename]/history |
Requested changes implemented in Field_Session
Changes: