Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: gunicorn tracker.wsgi
web: python manage.py syncdb --noinput; gunicorn tracker.wsgi
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Installation
#### Heroku

1. Install [heroku toolbelt](https://devcenter.heroku.com/articles/quickstart)
2. Clone this repository `git clone repo url`
2. Clone this repository `git clone git@github.com:dasf/insightful.git`
3. Create heroku app `heroku create`
4. Add heroku remote url to repository `heroku git:remote -a "your application name"`
5. Push to heroku `git push heroku master`
Expand All @@ -39,4 +39,8 @@ Roadmap
=======
* More coverage
* Actual jasmine tests
* Remove tracking code's jQuery dependency
* Remove tracking code's jQuery dependency

Demo
====
Demo is available at [http://insightful-demo.herokuapp.com/](http://insightful-demo.herokuapp.com/)
6 changes: 2 additions & 4 deletions accounts/templates/accounts/add_website.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ <h3 class="panel-title">Add a website</h3>
<form action="" method="POST">
{% csrf_token %}
{{ form|bootstrap }}
<p>
<button class="btn btn-lime btn-lg btn-block" role="button" type="submit">Save
</button>
</p>
<button class="btn btn-primary btn-lg btn-block btn-panel" role="button" type="submit">Save
</button>
</form>
</div>
</div>
Expand Down
6 changes: 2 additions & 4 deletions accounts/templates/accounts/edit_website.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ <h3 class="panel-title">Edit website</h3>
<form action="" method="POST">
{% csrf_token %}
{{ form|bootstrap }}
<p>
<button class="btn btn-lime btn-lg btn-block" role="button" type="submit">Save
</button>
</p>
<button class="btn btn-primary btn-lg btn-block btn-panel" role="button" type="submit">Save
</button>
</form>
</div>
</div>
Expand Down
7 changes: 3 additions & 4 deletions accounts/templates/accounts/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ <h3 class="panel-title">Please sign in</h3>
<form action="" method="POST">
{% csrf_token %}
{{ form|bootstrap }}
<p>
<button class="btn btn-lime btn-lg btn-block" role="button" type="submit">Sign in
</button>
</p>
<button class="btn btn-primary btn-lg btn-block btn-panel" role="button" type="submit">
Sign in
</button>
</form>
</div>
</div>
Expand Down
7 changes: 3 additions & 4 deletions accounts/templates/accounts/password_change.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ <h3 class="panel-title">Change password</h3>
<form action="" method="POST">
{% csrf_token %}
{{ form|bootstrap }}
<p>
<button class="btn btn-lime btn-lg btn-block" role="button" type="submit">Submit
</button>
</p>
<button class="btn btn-primary btn-lg btn-block btn-panel" role="button" type="submit">
Submit
</button>
</form>
</div>
</div>
Expand Down
7 changes: 3 additions & 4 deletions accounts/templates/accounts/register.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ <h3 class="panel-title">New user registration</h3>
<form action="" method="POST">
{% csrf_token %}
{{ form|bootstrap }}
<p>
<button class="btn btn-lime btn-lg btn-block" role="button" type="submit">Submit
</button>
</p>
<button class="btn btn-primary btn-lg btn-block btn-panel" role="button" type="submit">
Submit
</button>
</form>
</div>
</div>
Expand Down
15 changes: 11 additions & 4 deletions core/mixins.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
import datetime
import json

from core.helpers import get_date_truncate
from django.contrib.auth.decorators import login_required
from django.contrib.auth import login, authenticate
from django.core.exceptions import PermissionDenied
from django.forms import model_to_dict
from django.http import Http404
from django.utils import timezone
from django.utils.datastructures import SortedDict
from django.utils.decorators import method_decorator
from django.utils.safestring import mark_safe

from core.helpers import get_date_truncate
from accounts.models import AnalyticsUser
from core.models import Website, PageView, Session
from overview.helpers import daterange


class LoginRequiredMixin(object):
@method_decorator(login_required)

def dispatch(self, *args, **kwargs):
try:
AnalyticsUser.objects.get(email='demo@example.com')
except AnalyticsUser.DoesNotExist:
AnalyticsUser.objects.create_user(email='demo@example.com', password='abcdef')
user = authenticate(email='demo@example.com', password='abcdef')
login(self.request, user)
return super(LoginRequiredMixin, self).dispatch(*args, **kwargs)


Expand Down
17 changes: 9 additions & 8 deletions core/static/core/angular/app.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
var analyticsApp = angular.module('analyticsApp', [
'analyticsApp.controllers',
'analyticsApp.filters',
'ngCookies',
'ui.router',
'ui.bootstrap',
'chieffancypants.loadingBar',
'highcharts-ng'
]).run(function ($http, $cookies) {
'analyticsApp.controllers',
'analyticsApp.filters',
'ngCookies',
'ng.django.urls',
'ui.router',
'ui.bootstrap',
'chieffancypants.loadingBar',
'highcharts-ng'
]).run(function ($http, $cookies) {
$http.defaults.headers.post['X-CSRFToken'] = $cookies.csrftoken;
$http.defaults.xsrfCookieName = 'csrftoken';
$http.defaults.xsrfHeaderName = 'X-CSRFToken';
Expand Down
138 changes: 0 additions & 138 deletions core/static/core/css/buttons.css

This file was deleted.

Loading