# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 1347559771 14400 # Node ID 1abdcf1cf5cba96ec4f9466435c4f68d83764ec2 # Parent 1da98bd71b84e04a8c129c471da8bacf6f375401# Parent 32a37a26534ba633d581fa687519fc3e8378ebc4 Merge back again diff -r 1da98bd71b84 -r 1abdcf1cf5cb .hgignore --- a/.hgignore Thu Sep 13 14:07:44 2012 -0400 +++ b/.hgignore Thu Sep 13 14:09:31 2012 -0400 @@ -7,3 +7,4 @@ .*\.swo$ ^Honza.*/ fabfile.py +.git diff -r 1da98bd71b84 -r 1abdcf1cf5cb apps/snippet/models.py --- a/apps/snippet/models.py Thu Sep 13 14:07:44 2012 -0400 +++ b/apps/snippet/models.py Thu Sep 13 14:09:31 2012 -0400 @@ -3,7 +3,6 @@ import random from django.db import models -from django.db.models import permalink from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User @@ -51,7 +50,7 @@ def get_title(self): return self.title or _('Snippet #%d' % self.id) - @permalink + @models.permalink def get_absolute_url(self): return ('snippet_details', (self.secret_id,)) diff -r 1da98bd71b84 -r 1abdcf1cf5cb static/css/agora.less --- a/static/css/agora.less Thu Sep 13 14:07:44 2012 -0400 +++ b/static/css/agora.less Thu Sep 13 14:09:31 2012 -0400 @@ -183,7 +183,7 @@ } p { - padding: 5px 0; + padding-bottom: 5px; } .snippetform { @@ -265,3 +265,75 @@ border-bottom: 1px solid @lightGrey; } } + +ul { + padding: 5px 0; + margin-left: 20px; +} + +#login-popup { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(0, 0, 0, 0.3); + z-index: 200; +} + +#login-form { + @width: 600px; + @height: 300px; + @verticalPadding: 20px; + + .box-shadow(0 0 5px 1px rgba(0, 0, 0, 0.3)); + width: @width; + height: @height - (@verticalPadding * 2); + position: absolute; + top: 50%; + left: 50%; + margin-left: -@width / 2; + margin-top: -@height / 2; + background: @white; + .border-radius(5px); + padding: @verticalPadding 30px; +} + +.errors { + padding-top: 5px; + padding-left: 5px; + background: @lightOrange; + margin-bottom: 10px; + border: 1px solid @orange; + .border-radius(5px); +} + +form { + .form-line { + label { + float: left; + text-align: right; + } + } + + .form-input { + margin-left: 180px; + } + + .errors { + clear: both; + } +} + +dl { + dt { + float: left; + clear: left; + font-weight: bold; + padding-right: 5px; + } + + dd { + margin-left: 200px; + } +} diff -r 1da98bd71b84 -r 1abdcf1cf5cb static/css/code.less --- a/static/css/code.less Thu Sep 13 14:07:44 2012 -0400 +++ b/static/css/code.less Thu Sep 13 14:09:31 2012 -0400 @@ -1,27 +1,38 @@ -// For all syntax-highlighted code +.line-number { + width: 30px; + text-align: right; + font-weight: bold; + padding-right: 10px; + .disable-select; +} + .highlight { width: 650px; - padding: 10px; - .border-radius(7px); - overflow-x: auto; - border: 1px solid @lightGrey; + white-space: pre-wrap; + border-style: solid; + border-color: @lightGrey; + border-width: 0 1px; + padding: 0 10px; +} - &.wrap { - white-space: pre-wrap; - width: 688px; +.snippet tr { + &:first-child td { + border-top-width: 1px; + padding-top: 10px; + .border-radius(7px 7px 0 0); + } + + &:last-child td { + border-bottom-width: 1px; + padding-bottom: 10px; + .border-radius(0 0 7px 7px); } } -.numbers, .highlight { - line-height: 18px; +.snippet table { + font-family: monospace; + border-spacing: 0; + td { + vertical-align: top; + } } - -#line-numbers { - vertical-align: top; - padding-top: 11px; - width: 40px; -} - -.snippet table { - border-spacing: 0; -} diff -r 1da98bd71b84 -r 1abdcf1cf5cb static/css/code/autumn.less --- a/static/css/code/autumn.less Thu Sep 13 14:07:44 2012 -0400 +++ b/static/css/code/autumn.less Thu Sep 13 14:09:31 2012 -0400 @@ -1,4 +1,4 @@ -.highlight &.autumn { +.snippet &.autumn { .hll { background-color: #ffffcc } .c { color: #aaaaaa; font-style: italic } /* Comment */ .err { color: #F00000; background-color: #F0A0A0 } /* Error */ diff -r 1da98bd71b84 -r 1abdcf1cf5cb static/css/code/borland.less --- a/static/css/code/borland.less Thu Sep 13 14:07:44 2012 -0400 +++ b/static/css/code/borland.less Thu Sep 13 14:09:31 2012 -0400 @@ -1,4 +1,4 @@ -.highlight &.borland { +.snippet &.borland { .hll { background-color: #ffffcc } .c { color: #008800; font-style: italic } /* Comment */ .err { color: #a61717; background-color: #e3d2d2 } /* Error */ diff -r 1da98bd71b84 -r 1abdcf1cf5cb static/css/code/fruity.less --- a/static/css/code/fruity.less Thu Sep 13 14:07:44 2012 -0400 +++ b/static/css/code/fruity.less Thu Sep 13 14:09:31 2012 -0400 @@ -1,5 +1,7 @@ -.highlight &.fruity { - background: @almostBlack; +.snippet &.fruity { + .highlight { + background: @almostBlack; + } .hll { background-color: #333333 } .c { color: #008800; font-style: italic; } /* Comment */ diff -r 1da98bd71b84 -r 1abdcf1cf5cb static/css/code/monokai.less --- a/static/css/code/monokai.less Thu Sep 13 14:07:44 2012 -0400 +++ b/static/css/code/monokai.less Thu Sep 13 14:09:31 2012 -0400 @@ -1,6 +1,8 @@ -.highlight &.monokai { - background: #272822; - color: #F8F8F2; +.snippet &.monokai { + .highlight { + background: #272822; + color: #F8F8F2; + } .hll { background-color: #49483e } .c { color: #75715e } /* Comment */ diff -r 1da98bd71b84 -r 1abdcf1cf5cb static/css/code/native.less --- a/static/css/code/native.less Thu Sep 13 14:07:44 2012 -0400 +++ b/static/css/code/native.less Thu Sep 13 14:09:31 2012 -0400 @@ -1,5 +1,7 @@ -.highlight &.native { - background: @almostBlack; +.snippet &.native { + .highlight { + background: @almostBlack; + } .hll { background-color: #404040 } .c { color: #999999; font-style: italic } /* Comment */ diff -r 1da98bd71b84 -r 1abdcf1cf5cb static/css/code/tango.less --- a/static/css/code/tango.less Thu Sep 13 14:07:44 2012 -0400 +++ b/static/css/code/tango.less Thu Sep 13 14:09:31 2012 -0400 @@ -1,4 +1,4 @@ -.highlight &.tango { +.snippet &.tango { .hll { background-color: #ffffcc } .c { color: #8f5902; font-style: italic } /* Comment */ .err { color: #a40000; border: 1px solid #ef2929 } /* Error */ diff -r 1da98bd71b84 -r 1abdcf1cf5cb static/css/code/vibrant.less --- a/static/css/code/vibrant.less Thu Sep 13 14:07:44 2012 -0400 +++ b/static/css/code/vibrant.less Thu Sep 13 14:09:31 2012 -0400 @@ -1,8 +1,9 @@ // Modified version of the vibrant pygments stylesheet -.highlight &.vibrant { - color: @white; - background: @almostBlack; - .box-shadow(inset 0 0 40px rgba(0, 0, 0, 0.7)); +.snippet &.vibrant { + .highlight { + color: @white; + background: @almostBlack; + } // Comments .c { diff -r 1da98bd71b84 -r 1abdcf1cf5cb static/css/code/vs.less --- a/static/css/code/vs.less Thu Sep 13 14:07:44 2012 -0400 +++ b/static/css/code/vs.less Thu Sep 13 14:09:31 2012 -0400 @@ -1,4 +1,4 @@ -.highlight &.vs { +.snippet &.vs { .hll { background-color: #ffffcc } .c { color: #008000 } /* Comment */ .err { border: 1px solid #FF0000 } /* Error */ diff -r 1da98bd71b84 -r 1abdcf1cf5cb static/css/mixins.less --- a/static/css/mixins.less Thu Sep 13 14:07:44 2012 -0400 +++ b/static/css/mixins.less Thu Sep 13 14:09:31 2012 -0400 @@ -71,7 +71,7 @@ } .pill { - .inline-block; + display: block; background: @lighterGrey; border: 1px solid lighten(@mediumGrey, 10%); .border-radius(3px); @@ -81,6 +81,8 @@ line-height: 1; text-shadow: 0 1px 0 @white; .box-shadow(inset 0 0 3px 0px @white); + margin-bottom: 10px; + .center-align; &:hover { color: @white; @@ -95,3 +97,12 @@ .hidden { display: none; } + +.disable-select { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} diff -r 1da98bd71b84 -r 1abdcf1cf5cb static/css/variables.less --- a/static/css/variables.less Thu Sep 13 14:07:44 2012 -0400 +++ b/static/css/variables.less Thu Sep 13 14:09:31 2012 -0400 @@ -9,8 +9,9 @@ @offWhite: #FBFBFB; @white: #FFF; +@darkOrange: #D45500; @orange: #FF7F2A; -@darkOrange: #D45500; +@lightOrange: lighten(@orange, 25%); @darkBlue: #1B749D; @mediumBlue: #22A2CA; diff -r 1da98bd71b84 -r 1abdcf1cf5cb static/js/agora.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/static/js/agora.js Thu Sep 13 14:09:31 2012 -0400 @@ -0,0 +1,25 @@ +(function ($) { + // Handle showing the login popup + var handleLoginLink = function () { + var loginLink = $('.login-link'); + + if (loginLink.length) { + loginLink.click(function () { + $('#login-popup').show(); + + return false; + }); + + $('#login-popup').click(function (event) { + // Only catch events in the outer, overlay div + if (event.target === this) { + $(this).hide(); + } + }); + } + }; + + $(document).ready(function () { + handleLoginLink(); + }); +})(jQuery); diff -r 1da98bd71b84 -r 1abdcf1cf5cb templates/base.djhtml --- a/templates/base.djhtml Thu Sep 13 14:07:44 2012 -0400 +++ b/templates/base.djhtml Thu Sep 13 14:09:31 2012 -0400 @@ -54,6 +54,7 @@ {% block navbar %} +{% if not user.is_authenticated %}

Explore - - Register an account +

You can sign up, if you want, won't share your email, not required, etc

+{% endif %} {% endblock %} diff -r 1da98bd71b84 -r 1abdcf1cf5cb templates/login.djhtml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/login.djhtml Thu Sep 13 14:09:31 2012 -0400 @@ -0,0 +1,15 @@ +{% extends "base.djhtml" %} + +{% block content %} +{% include "login_form.djhtml" %} +{% endblock %} + +{% block login_form %} +{% endblock %} + +{% block login_breadcrumbs %} +{% endblock %} + +{% block breadcrumbs %} +« Back to home +{% endblock %} diff -r 1da98bd71b84 -r 1abdcf1cf5cb templates/login_form.djhtml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/login_form.djhtml Thu Sep 13 14:09:31 2012 -0400 @@ -0,0 +1,85 @@ +

Login or register

+ +{% if user.is_authenticated %} +

+ You are already logged in. + Logout » +

+{% else %} +
+ {% csrf_token %} + +

Already have an account? Enter your username and password below.

+ +
+ +
+ +
+
+ + {% if form.username.errors %} +
+ {{ form.username.errors }} +
+ {% endif %} + +
+ +
+ +
+
+ + {% if form.password1.errors %} +
+ {{ form.password1.errors }} +
+ {% endif %} + +
+ +

+ If you don't have an account yet, you can create one by filling out + the following fields as well: +

+ +
+ +
+ +
+
+ + {% if form.password2.errors %} +
+ {{ form.password2.errors }} +
+ {% endif %} + +
+ +
+ +
+
+ + {% if form.email.errors %} +
+ {{ form.email.errors }} +
+ {% endif %} + +
+ +
+ + +
+
+{% endif %} diff -r 1da98bd71b84 -r 1abdcf1cf5cb templates/profile/user.djhtml --- a/templates/profile/user.djhtml Thu Sep 13 14:07:44 2012 -0400 +++ b/templates/profile/user.djhtml Thu Sep 13 14:09:31 2012 -0400 @@ -1,44 +1,31 @@ {% extends "base.djhtml" %} -{% block boxtitle %} -{{profile.user.username}}
-{% if profile.user = user %} - - ( - edit profile - ) - -{% endif %} -{% endblock boxtitle%} +{% block breadcrumbs %} +Viewing profile: {{ profile.user }} +{% endblock %} + {% block content %} -
- {% if profile.user.first_name or profile.user.last_name %} - Name - {{name}} -
- {% endif %} - Preferred license - {{profile.preferred_license}} -
- {% if profile.interests %} -

- Interests -

-

- {{profile.interests}} -

- {% endif %} + +

{{ profile.user }}'s profile

+ +
+ {% if profile.user.first_name or profile.user.last_name %} +
Name:
+
{{ name|default:"N/A" }}
+ {% endif %} - {% if profile.blurb %} -

- About {{name}} -

-

- {{profile.blurb}} -

-
-{% endif %} +
Preferred license:
+
{{ profile.preferred_license }}
+ + +

Interests

+ +

{{ profile.interests }}

+ +

About {{ name }}

+ +

{{ profile.blurb }}

{% endblock %} {% block content-related %} diff -r 1da98bd71b84 -r 1abdcf1cf5cb templates/snippet/snippet_details.djhtml --- a/templates/snippet/snippet_details.djhtml Thu Sep 13 14:07:44 2012 -0400 +++ b/templates/snippet/snippet_details.djhtml Thu Sep 13 14:09:31 2012 -0400 @@ -60,8 +60,6 @@ — {% endif %} - {% trans "Toggle wordwrap" %} - — Syntax highlighting style: