Skip to content
This repository
Browse code

Styling fixes, started to alter controllers to suite new design.

  • Loading branch information...
commit f287f8519465fb47809ba78115feec285818da9e 1 parent c93caa6
Arun Karunagath kra3 authored
2  py3k/main.py
@@ -32,6 +32,7 @@
32 32 from .application import app
33 33 from .application import db
34 34
  35 +from .captcha import get_captcha_key
35 36 from .model import Distribution
36 37 from .model import Comment
37 38 from .utils import get_status, pretty_date
@@ -70,6 +71,7 @@ def index():
70 71 comments=comments,
71 72 no_comments_packages=no_comments_packages,
72 73 lst_comments=lst_comments,
  74 + captcha_key=get_captcha_key(),
73 75 get_status=get_status,
74 76 time_delta=pretty_date)
75 77
6 py3k/nonpypi.py
@@ -31,7 +31,6 @@
31 31 from sqlalchemy.exc import IntegrityError
32 32
33 33 from .model import Distribution
34   -from .captcha import get_captcha_key
35 34 from .captcha import verify_captcha
36 35
37 36
@@ -81,8 +80,3 @@ def save_new_project():
81 80 db.session.add(distribution)
82 81 db.session.commit()
83 82 return redirect(url_for('packages_details', name=name))
84   -
85   -
86   -@app.route('/nonpypi')
87   -def nonpypipkg():
88   - return render_template('nonpypi_package.html', captcha_key=get_captcha_key())
5 py3k/static/css/style.css
@@ -188,6 +188,7 @@ section#main > article h2{
188 188 }
189 189 section#main > article:first-child{
190 190 background: #f9f9f9;
  191 + overflow:hidden;
191 192 }
192 193 section#main > article:first-child ul#credits{
193 194 list-style:decimal-leading-zero;
@@ -265,6 +266,10 @@ section form p input, section form p textarea{
265 266 }
266 267 section form p textarea{
267 268 width: 305px;
  269 + resize:none; /* for webkit */
  270 +}
  271 +section form p input#cap{
  272 + width:200px;
268 273 }
269 274 section form p input[type="submit"]{
270 275 width: 80px;
BIN  py3k/static/download
Binary file not shown
28 py3k/templates/index.html
@@ -38,3 +38,31 @@
38 38 </li>
39 39 </ul>
40 40 {% endblock %}
  41 +
  42 +{% block newprj %}
  43 + <form action="{{ url_for('save_new_project') }}" method=post>
  44 + <p>
  45 + <label for="prjname">Project Name</label>
  46 + <input id="prjname" name='projectname' placeholder="Project name">
  47 + </p>
  48 + <p>
  49 + <label for="homepg">Homepage</label>
  50 + <input id="homepg" type='url' name='home_page' placeholder="http://">
  51 + </p>
  52 + <p>
  53 + <label for="auth">Authors</label>
  54 + <input id="auth" name='author' placeholder="Author(s)">
  55 + </p>
  56 + <p>
  57 + <label for="summary">Summary</label>
  58 + <textarea id="summary" name='summary' placeholder="Some cool information about your wonderful project..." rows="6" cols="60"></textarea>
  59 + </p>
  60 + <p>
  61 + <label for="cap">Enter the letters here:</label>
  62 + <input id="cap" name='captchavalue'>
  63 + <img src="{{ url_for('captcha', key=captcha_key) }}" />
  64 + </p>
  65 + <input type=hidden name=captchakey value={{ captcha_key }}>
  66 + <p><input value="Submit" type="submit"></p>
  67 + </form>
  68 +{% endblock %}
30 py3k/templates/layout.html
@@ -69,31 +69,11 @@
69 69 Download <span>Python3</span></a>
70 70 </p>
71 71 </section>
72   - <section><form action="{{ url_for('save_new_project') }}" method=post>
73   - <p>
74   - <label for="prjname">Project Name</label>
75   - <input id="prjname" name='projectname' placeholder="Project name">
76   - </p>
77   - <p>
78   - <label for="homepg">Homepage</label>
79   - <input id="homepg" type='url' name='home_page' placeholder="http://">
80   - </p>
81   - <p>
82   - <label for="auth">Authors</label>
83   - <input id="auth" name='author' placeholder="Author(s)">
84   - </p>
85   - <p>
86   - <label for="summary">Summary</label>
87   - <textarea id="summary" name='summary' placeholder="Some cool information about your wonderful project..." rows="6" cols="60"></textarea>
88   - </p>
89   - <p>
90   - <label for="cap">Enter the letters here:</label>
91   - <input id="cap" name='captchavalue'>
92   - <img src="{{ url_for('captcha', key=captcha_key) }}" />
93   - </p>
94   - <input type=hidden name=captchakey value={{ captcha_key }}>
95   - <p><input value="Submit" type="submit"></p>
96   - </form></section>
  72 + <section>
  73 +
  74 + {% block newprj %}{% endblock %}
  75 +
  76 + </section>
97 77 </article>
98 78 </section>
99 79
2  py3k/utils.py
@@ -34,7 +34,7 @@ def get_status(working):
34 34 else:
35 35 working_status = 'fails'
36 36 working_status_text = 'Failing'
37   - return working_status, working_status_text
  37 + return working_status, working_status_text # css class and display text
38 38
39 39
40 40 def pretty_date(time=False):

0 comments on commit f287f85

Please sign in to comment.
Something went wrong with that request. Please try again.