Commits

Anonymous committed 4c1ba7f

Improved html.

Comments (0)

Files changed (10)

packageindex/urls.py

 from django.views.generic.list_detail import object_detail
 from views import show_all_packages
 from django.views.generic.simple import redirect_to
+from django.conf import settings
 
 live_packages = {
     'queryset': STPackage.objects.all(),
 import os
 
-DEBUG = False
+DEBUG = True
 RECAPTCHA_ENABLED = True # Set to False when TESTING!
 TEMPLATE_DEBUG = DEBUG
 

static_media/main.css

+body {
+    font-family: Arial;
+    font-size: 14pt;
+}
+
+
+/* Navigation top-left. */
+ul.nav {
+    padding: 0;
+    margin: 0;
+}
+
+.nav li {
+    display: inline;
+    margin-right: .50em;
+}
+
+
+/* Footer */
+#footer {
+    margin-top: 2em;
+    padding-top: 0.5em;
+    border-top: 1px solid gray;
+}
+
+input.search {
+    font-size: 30;
+}
+
+/* Misc. */
+p.search_help {
+    font-size: small;
+    color: gray;
+}
+
+p.goal {
+    font-size: 20px;
+    margin-top: 3em;
+    margin-bottom: 1.5em;
+}

templates/add_package.html

 <html>
 <head>
-    <title>List of Packages</title>
+    <title>Sublime Text Info - Add Resource</title>
     <script type="text/javascript">
      var RecaptchaOptions = {
         theme : 'clean'
  </script>
 </head>
 <body>
-<h1>Add a new package</h1>
 
-{% if captcha_error %}
-  <p>Wrong answer to recaptcha.</p>
-{% endif %}
+<h1>Add New Resource</h1>
 
 <form action="" method="post">{% csrf_token %}
+    <p>Resources are mainly packages and themes for the Sublime Text editor, but they can also
+    be scripts or anything of value for <a href="http://sublimetext.com">Sublime Text</a> users.
+    </p>
+
+    <p>Resources must meet two requirements:</p>
+    <ul>
+      <li>They must be hosted on a public repository (Bitbucket or Github).</li>
+      <li>Their description field must include the phrase "Sublime Text".</li>
+    </ul>
+
     {{ form.as_p }}
 
+    {% if captcha_error %}
+      <p class="recaptcha_error_warning">Ooops! Wrong answer to recaptcha. Try again, please.</p>
+    {% endif %}
     <script type="text/javascript"
      src="http://www.google.com/recaptcha/api/challenge?k=6LcsL70SAAAAAFHQaf7jxN8L9h4FaeKXNrV16Kog{{ captcha_error }}" >
   </script>
      <input type="hidden" name="recaptcha_response_field"
          value="manual_challenge">
   </noscript>
-    <input type="submit" value="Submit" />
+    <input type="submit" value="Add new resource" />
 </form>
 </body>
 </html>

templates/base.html

 <html>
     <head>
         <title>{% block title %}Sublime Text Info -{% endblock %}</title>
+        <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.1/build/base/base-min.css">
+        <link rel="stylesheet" type="text/css" href="/site_media/main.css" />
     </head>
 
     <body>
         <ul class="nav">
             <li><a href="/">Home</a></li>
-            <li><a href="/packages/">Packages</a></li>
+            <li><a href="/packages/">All Resources</a></li>
             <li><a href="/docs/index.html">Sublime Text Help</a></li>
 <!--             <li><a href="/faq/">FAQ</a></li> -->
 <!--             <li><a href="/about/">About</a></li> -->
         {% block content %}
         {% endblock %}
 
-    <hr/>
-    <p>(c) 2010 guillermooo</p>
+    <p id="footer">&copy; 2010 guillermooo</p>
     </body>
 </html>

templates/index.html

 	{% block content %}
 	<p class="goal">Resources for <a href="http://www.sublimetext.com">Sublime Text</a> users: packages, themes, documentation and more!<p>
 
-	<form name="search" action="/packages/search/" method="get">
-		<input type="text" name="search" id="search_box" autofocus="autofocus" />
+	<form class="search" name="search" action="/packages/search/" method="get">
+		<input class="search" type="text" name="search" id="search_box" autofocus="autofocus" />
 		<input type="submit" value="Search" />
+		<p class="search_help">For documentation, go to <a href="/docs/">Sublime Text Help</a> first.
 	</form>
 	<p>Want to share something useful? <a href="/packages/add/">Add a resource</a>!</p>
 	{% endblock content %}

templates/package_detail.html

 {% extends "base.html" %}
-{% block title %}Package detail - {{ package.name }}{% endblock title %}
+{% block title %}{{ block.super }} Resource: {{ package.name }}{% endblock title %}
 
 {% block content %}
-	<h1>Sublime Text Package: {{ package.name }}</h1>
-    <p>{{ package.description }}</p>
-    <p>{{ package.get_checkout_command }}</p>
-    <p><a href="">How do I install this package?</a></p>
-    <a href="{{ package.checkout_url }}">Go to repository</a>
+	<h1>{{ package.name }}</h1>
+    <p class="description">{{ package.description }}</p>
+    <p class="checkout_url">{{ package.get_checkout_command }}</p>
+    <p class="how_to"><a href="">How do I install this package?</a></p>
+    <p class="go_to_repo"><a href="{{ package.checkout_url }}">Go to repository</a></p>
 {% endblock content %}

templates/package_list.html

 {% extends "base.html" %}
-{% block title %}List of Packages{% endblock %}
+{% block title %}{{ block.super }} All Resources{% endblock %}
 
 {% block content %}
 	<form name="search" action="/packages/search/" method="get">
-		<label for="search_box">Search packages:</label>
 		<input type="text" name="search" id="search_box" autofocus="autofocus" />
 		<input type="submit" value="Search" />
 	</form>
-	<hr>
+
 	{% for package in packages_list %}
-		<a href={{ package.get_absolute_url }}><strong>{{ package.name }}</strong></a>
-		<p><em>{{ package.description }}</em></p>
+		<div class="resource">
+			<p class="url"><a href="{{ package.get_absolute_url }}"><strong>{{ package.name }}</strong></a></p>
+			<p class="description">{{ package.description }}</p>
+		</div>
 	{% endfor %}
 
 	<p>

templates/search_results.html

 {% extends "base.html" %}
-{% block title %}Results for your search{% endblock title %}
+{% block title %}{{ block.super }} Search Results{% endblock title %}
 
 {% block content %}
 	<form name="search" action="." method="get">
-		<label for="search_box">Search packages:</label>
 		<input type="text" name="search" id="search_box" autofocus="autofocus" />
 		<input type="submit" value="Search" />
 	</form>
-	<h3>Search Results</h3>
 	{% for package in results_list %}
-		<p><a href="{{ package.get_absolute_url }}"><strong>{{ package.name }}</strong></a><br>
-			{{ package.description }}</p>
+		<div class="resource">
+			<p class="url"><a href="{{ package.get_absolute_url }}"><strong>{{ package.name }}</strong></a></p>
+			<p class="description">{{ package.description }}</p>
+		</div>
 	{% endfor %}
 
 	<p>
     (r'^packages/', include('stindex.packageindex.urls')),
     (r'^docs/(?P<path>.*)$', 'django.views.static.serve', {'document_root': 'C:/Users/guillermo/Dev/www/stindex-dev/stindex-branches/stindex/sublimehelp/_build/html/'}),
 )
+
+
+urlpatterns += patterns('',
+    (r'^site_media/(?P<path>.*)$', 'django.views.static.serve',
+        {'document_root': 'C:/Users/guillermo/Dev/www/stindex-dev/stindex/static_media/'}),
+    )