← 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)


cool stuff (working this time)
-- 
https://code.launchpad.net/~timojbo/widelands-website/new-help/+merge/40258
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 19:38:40 +0000
@@ -188,8 +188,12 @@
                 enhancement_hier.append((b, building.enhancement))
 
             if building._conf.has_option("global","help"):
-                helpstr = normalize_name(building._conf.get("global","help"))
-                b.help = helpstr
+                b.help = normalize_name(building._conf.get("global","help"))
+            else:
+                try:
+                    b.help = [worker.help for worker in b.workers_types.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 19:38:40 +0000
@@ -13,4 +13,6 @@
 {{ building.imagemap|safe }}
 </center>
 
+Return to the <a href="../">Building overview/<a>.
+
 {% endblock %}

=== modified file 'online_help/templates/inlines/display_worker.html'
--- online_help/templates/inlines/display_worker.html	2010-11-01 19:02:28 +0000
+++ online_help/templates/inlines/display_worker.html	2010-11-06 19:38:40 +0000
@@ -4,7 +4,7 @@
 
    <tr class="odd">
       <td><img src="{{ worker.image_url }}"  alt="{{ worker.name }}" /></td>
-      <td><a name="{{ worker.name }}">{{ worker.displayname }}</a></td>
+      <td><a name="{{ worker.name }}" href="{{worker.name}}/">{{ worker.displayname }}</a></td>
       <td>{{ worker.help }}</td> 
    </tr>
 

=== 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 19:38:40 +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><a href="../../buildings/{{b.name}}/">{{ b.displayname }}</a></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 19:38:40 +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 19:38:40 +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
 


Follow ups