Working on new Account section.

master
Nick Sergeant 2013-02-10 19:24:55 -05:00
parent 008e30af08
commit 035ce1fb46
6 changed files with 65 additions and 161 deletions

View File

@ -9,121 +9,30 @@
{% endblock %}
{% block content %}
<div class="static-box">
<h2>Account</h2>
{% if messages %}
{% for message in messages %}
<p class="alert alert-{{ message.tags }}">{{ message }}</p>
{% endfor %}
{% endif %}
{% if form.errors %}
<p class="alert alert-error">
Only letters, numbers, underscores, dashes, and periods are valid in Pro settings fields.
</p>
{% endif %}
<ul>
<li>Username: {{ request.user.username }}</li>
<li><a href="/api/">API</a> key: {{ request.user.api_key.key }}</li>
<li><a href="/api/">API</a> user ID: {{ request.user.id }}</li>
<li><a href="/password/change/">Change password</a></li>
</ul>
{% if request.user.profile.is_pro %}
<form class="form-horizontal" action="/account/" method="post">
<legend>Edit Pro settings</legend>
<div class="control-group {% if form.errors.blog_title %}error{% endif %}">
<label class="control-label" for="id_blog_title">Blog title:</label>
<div class="controls">
{{ form.blog_title }}
</div>
</div>
<div class="control-group {% if form.errors.blog_theme %}error{% endif %}">
<label class="control-label" for="id_blog_theme">Blog theme:</label>
<div class="controls">
{{ form.blog_theme }}
</div>
</div>
<div class="control-group {% if form.errors.blog_domain %}error{% endif %}">
<label class="control-label" for="id_blog_domain">Blog domain:</label>
<div class="controls">
{{ form.blog_domain }}
<span class="help-block">Like 'snipt.nicksergeant.com' or 'nicksergeant.com' (without quotes). Set your CNAME / A-record to point to 96.126.110.160</span>
</div>
</div>
<div class="control-group {% if form.errors.default_editor %}error{% endif %}">
<label class="control-label" for="id_default_editor">Default editor:</label>
<div class="controls">
{{ form.default_editor }}
</div>
</div>
<div class="control-group {% if form.errors.editor_theme %}error{% endif %}">
<label class="control-label" for="id_editor_theme">Default editor theme:</label>
<div class="controls">
{{ form.editor_theme }}
</div>
</div>
<div class="control-group {% if form.errors.gittip_username %}error{% endif %}">
<label class="control-label" for="id_gittip_username">Gittip username:</label>
<div class="controls">
{{ form.gittip_username }}
<span class="help-block">Your <a href="https://www.gittip.com/">Gittip</a> username, if you have one.</span>
</div>
</div>
<div class="control-group {% if form.errors.disqus_shortname %}error{% endif %}">
<label class="control-label" for="id_disqus_shortname">Disqus shortname:</label>
<div class="controls">
{{ form.disqus_shortname }}
<span class="help-block">If you have your own <a href="http://disqus.com/">Disqus</a> account that you'd like to use for your blog comments, enter your shortname here.</span>
</div>
</div>
<div class="control-group {% if form.errors.google_analytics_tracking_id %}error{% endif %}">
<label class="control-label" for="id_google_analytics_tracking_id">Google Analytics tracking ID:</label>
<div class="controls">
{{ form.google_analytics_tracking_id }}
<span class="help-block">If you'd like to track visits to your blog site with <a href="http://analytics.google.com">Google Analytics</a>, enter your tracking ID here.</span>
</div>
</div>
<div class="control-group {% if form.errors.gauges_site_id %}error{% endif %}">
<label class="control-label" for="id_gauges_site_id">Gauges site ID:</label>
<div class="controls">
{{ form.gauges_site_id }}
<span class="help-block">If you'd like to track visits to your blog site with <a href="http://get.gaug.es/">Gauges</a>, enter your site ID here.</span>
</div>
</div>
<div class="control-group {% if form.errors.google_ad_client %}error{% endif %}">
<label class="control-label" for="id_google_ad_client">Google Ads: "google_ad_client"</label>
<div class="controls">
{{ form.google_ad_client }}
<span class="help-block">If you'd like to run Google Ads in your blog's sidebar, enter your client ID here, as well as the following three fields.</span>
</div>
</div>
<div class="control-group {% if form.errors.google_ad_slot %}error{% endif %}">
<label class="control-label" for="id_google_ad_slot">Google Ads: "google_ad_slot"</label>
<div class="controls">
{{ form.google_ad_slot }}
</div>
</div>
<div class="control-group {% if form.errors.google_ad_width %}error{% endif %}">
<label class="control-label" for="id_google_ad_width">Google Ads: "google_ad_width"</label>
<div class="controls">
{{ form.google_ad_width }}
</div>
</div>
<div class="control-group {% if form.errors.google_ad_height %}error{% endif %}">
<label class="control-label" for="id_google_ad_height">Google Ads: "google_ad_height"</label>
<div class="controls">
{{ form.google_ad_height }}
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-success">Save</button>
</div>
{% csrf_token %}
</form>
{% endif %}
</div>
<section class="profile group">
<aside>
<ul class="nav nav-list">
<li class="nav-header">Account</li>
<li class="active">
<a href="">Profile</a>
</li>
<li>
<a href="">Change Password</a>
</li>
<li>
<a href="">Billing</a>
</li>
<li class="nav-header">Pro</li>
<li>
<a href="">Blog settings</a>
</li>
<li>
<a href="">Editor settings</a>
</li>
</ul>
</aside>
<section class="content">
Content
</section>
</section>
{% endblock %}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1510,19 +1510,13 @@ a.go-pro {
// Pages
body.account {
div.static-box {
padding-bottom: 0;
padding-top: 10px;
form {
div.control-group:first-of-type {
margin-top: 20px;
}
span.help-block {
color: #999;
font-size: 12px;
max-width: 370px;
}
section.profile {
aside {
float: left;
width: 190px;
}
section.content {
}
}
}

View File

@ -1,7 +1,5 @@
{% extends "snipts/list.html" %}
{% load snipt_tags %}
{% block breadcrumb %}
<li><a href="/{{ user.username }}/">{{ user.username }}</a></li>
{% if tag %}
@ -16,33 +14,7 @@
{% endblock %}
{% block aside-top %}
<div class="profile group">
<img src="https://secure.gravatar.com/avatar/{{ user.email|md5 }}?s=175" alt="{{ user.username }}" title={{ user.username }}" />
<div class="meta">
<div class="username" title="{{ user.username }}">
{% if user.username == 'blog' %}
Blog
{% else %}
{{ user.username }}
{% endif %}
</div>
{% if user.username == 'nick' %}
<div class="member-since">Snipt Founder in {{ user.date_joined|date:"Y" }}</div>
{% else %}
{% if user.username == 'blog' %}
<div class="member-since">Official Snipt blog</div>
{% else %}
<div class="member-since">Member since {{ user.date_joined|date:"Y" }}</div>
{% endif %}
{% endif %}
</div>
{% if user.profile.is_pro %}
<a class="pro" href="/pro/">Pro</a>
{% if user.profile.gittip_username %}
<a class="gittip" href="https://www.gittip.com/{{ user.profile.gittip_username }}/">Tip</a>
{% endif %}
{% endif %}
</div>
{% include "profile.html" %}
{% if not request.user.profile.is_pro %}
<div class="sifter">
<h3>Building things is hard.</h3>

29
templates/profile.html Normal file
View File

@ -0,0 +1,29 @@
{% load snipt_tags %}
<div class="profile group">
<img src="https://secure.gravatar.com/avatar/{{ user.email|md5 }}?s=175" alt="{{ user.username }}" title={{ user.username }}" />
<div class="meta">
<div class="username" title="{{ user.username }}">
{% if user.username == 'blog' %}
Blog
{% else %}
{{ user.username }}
{% endif %}
</div>
{% if user.username == 'nick' %}
<div class="member-since">Snipt Founder in {{ user.date_joined|date:"Y" }}</div>
{% else %}
{% if user.username == 'blog' %}
<div class="member-since">Official Snipt blog</div>
{% else %}
<div class="member-since">Member since {{ user.date_joined|date:"Y" }}</div>
{% endif %}
{% endif %}
</div>
{% if user.profile.is_pro %}
<a class="pro" href="/pro/">Pro</a>
{% if user.profile.gittip_username %}
<a class="gittip" href="https://www.gittip.com/{{ user.profile.gittip_username }}/">Tip</a>
{% endif %}
{% endif %}
</div>