Permalink
Browse files

Merge branch 'master' of github.com:timehome/djangodash2011

  • Loading branch information...
2 parents 832c1c8 + cd0088e commit 11758b74b3a9d86f93a50dc135dd5a4b8b09aa2a @heynemann heynemann committed Jul 31, 2011
@@ -0,0 +1,27 @@
+.popin .login {
+ color: #333;
+ padding: 20px;
+}
+.popin .login ul {
+ overflow: hidden;
+}
+.popin .login ul a {
+ width: 48px;
+ height: 48px;
+ overflow: hidden;
+ float: left;
+ text-indent: -500px;
+}
+.popin .login ul li {
+ padding-right: 20px;
+ overflow: hidden;
+ float: left;
+}
+.popin .login ul .fb a {
+ background: url(../img/facebook-pencil.png) no-repeat;
+}
+.popin .login ul .go a {
+ background: url(../img/google-pencil.png) no-repeat;
+}
+
+
@@ -1,11 +1,14 @@
html {
overflow: hidden;
}
-html, body, h1, h2 {
+html, body, h1, h2, ul, ol{
padding: 0;
margin: 0;
}
body {
background: #ddd;
font-family: arial,helvetica,freesans,sans-serif;
}
+ul, ol{
+ list-style: none;
+}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -6,6 +6,7 @@
<link href="{{ STATIC_URL }}wall/css/header.css" rel="stylesheet" type="text/css" />
<link href="{{ STATIC_URL }}wall/css/overlay.css" rel="stylesheet" type="text/css" />
<link href="{{ STATIC_URL }}wall/css/popin.css" rel="stylesheet" type="text/css" />
+ <link href="{{ STATIC_URL }}wall/css/login-popin.css" rel="stylesheet" type="text/css" />
<link href="{{ STATIC_URL }}wall/css/crop-popin.css" rel="stylesheet" type="text/css" />
<link href="{{ STATIC_URL }}wall/css/wall.css" rel="stylesheet" type="text/css" />
{% endblock %}
@@ -48,7 +49,7 @@
settings = this.settings || {};
settings.defaultUsername = '{{ username }}';
settings.urls = {
- shorten: '{% url wall.views.save_cropped_photo %}',
+ shorten: '{% url wall.views.save_cropped_photo %}',
userAlbums: '/api/{username}.json'
};
</script>
@@ -7,6 +7,11 @@
settings = this.settings || {};
settings.authUsername = "{{ username }}";
</script>
+
+ {% for association in still_unassociated %}
+ <span class="{{ association.class }}"><a href="{{ association.url }}">{{ association.label }}</a></span>
+ {% endfor %}
+
<span>{{ username }}</span>
<a href="/logout/">logout</a>
{% endif %}
@@ -1,10 +1,10 @@
<div id="simple-popin" class="simple-popin popin">
<div class="login">
- <p>Show, see, crop and share your photos easily!</p>
+ <h2>Show, see, crop and share your photos easily!</h2>
<p>Choose your log-in option:</p>
<ul>
- <li><a href="{% url socialauth_begin "facebook" %}">facebook</a></li>
- <li><a href="{% url socialauth_begin "google" %}">google</a></li>
+ <li class="fb"><a title="Facebook" href="{% url socialauth_begin "facebook" %}">facebook</a></li>
+ <li class="go"><a title="Google" href="{% url socialauth_begin "google" %}">google</a></li>
</ul>
</div>
</div>
View
@@ -7,6 +7,7 @@
from django.conf import settings
from django.shortcuts import render
from django.http import Http404, HttpResponse, HttpResponsePermanentRedirect
+from django.core.urlresolvers import reverse
from providers.base import format_url
@@ -28,7 +29,23 @@ def _load_username(*args, **kwargs):
@load_username
def index(request, username=None):
- return render(request, 'wall/index.html', {'username': username})
+ still_unassociated = [
+ {
+ "class": "facebook",
+ "label": "Associate with Facebook",
+ "url": reverse("socialauth_associate_begin", args=["facebook"])
+ },
+ {
+ "class": "google",
+ "label": "Associate with Picasa",
+ "url": reverse("socialauth_associate_begin", args=["google"])
+ }
+ ]
+ if request.user.is_authenticated():
+ for social_auth in request.user.social_auth.all():
+ still_unassociated = filter(lambda x: x['class'] != social_auth.provider, still_unassociated)
+ return render(request, 'wall/index.html', {'username': username,
+ 'still_unassociated': still_unassociated})
@load_username
def albums(request, username=None, extension="json"):

0 comments on commit 11758b7

Please sign in to comment.