Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Improved theme selection UI
Now it's fancy, and gives previews, both as an iframe and when you select them! Closes #37
- Loading branch information
1 parent
a250238
commit 7c36dae
Showing
13 changed files
with
211 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<div class='theme-picker'> | ||
<input name='{{ widget.name }}' type='hidden' value='{{ widget.value.0 }}'{% include "django/forms/widgets/attrs.html" %}> | ||
{% for group_name, group_choices, group_index in widget.optgroups %} | ||
{% for option in group_choices %}{% include option.template_name with widget=option %}{% endfor %} | ||
{% endfor %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div class='iframe-box' data-value='{{ widget.value }}'{% include "django/forms/widgets/attrs.html" %}> | ||
<iframe src='{% url "user:preview" %}?t={{ widget.value }}'></iframe> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{% load static bookmark %} | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Theme Preview</title> | ||
<link rel='stylesheet' href='{% static "styles.css" %}'/> | ||
<link rel='stylesheet' href='{% static "theme_"|add:preview_theme|add:".css" %}'/> | ||
<style> | ||
.button { | ||
background-image:url('{% static "icons.png" %}'); | ||
} | ||
|
||
:root { | ||
overflow:hidden; | ||
zoom:0.5; | ||
} | ||
</style> | ||
|
||
<script async src='//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js'></script> | ||
<script async src='{% static "scripts.js" %}'></script> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
</head> | ||
|
||
<body> | ||
<nav> | ||
{% if user.is_authenticated %} | ||
<a href='{% url "bookmarks:home" %}' {% if area == "bookmarks" %}class='active'{% endif %}> | ||
Bookmarks | ||
</a> | ||
|
||
<a href='{% url "tags:home" %}' {% if area == "tags" %}class='active'{% endif %}> | ||
Tags | ||
</a> | ||
|
||
<a href='{% url "search:home" %}' {% if area == "search" %}class='active'{% endif %}> | ||
Search | ||
</a> | ||
|
||
{% if not user.settings.hide_settings %} | ||
<a href='{% url "user:home" %}' {% if area == "user" %}class='active'{% endif %}> | ||
Settings | ||
</a> | ||
{% endif %} | ||
|
||
{% for t in pinned_tags %} | ||
<a href='{% url "tags:filter" tag=t.slug %}' {% if tag.pk == t.pk %}class='active'{% endif %}> | ||
{{ t.name }} | ||
</a> | ||
{% endfor %} | ||
{% else %} | ||
<a href='{% url "user:login"%}' class='active'> | ||
Log In | ||
</a> | ||
{% endif %} | ||
</nav> | ||
|
||
<main> | ||
<div id='bookmark-list'> | ||
{% for bm in bookmarks %} | ||
{% bookmark bm %} | ||
{% empty %} | ||
<div class='box'> | ||
You have no bookmarks; how do you expect to pick a theme!? | ||
</div> | ||
{% endfor %} | ||
</div> | ||
</main> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.