gdd grid; hosting
This commit is contained in:
+58
-2
@@ -26,6 +26,60 @@ def find_year():
|
||||
now = datetime.datetime.now()
|
||||
return now.strftime('%Y')
|
||||
|
||||
def to_table(l, cols):
|
||||
l.sort(key=str.lower)
|
||||
|
||||
# Return it as one row here if the list is too small
|
||||
if len(l) < cols:
|
||||
return [l]
|
||||
|
||||
newlist = []
|
||||
|
||||
|
||||
# Step over every row of the list
|
||||
for i in range(0, len(l), cols):
|
||||
|
||||
# Get the next row of the list
|
||||
sublist = l[i : i + cols]
|
||||
|
||||
# If it's too short, add it to the end of the last row
|
||||
if len(sublist) < cols:
|
||||
newlist[-1] += sublist
|
||||
# Add the next row in the list to the table
|
||||
else:
|
||||
newlist += [sublist]
|
||||
|
||||
return newlist
|
||||
|
||||
def his_to_table(l, cols):
|
||||
|
||||
l.sort(key=str.lower)
|
||||
|
||||
# Return it as one row here if the list is too small
|
||||
if len(l) < cols:
|
||||
return [l]
|
||||
|
||||
newlist = []
|
||||
|
||||
# Step over every row of the list
|
||||
for i in range(0, len(l), cols):
|
||||
|
||||
# Get the next row of the list
|
||||
sublist = l[i : i + cols]
|
||||
|
||||
# If it's too short, add it to the end of the last row
|
||||
if len(sublist) < cols:
|
||||
newlist[-1] += sublist
|
||||
# Add the next row in the list to the table
|
||||
else:
|
||||
newlist += [sublist]
|
||||
|
||||
return newlist
|
||||
|
||||
def get_gdd_topics(topics, cols):
|
||||
return to_table(topics, int(len(topics) / cols))
|
||||
|
||||
|
||||
def find_gallery(name):
|
||||
gal = [name]
|
||||
if name == "Abbey":
|
||||
@@ -446,11 +500,13 @@ def entry(page):
|
||||
TEMPLATE_PATH.insert(0, abs_views_path )
|
||||
return template(os.path.join(abs_views_path,'entry.tpl'), info)
|
||||
|
||||
# Blessfrey Game Design Document Page
|
||||
# Blessfrey Game Design Document Page - change the 5 for more or less columns
|
||||
@route('/blessfrey-gdd')
|
||||
def gddbf():
|
||||
"""Game Design Document"""
|
||||
info = {'css': 'doc', 'title': 'blessfrey gdd', 'year': find_year()}
|
||||
info = {'css': 'doc', 'title': 'blessfrey gdd', 'year': find_year(), 'topics': get_gdd_topics(
|
||||
["achievement", "ai", "armor-rating", "attack-loop", "attribute", "attribute-point", "cast", "character", "collision", "controls", "credits", "damage-type", "death-penalty", "design-philosophy", "dialogue", "docs", "environment-effect", "gear", "gig", "groups", "highlight", "ID", "inspect menu", "inventory", "item", "job", "keyword", "language", "life", "marketing", "mechanics", "Mercur", "milestones", "miracles", "pathfinding", "perk", "pip", "projectile", "proxemics", "punishment", "setting", "skill", "smartphone", "spirit", "status-effect", "story", "style guide", "terms", "vibe", "website", "xp", "xp-bar", "zone"],5
|
||||
)}
|
||||
return template('bf-gdd.tpl', info)
|
||||
@route('/gdd')
|
||||
def gdd():
|
||||
|
||||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 750 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 451 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 167 KiB |
+26
-7
@@ -2,13 +2,32 @@
|
||||
% rebase('frame.tpl')
|
||||
<div class="content-grid"><div class="center">
|
||||
<h1>blessfrey game design document </h1>
|
||||
<p>The vision for Blessfrey <br></p>
|
||||
<br>
|
||||
<ul>
|
||||
<p>The vision for Blessfrey</p>
|
||||
|
||||
% for i in ["achievement", "ai", "armor-rating", "attack-loop", "attribute", "attribute-point", "cast", "character", "collision", "controls", "credits", "damage-type", "death-penalty", "design-philosophy", "dialogue", "docs", "environment-effect", "gear", "gig", "groups", "highlight", "ID", "inspect menu", "inventory", "item", "job", "keyword", "language", "life", "marketing", "mechanics", "Mercur", "milestones", "miracles", "pathfinding", "perk", "pip", "projectile", "proxemics", "punishment", "setting", "skill", "smartphone", "spirit", "status-effect", "story", "style guide", "terms", "vibe", "website", "xp", "xp-bar", "zone"]:
|
||||
|
||||
<li class="list">{{random.choice(['.','•','☆','★'])}}	<a href=/blessfrey-gdd/{{i}}>{{i}}</a></li>
|
||||
<table>
|
||||
% # find longest column, since html tables need to be doled out row by row
|
||||
% longcol = topics[0]
|
||||
% for t in topics:
|
||||
% if len(t) > len(longcol):
|
||||
% longcol = t
|
||||
% end
|
||||
</ul>
|
||||
% end
|
||||
|
||||
|
||||
% # build a table out of an array that looks like [[col1 items],[col2 items],[col3 items]]
|
||||
% i = 0
|
||||
% for k in range(len(longcol)):
|
||||
<tr>
|
||||
% for j in topics:
|
||||
% if len(j) > i:
|
||||
<td><a href=/blessfrey-gdd/{{j[i]}}>{{j[i]}}</a></td>
|
||||
% else:
|
||||
<td></td>
|
||||
% end
|
||||
% end
|
||||
</tr>
|
||||
% i += 1
|
||||
% end
|
||||
</table>
|
||||
|
||||
</div></div>
|
||||
|
||||
Reference in New Issue
Block a user