← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~timojbo/widelands-website/new-help into lp:widelands-website

 

Timo Paulssen has proposed merging lp:~timojbo/widelands-website/new-help into lp:widelands-website.

Requested reviews:
  Widelands Developers (widelands-dev)


added backlinks to overviews, try harder to find help strings upon update_help and add a table of buildings that need a ware to be built.
-- 
https://code.launchpad.net/~timojbo/widelands-website/new-help/+merge/40257
Your team Widelands Developers is requested to review the proposed merge of lp:~timojbo/widelands-website/new-help into lp:widelands-website.
=== modified file 'online_help/management/commands/update_help.py'
--- online_help/management/commands/update_help.py	2010-11-01 21:45:54 +0000
+++ online_help/management/commands/update_help.py	2010-11-06 18:42:49 +0000
@@ -190,6 +190,11 @@
             if building._conf.has_option("global","help"):
                 helpstr = normalize_name(building._conf.get("global","help"))
                 b.help = helpstr
+            else:
+                try:
+                    helpstr = [worker.help for worker in b.workers.all()][0]
+                except IndexError:
+                    print "could not find a help string for %s (%s) anywhere!" % (b.name, self._tribe.name)
 
             # See if there is any inputs field around
             if isinstance(building, ProductionSite):

=== modified file 'online_help/templates/building_details.html'
--- online_help/templates/building_details.html	2010-11-01 17:52:47 +0000
+++ online_help/templates/building_details.html	2010-11-06 18:42:49 +0000
@@ -13,4 +13,6 @@
 {{ building.imagemap|safe }}
 </center>
 
+Return to the <a href="../">Building overview/<a>.
+
 {% endblock %}

=== modified file 'online_help/templates/ware_details.html'
--- online_help/templates/ware_details.html	2010-11-01 17:52:47 +0000
+++ online_help/templates/ware_details.html	2010-11-06 18:42:49 +0000
@@ -8,9 +8,31 @@
 
 
 <center>
-<img src="{{ ware.graph_url }}" usemap="#G" alt="Graph for {{ ware.name }}" />
+<img src="{{ ware.graph_url }}" usemap="#G" alt="Graph for {{ ware.displayname }}" />
 
 {{ ware.imagemap|safe }}
 </center>
 
+{% if ware.build_ware_for_buildings.all %}
+<h2>Used for building</h2>
+<table style="width:100%" class="building">
+    <tr>
+        <th>Building</th>
+        <th>Name</th>
+        <th>Description</th>
+    </tr>
+    {% for b in ware.build_ware_for_buildings.all %}
+    <tr class="odd">
+        <td><img src="{{ b.image_url }}" alt="{{b.displayname}}" /></td>
+        <td>{{ b.displayname }}</td>
+        <td>{{ b.help }}</td>
+    </tr>
+    {% endfor %}
+</table>
+{% else %}
+Not used for building.<br />
+{% endif %}
+
+Return to the <a href="../">Ware overview</a>.
+
 {% endblock %}

=== modified file 'online_help/templates/worker_details.html'
--- online_help/templates/worker_details.html	2010-11-01 18:59:39 +0000
+++ online_help/templates/worker_details.html	2010-11-06 18:42:49 +0000
@@ -13,4 +13,6 @@
 {{ worker.imagemap|safe }}
 </center>
 
+Return to the <a href="../">Worker overview</a>.
+
 {% endblock %}

=== modified file 'online_help/views.py'
--- online_help/views.py	2010-11-01 19:02:28 +0000
+++ online_help/views.py	2010-11-06 18:42:49 +0000
@@ -3,8 +3,6 @@
 from django.http import HttpResponse
 from .models import Worker, Ware, Building, Tribe
 
-
-import pydot
 from settings import WIDELANDS_SVN_DIR, MEDIA_ROOT
 import os