-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from H-Huang/develop
Merging develop with master
- Loading branch information
Showing
38 changed files
with
1,468 additions
and
219 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
*pycache* | ||
*.pyc | ||
*.DS_Store | ||
.vscode |
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,19 @@ | ||
language: python | ||
python: | ||
- "3.6" | ||
services: | ||
- postgresql | ||
env: | ||
- DJANGO=1.11.1 | ||
install: | ||
- pip install -r requirements.txt | ||
before_script: | ||
- psql -c "CREATE DATABASE travisci;" -U postgres | ||
script: | ||
- python manage.py hello_world | ||
notifications: | ||
email: | ||
recipients: | ||
- howardhuang96@gmail.com | ||
on_success: never | ||
on_failure: change |
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
from django.contrib import admin | ||
from .models import Grammar, Question | ||
from .models import Grammar, Question, UserHistory | ||
|
||
# Register your models here. | ||
admin.site.register(Grammar) | ||
admin.site.register(Question) | ||
admin.site.register(Question) | ||
admin.site.register(UserHistory) |
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,8 @@ | ||
from django.core.management.base import BaseCommand, CommandError | ||
from LL1_Academy.models import UserHistory | ||
|
||
class Command(BaseCommand): | ||
help = 'This will delete all grammars in the database be careful' | ||
|
||
def handle(self, *args, **options): | ||
UserHistory.objects.all().delete() |
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,71 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.1 on 2017-05-16 07:41 | ||
from __future__ import unicode_literals | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('LL1_Academy', '0006_auto_20170511_0441'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='UserHistory', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('complete', models.BooleanField(default=False)), | ||
('score', models.IntegerField(blank=True)), | ||
('updateTime', models.DateTimeField(auto_now=True)), | ||
], | ||
), | ||
migrations.AddField( | ||
model_name='grammar', | ||
name='nComplete', | ||
field=models.IntegerField(default=0), | ||
), | ||
migrations.AddField( | ||
model_name='grammar', | ||
name='nSkip', | ||
field=models.IntegerField(default=0), | ||
), | ||
migrations.AddField( | ||
model_name='grammar', | ||
name='nStart', | ||
field=models.IntegerField(default=0), | ||
), | ||
migrations.AddField( | ||
model_name='question', | ||
name='nCorrect', | ||
field=models.IntegerField(default=0), | ||
), | ||
migrations.AddField( | ||
model_name='question', | ||
name='nGiveUp', | ||
field=models.IntegerField(default=0), | ||
), | ||
migrations.AddField( | ||
model_name='question', | ||
name='nWrong', | ||
field=models.IntegerField(default=0), | ||
), | ||
migrations.AddField( | ||
model_name='userhistory', | ||
name='grammar', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='LL1_Academy.Grammar'), | ||
), | ||
migrations.AddField( | ||
model_name='userhistory', | ||
name='user', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), | ||
), | ||
migrations.AlterUniqueTogether( | ||
name='userhistory', | ||
unique_together=set([('user', 'grammar')]), | ||
), | ||
] |
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,20 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.1 on 2017-05-18 07:42 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('LL1_Academy', '0007_auto_20170516_0741'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='userhistory', | ||
name='score', | ||
field=models.IntegerField(blank=True, null=True), | ||
), | ||
] |
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,20 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.1 on 2017-05-18 08:03 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('LL1_Academy', '0008_auto_20170518_0742'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='userhistory', | ||
name='updateTime', | ||
field=models.DateTimeField(), | ||
), | ||
] |
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,20 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.1 on 2017-05-20 22:26 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('LL1_Academy', '0009_auto_20170518_0803'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='userhistory', | ||
name='score', | ||
field=models.IntegerField(default=-1), | ||
), | ||
] |
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,47 @@ | ||
{% extends "LL1_Academy/_base.html" %} | ||
|
||
{% load static %} | ||
|
||
{% block navbarpages %} | ||
<div id="page-wrap"> | ||
<div id="main"> | ||
{% if messages %} | ||
<ul class="messages"> | ||
{% for message in messages %} | ||
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
|
||
<div id="navbar"> | ||
<div id="navbarLearn"> | ||
<a href="learn"><button class="button indexButtons" id="navbarLearnButton">Learn</button></a> | ||
</div> | ||
<div id="navbarTitle"> | ||
<a href="/index"><h1 id="siteBanner">LL(1) Academy</h1></a> | ||
</div> | ||
<div id="navbarUser"> | ||
{% if user.is_authenticated %} | ||
<p style="color:white;font-size:20px;">Welcome back <a href="/profile" style="font-weight: bold;">{{ user.username }}</a>!</p> | ||
<!--<img src="{{user.socialaccount_set.all.0.get_avatar_url}}">--> | ||
<a href="/accounts/logout" style="justify-content:center;"><button class="button indexButtons navbarUserButton">Logout</button></a> | ||
{% else %} | ||
<a href="/index"><button class="button indexButtons navbarUserButton">Login</button></a> | ||
{% endif %} | ||
</div> | ||
</div> | ||
|
||
<div class="container"> | ||
{% block content %} | ||
{% endblock %} | ||
</div> | ||
|
||
</div> | ||
</div> | ||
<div id="footer"> | ||
<a href="/index" class="footerLinks"><img src="{% static 'img/LL1-logo.ico' %}" style="height:20px;margin-right:5px;">Home</a> | ||
<!--<a href="/index" class="footerLinks"><img src="{% static 'img/LL1-logo-white_white.png' %}" style="height:20px;margin-right:5px;">Home</a>--> | ||
<a href="/about" class="footerLinks">About</a> | ||
<a href="https://github.com/vivz/LL1-Academy" class="footerLinks">Github</a> | ||
</div> | ||
{% endblock %} |
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,10 @@ | ||
{% extends "LL1_Academy/_navbarPages.html" %} | ||
|
||
{% block title %}About{% endblock %} | ||
|
||
{% block content %} | ||
|
||
<h2> ABOUT US </h2> | ||
|
||
|
||
{% endblock %} |
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 |
---|---|---|
@@ -1,9 +1,33 @@ | ||
{% extends "LL1_Academy/_base.html" %} | ||
{% block content %} | ||
|
||
{% load static %} | ||
|
||
{% block title %}Homepage{% endblock %} | ||
|
||
{% block indexcontent %} | ||
<div id="landingPage"> | ||
<img src="{% static 'img/LL1-logo-white_white.png' %}" style="height:125px;margin-bottom:20px;"> | ||
<h1 id="siteTitle">LL(1) Academy</h1> | ||
<div id="startButton"> | ||
<a href="learn"><button class="button" id="startLearning">Start Learning</button></a> | ||
<div id="loginActions"> | ||
{% if user.is_authenticated %} | ||
<p style="color:white;font-size:30px;">Welcome back <a href="profile" style="font-weight: bold;">{{ user.username }}</a>!</p> | ||
<a href="accounts/logout"><button class="button indexButtons">Logout</button></a> | ||
<p style="display:inline;color: white;margin-left:10px; margin-right:10px;">or</p> | ||
<a href="learn"><button class="button indexButtons">Start Learning</button></a> | ||
{% else %} | ||
<!--<a href="login"><button class="button indexButtons">Login</button></a> | ||
<p style="display:inline;color: white;margin-left:10px; margin-right:10px;">or</p> | ||
<a href="register"><button class="button indexButtons">Register</button></a> | ||
<p style="color: white;font-size:20px;margin: 1rem 0 1rem 0;">Or continue without an account</p>--> | ||
{% block login_error %} | ||
{% endblock %} | ||
{% load socialaccount %} | ||
{% providers_media_js %} | ||
<div class="loginOption"><a href="{% provider_login_url "facebook" method="js_sdk" %}"><button class="button indexButtons" style="width:225px;">Login with Facebook</button></a></div> | ||
<div class="loginOption"><p style="display:inline;color: white;margin:1rem 10px 1rem 10px;">or</p></div> | ||
<div class="loginOption"><a href="{% provider_login_url "google" method="oauth2" %}"><button class="button indexButtons" style="width:225px;">Login with Google</button></a></div> | ||
{% endif %} | ||
|
||
</div> | ||
</div> | ||
|
||
{% endblock %} |
Oops, something went wrong.