Skip to content

Commit

Permalink
added local and pro settings,added blovk title
Browse files Browse the repository at this point in the history
  • Loading branch information
manjunath24 committed Feb 20, 2014
1 parent edba91c commit c700d57
Show file tree
Hide file tree
Showing 20 changed files with 44 additions and 39 deletions.
3 changes: 0 additions & 3 deletions accounts/admin.py

This file was deleted.

3 changes: 0 additions & 3 deletions accounts/models.py

This file was deleted.

2 changes: 2 additions & 0 deletions accounts/templates/change_password.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends "base.html" %}

{% block title %} Change Password {% endblock title %}

{% block content %}

<form action="{% url 'change_password' %}" method="POST" class="form-horizontal">
Expand Down
2 changes: 2 additions & 0 deletions accounts/templates/signup.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends "base.html" %}

{% block title %} SignUp {% endblock title %}

{% block content %}

<form action="{% url 'signup' %}" method="POST" class="form-horizontal">
Expand Down
3 changes: 0 additions & 3 deletions accounts/tests.py

This file was deleted.

9 changes: 4 additions & 5 deletions accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,16 @@ def signin(request):
if request.method == 'POST':
username = request.POST.get('username')
password = request.POST.get('password')

user = authenticate(username=username, password=password)
if user is not None:
if user.is_active:
login(request, user)
return redirect('index')
else:
messages.error(request, 'Your account is inactive')
else:
messages.error(request, 'Your account is inactive')
return redirect('index')
else:
messages.error(request, 'Invalid login credentials')
else:
messages.error(request, 'Invalid login credentials')
return redirect('index')


Expand Down
2 changes: 1 addition & 1 deletion lint.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pep8 --ignore E501 --exclude=migrations opentavern tavern
pylint --rcfile=.pylintrc opentavern tavern
pylint --rcfile=.pylintrc opentavern tavern accounts --ignore=migrations,config
2 changes: 1 addition & 1 deletion manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "opentavern.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "opentavern.config")

from django.core.management import execute_from_command_line

Expand Down
1 change: 1 addition & 0 deletions opentavern/config/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .settings_local import *
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
"""
Django settings for opentavern project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""

from unipath import Path

SITE_PATH = Path(__file__).ancestor(2)
SITE_PATH = Path(__file__).ancestor(3)

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
Expand Down
1 change: 1 addition & 0 deletions opentavern/config/settings_local.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .settings_base import *
1 change: 1 addition & 0 deletions opentavern/config/settings_prod.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .settings_base import *
15 changes: 1 addition & 14 deletions tavern/templates/base.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<head>
<title>Open Tavern</title>
<title>{% block title %} {% endblock title %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}bootstrap/css/bootstrap.css">
Expand All @@ -9,19 +9,6 @@
<script type="text/javascript" src="{{ STATIC_URL }}bootstrap/js/bootstrap.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}eternicode-bootstrap-datepicker-b374f23/js/bootstrap-datepicker.js"></script>

<!-- Date Picker -->
<link rel="stylesheet" href="{{ STATIC_URL }}css/jquery-ui.css">
<script src="{{ STATIC_URL }}js/jquery-1.9.1.js"></script>
<script src="{{ STATIC_URL }}js/jquery-ui.js"></script>

<script>
$(function() {
$( "#id_starts_at" ).datepicker({'minDate': 0});
$( "#id_ends_at" ).datepicker({'minDate': 0});
});
</script>
<!-- Date Picker -->

<style>
.list-group{
width: 300px;
Expand Down
15 changes: 15 additions & 0 deletions tavern/templates/create_event.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
{% extends "base.html" %}

{% block title %} Create Event {% endblock title %}

{% block content %}

<!-- Date Picker -->
<link rel="stylesheet" href="{{ STATIC_URL }}css/jquery-ui.css">
<script src="{{ STATIC_URL }}js/jquery-ui.js"></script>

<script>
$(function() {
$( "#id_starts_at" ).datepicker({'minDate': 0});
$( "#id_ends_at" ).datepicker({'minDate': 0});
});
</script>
<!-- Date Picker -->

<form action="" method="POST" class="form-horizontal">
{% csrf_token %}

Expand Down
3 changes: 2 additions & 1 deletion tavern/templates/create_group.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{% extends "base.html" %}

{% block content %}
{% block title %} Create Group {% endblock title %}

{% block content %}

<form action="" method="POST">
{% csrf_token %}
Expand Down
2 changes: 2 additions & 0 deletions tavern/templates/event_details.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends "base.html" %}

{% block title %} Event - {{ event.name }} {% endblock title %}

{% block content %}
<h1> Event Name: {{ event.name }} </h1>
<hr/>
Expand Down
2 changes: 2 additions & 0 deletions tavern/templates/group_details.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends "base.html" %}

{% block title %} Group - {{ group.name }} {% endblock title %}

{% block content %}
<h1> Group Name: {{ group.name }} </h1>
<h1> Recently Joined: {{ user.name }} </h1>
Expand Down
2 changes: 2 additions & 0 deletions tavern/templates/home.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends 'base.html' %}

{% block title %} {% if user.is_authenticated %} Open Tavern {% else %} Welcome to Open Tavern - SignIn {% endif %} {% endblock title %}

{% block content %}

{% if messages %}
Expand Down
4 changes: 3 additions & 1 deletion tavern/templates/tavern_event_update.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{% extends "base.html" %}

{% block title %} Edit event - {{ form.name.value }} {% endblock title %}

{% block content %}

<form action="" method="post">{% csrf_token %}

<fieldset>
<legend>Create Event</legend>
<legend>Edit Event</legend>

{% if form.errors %}
<p>Please fill all the fields.</p>
Expand Down
4 changes: 3 additions & 1 deletion tavern/templates/tavern_group_update.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{% extends "base.html" %}

{% block title %} Edit group - {{ form.name.value }} {% endblock title %}

{% block content %}

<form action="" method="post">{% csrf_token %}

<fieldset>
<legend>Create Group</legend>
<legend>Edit Group</legend>

{% if form.errors %}
<p>Please fill all the fields.</p>
Expand Down

0 comments on commit c700d57

Please sign in to comment.