Permalink
Browse files

adding version support to builder

  • Loading branch information...
1 parent 3a36f75 commit ffa97aa1a97715ec14a345c87b4caecd36da16cc @anutron committed Sep 26, 2011
Showing with 65 additions and 63 deletions.
  1. +62 −61 django/src/depender/templates/builder.mako
  2. +3 −2 django/src/depender/views.py
@@ -1,42 +1,43 @@
<%def name="builder(include_mootools=True, include_reset=True)">
<!-- packager -->
-
+
% if include_reset:
- <link rel="stylesheet" type="text/css" media="screen" href="/depender/static/reset.css" />
+ <link rel="stylesheet" type="text/css" media="screen" href="/depender/static/reset.css" />
% endif
- <link rel="stylesheet" type="text/css" media="screen" href="/depender/static/packager.css" />
+ <link rel="stylesheet" type="text/css" media="screen" href="/depender/static/packager.css" />
% if include_mootools:
- <script type="text/javascript" src="/depender/static/mootools-core-1.3.2.js"></script>
+ <script type="text/javascript" src="/depender/static/mootools-core-1.3.2.js"></script>
% endif
- <script type="text/javascript" src="/depender/static/packager.js"></script>
- <script type="text/javascript">document.addEvent('domready', Packager.init);</script>
- <form id="packager" action="/depender/build" method="get" style="margin-top: 10px">
- <input type="hidden" name="download" value="true"/>
+ <script type="text/javascript" src="/depender/static/packager.js"></script>
+ <script type="text/javascript">document.addEvent('domready', Packager.init);</script>
+ <form id="packager" action="/depender/build" method="get" style="margin-top: 10px">
+ <input type="hidden" name="download" value="true"/>
+ <input type="hidden" name="version" value="${version}"/>
% for p in packages:
- <div id="package-${p}" class="package">
-
- <table class="vertical">
- <thead>
- <tr class="first">
- <th>Name</th>
- <td>
+ <div id="package-${p}" class="package">
+
+ <table class="vertical">
+ <thead>
+ <tr class="first">
+ <th>Name</th>
+ <td>
${p}
- <div class="buttons">
- <input type="checkbox" name="excludeLibs" class="toggle" value="${p}"/>
- <div class="enabled">
- <input type="button" class="select" value="select package" />
- <input type="button" class="deselect" value="deselect package" />
- <input type="button" class="disable" value="disable package" />
- </div>
- <div class="disabled">
- <input type="button" class="enable" value="enable package" />
- </div>
- </div>
- </td>
- </tr>
- </thead>
- <tbody>
+ <div class="buttons">
+ <input type="checkbox" name="excludeLibs" class="toggle" value="${p}"/>
+ <div class="enabled">
+ <input type="button" class="select" value="select package" />
+ <input type="button" class="deselect" value="deselect package" />
+ <input type="button" class="disable" value="disable package" />
+ </div>
+ <div class="disabled">
+ <input type="button" class="enable" value="enable package" />
+ </div>
+ </div>
+ </td>
+ </tr>
+ </thead>
+ <tbody>
% for key in ["web", "description", "copyright", "license", "authors"]:
% if key in dpdr.packages[p].metadata:
<%
@@ -45,26 +46,26 @@
klass = "last"
%>
<tr class="${klass}">
- <th>${key.capitalize()}</th>
+ <th>${key.capitalize()}</th>
<td>${markdown(dpdr.packages[p].metadata[key])}</td>
- </tr>
+ </tr>
% endif
% endfor
</tbody>
</table>
-
- <table class="horizontal">
- <tr class="first">
- <th class="first"></th>
- <th class="middle">File</th>
- <th class="middle">Provides</th>
- <th class="last">Description</th>
- </tr>
-
+
+ <table class="horizontal">
+ <tr class="first">
+ <th class="first"></th>
+ <th class="middle">File</th>
+ <th class="middle">Provides</th>
+ <th class="last">Description</th>
+ </tr>
+
% for filedata in sorted(dpdr.packages[p].files, key=lambda file:file.filename):
- <tr class="middle unchecked">
- <td class="first check">
- <div class="checkbox"></div>
+ <tr class="middle unchecked">
+ <td class="first check">
+ <div class="checkbox"></div>
<%
if filedata.metadata.has_key('name'):
name = filedata.metadata['name']
@@ -75,25 +76,25 @@
if filedata.metadata.has_key('description'):
description = filedata.metadata['description']
%>
- <input type="checkbox" name="require" value="${p}/${name}" data-depends="${', '.join(get_depends(p, filedata.filename))}" />
- </td>
- <td class="middle file">${name}</td>
- <td class="middle provides">${', '.join(get_provides(p, filedata.filename))}</td>
- <td class="last description"><p>${description}</p></td>
- </tr>
+ <input type="checkbox" name="require" value="${p}/${name}" data-depends="${', '.join(get_depends(p, filedata.filename))}" />
+ </td>
+ <td class="middle file">${name}</td>
+ <td class="middle provides">${', '.join(get_provides(p, filedata.filename))}</td>
+ <td class="last description"><p>${description}</p></td>
+ </tr>
% endfor
-
-
- </table>
-
- </div>
+
+
+ </table>
+
+ </div>
% endfor
- <p class="submit">
- <input type="reset" value="reset" />
- <input type="submit" value="download" />
- </p>
-
- </form>
+ <p class="submit">
+ <input type="reset" value="reset" />
+ <input type="submit" value="download" />
+ </p>
+
+ </form>
</%def>
@@ -92,7 +92,7 @@ def get_arr(name):
depender = get_depender(reset=reset, version=version)
except Exception, inst:
return HttpResponse("alert('Javascript dependency loader unavailable. Contact your administrator to check server logs for details.\n [" + str(inst).replace("'", "\\'") + "]')")
-
+
if compression is None:
compression = "none"
# TODO: implement compression
@@ -172,7 +172,8 @@ def get_depends(package, filename):
'get_provides': get_provides,
'get_depends': get_depends,
'dpdr': dpdr,
- 'markdown': markdown
+ 'markdown': markdown,
+ 'version': version
}
)

0 comments on commit ffa97aa

Please sign in to comment.