Skip to content
Permalink
Browse files
Profile → Account
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jan 6, 2015
1 parent 18950be commit f83a6f39593601bbb5617619b6a43ce1287a1750
@@ -63,7 +63,7 @@ def generate_menu_alt():
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">{0} [{1}] <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="/profile">Profile</a></li>
<li><a href="/account">Account</a></li>
{2}
<li><a href="/logout">Log out</a></li>
</ul>
@@ -317,27 +317,27 @@ def new_page():
init_site()
return redirect('/')

@app.route('/profile')
@app.route('/account')
@login_required
def acp_profile():
def acp_user_account():
if request.args.get('status') == 'ok':
alert = 'Profile changed successfully.'
alert = 'Account edited successfully.'
alert_status = 'success'
elif request.args.get('status') == 'pwdfail':
alert = 'Passwords don’t match.'
alert_status = 'danger'
else:
alert = ''
alert_status = ''
return render('comet_profile.tmpl',
context={'title': 'Edit profile',
'permalink': '/profile',
return render('comet_account.tmpl',
context={'title': 'My account',
'permalink': '/account',
'alert': alert,
'alert_status': alert_status})

@app.route('/profile/save', methods=['POST'])
@app.route('/account/save', methods=['POST'])
@login_required
def acp_profile_save():
def acp_user_account_save():
status = 'ok'
data = request.form
if data['newpwd1']:
@@ -347,7 +347,7 @@ def acp_profile_save():
status = 'pwdfail'
current_user.realname = data['realname']
write_users()
return redirect('/profile?status={0}'.format(status))
return redirect('/account?status={0}'.format(status))

@app.route('/users')
@login_required
@@ -3,16 +3,16 @@
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
{% endblock %}
{% block content %}
<h1 class="title">Editing profile <tt>{{ current_user.username }}</tt></h1>
<h1 class="title">Account <tt>{{ current_user.username }}</tt></h1>

{% if alert %}
<div class="alert alert-{{ alert_status }}" role="alert">{{ alert }}</div>
{% endif %}

<form action="/profile/save" method="POST" class="form-horizontal">
<form action="/account/save" method="POST" class="form-horizontal">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Details</h3>
<h3 class="panel-title">Profile</h3>
</div>
<div class="panel-body">

@@ -16,7 +16,7 @@
<form action="/users/save" method="POST" class="form-horizontal">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Details</h3>
<h3 class="panel-title">Profile</h3>
</div>
<div class="panel-body">

@@ -3,16 +3,16 @@
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
</%block>
<%block name="content">
<h1 class="title">Editing profile <tt>${current_user.username}</tt></h1>
<h1 class="title">Account <tt>${current_user.username}</tt></h1>

% if alert:
<div class="alert alert-${alert_status}" role="alert">${alert}</div>
% endif

<form action="/profile/save" method="POST" class="form-horizontal">
<form action="/account/save" method="POST" class="form-horizontal">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Details</h3>
<h3 class="panel-title">Profile</h3>
</div>
<div class="panel-body">

@@ -16,7 +16,7 @@
<form action="/users/save" method="POST" class="form-horizontal">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Details</h3>
<h3 class="panel-title">Profile</h3>
</div>
<div class="panel-body">

0 comments on commit f83a6f3

Please sign in to comment.