Skip to content

Commit d1b0c35

Browse files
committed
Converts python to v5 design
1 parent 8a91b30 commit d1b0c35

File tree

19 files changed

+179
-217
lines changed

19 files changed

+179
-217
lines changed

src/Puphpet/Extension/PythonBundle/Configure.php

-16
This file was deleted.

src/Puphpet/Extension/PythonBundle/Controller/FrontController.php

-35
This file was deleted.

src/Puphpet/Extension/PythonBundle/DependencyInjection/PuphpetExtensionPythonExtension.php

-25
This file was deleted.

src/Puphpet/Extension/PythonBundle/PuphpetExtensionPythonBundle.php

-9
This file was deleted.

src/Puphpet/Extension/PythonBundle/Resources/config/routing.yml

-11
This file was deleted.

src/Puphpet/Extension/PythonBundle/Resources/views/form.html.twig

-66
This file was deleted.

src/Puphpet/Extension/PythonBundle/Resources/views/sections/Version.html.twig

-53
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
namespace Puphpet\MainBundle\Controller;
4+
5+
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6+
7+
class PythonController extends Controller
8+
{
9+
public function indexAction(array $data)
10+
{
11+
return $this->render('PuphpetMainBundle:Python::form.html.twig', [
12+
'python' => $data,
13+
]);
14+
}
15+
16+
public function addVersionAction()
17+
{
18+
return $this->render('PuphpetMainBundle:Python/sections:Version.html.twig', [
19+
'selected_version' => $this->getData()['empty_version'],
20+
'available_versions' => $this->getData()['available_versions'],
21+
]);
22+
}
23+
24+
/**
25+
* @return array
26+
*/
27+
private function getData()
28+
{
29+
$manager = $this->get('puphpet.extension.manager');
30+
return $manager->getExtensionData('python');
31+
}
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
puphpet.python.homepage:
2+
path: /
3+
defaults: { _controller: PuphpetMainBundle:Python:index }
4+
5+
puphpet.python.add_version:
6+
pattern: /add-version
7+
defaults: { _controller: PuphpetMainBundle:Python:addVersion }

src/Puphpet/MainBundle/Resources/config/routing.yml

+3
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,6 @@ puphpet.php:
7777
puphpet.ruby:
7878
resource: "@PuphpetMainBundle/Resources/config/ruby/routing.yml"
7979
prefix: /extension/ruby
80+
puphpet.python:
81+
resource: "@PuphpetMainBundle/Resources/config/python/routing.yml"
82+
prefix: /extension/python

src/Puphpet/MainBundle/Resources/config/services.yml

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ services:
3434
- [ addExtension, [ 'wpcli' ] ]
3535
- [ addExtension, [ 'drush' ] ]
3636
- [ addExtension, [ 'ruby' ] ]
37+
- [ addExtension, [ 'python' ] ]
3738

3839
puphpet.twig.base_extension:
3940
class: Puphpet\MainBundle\Twig\BaseExtension

src/Puphpet/MainBundle/Resources/views/front/sections/language.html.twig

+3
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@
1010
<div class="tab-pane" id="ruby">
1111
{% include 'PuphpetMainBundle:ruby:form.html.twig' with { 'ruby': extensions.ruby.data } %}
1212
</div>
13+
<div class="tab-pane" id="python">
14+
{% include 'PuphpetMainBundle:python:form.html.twig' with { 'python': extensions.python.data } %}
15+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{% set packages = (python.packages is defined) ? python.packages : [] %}
2+
3+
<div class="section-header hidden">
4+
<h1>Python</h1>
5+
<p class="lead">Configure Python versions and packages.</p>
6+
</div>
7+
8+
<div class="form-group">
9+
<span class="help-text">
10+
Pretty slow, but quite pretty!
11+
</span>
12+
<div class="clearfix"><label>Install</label></div>
13+
14+
<label class="col-xs-12 radio-tile">
15+
<input type="checkbox" name="python[install]" value="1"
16+
class="invisible" checked readonly />
17+
<span class="content">
18+
<span class="header large">
19+
<i class="icon"></i>
20+
<span class="title">Install Python</span>
21+
</span>
22+
<span class="footer">
23+
Python 2.6/2.7 comes preinstalled.
24+
</span>
25+
</span>
26+
</label>
27+
28+
<div class="clearfix"></div>
29+
</div>
30+
31+
<div class="clearfix"></div>
32+
33+
<div class="help-block">
34+
<p>Debian and Ubuntu come with <code>Python 2.7</code>,
35+
and CentOS comes with <code>Python 2.6</code> out of the box.</p>
36+
<p>Any extra Python versions you choose will be installed using
37+
<a href="https://github.com/yyuu/pyenv" target="_blank">pyenv</a>
38+
as system installations, <em>not user installations</em>.</p>
39+
<p>All extra Python versions require compiling. Choose sparingly - each
40+
additional version will add extra time to the initial
41+
<code>$ vagrant up</code>!</p>
42+
</div>
43+
44+
<div class="clearfix"></div>
45+
46+
<div class="form-group col-xs-12">
47+
<div class="help-text">
48+
<p>To install a specific package version, use <code>{package}@{version}</code>.</p>
49+
<p>eg: <code>[email protected]</code>. For latest just use <code>{package}</code>.</p>
50+
<p><a href="https://pypi.python.org/pypi"
51+
target="_blank">All valid Packages list</a>.</p>
52+
</div>
53+
<label for="python-packages">Install Packages</label>
54+
<select id="python-packages"
55+
multiple name="python[packages][]"
56+
class="form-control select-tags-editable">
57+
{% for package in packages %}
58+
<option selected value="{{ package }}">{{ package }}</option>
59+
{% endfor %}
60+
</select>
61+
</div>
62+
63+
<div class="clearfix"></div>
64+
65+
{% for selected_version in python.versions %}
66+
{% include 'PuphpetMainBundle:Python/sections:Version.html.twig'
67+
with {'available_versions': python.available_versions, 'selected_version': selected_version} %}
68+
{% endfor %}
69+
70+
<a href="#" data-source-url="{{ path('puphpet.python.add_version') }}"
71+
class="add-block"><i class="fa fa-level-up fa-rotate-90"></i> Add another Python version</a>
72+

0 commit comments

Comments
 (0)