├── requirements.txt
├── deductivereasoning
├── proofs
│ ├── __init__.py
│ ├── migrations
│ │ ├── __init__.py
│ │ ├── 0002_proof_form_type.py
│ │ └── 0001_initial.py
│ ├── tests.py
│ ├── apps.py
│ ├── admin.py
│ ├── models.py
│ ├── forms.py
│ └── views.py
├── accounts
│ ├── __init__.py
│ ├── migrations
│ │ └── __init__.py
│ ├── models.py
│ ├── tests.py
│ ├── admin.py
│ ├── apps.py
│ ├── views.py
│ └── forms.py
├── comments
│ ├── __init__.py
│ ├── migrations
│ │ ├── __init__.py
│ │ └── 0001_initial.py
│ ├── tests.py
│ ├── apps.py
│ ├── admin.py
│ ├── forms.py
│ └── models.py
├── deductivereasoning
│ ├── __init__.py
│ ├── wsgi.py
│ ├── urls.py
│ └── settings.py
├── static
│ ├── logo.png
│ ├── github.png
│ ├── facebook.png
│ ├── favicon.ico
│ ├── twitter.png
│ ├── layout
│ │ └── styles
│ │ │ ├── reset.css
│ │ │ └── base.css
│ └── js
│ │ └── submit.js
├── templates
│ ├── about.html
│ ├── accounts
│ │ ├── dashboard.html
│ │ └── profile.html
│ ├── registration
│ │ ├── login.html
│ │ └── signup.html
│ ├── proposition_detail.html
│ ├── home.html
│ ├── submit.html
│ └── base.html
└── manage.py
├── LICENSE
├── .gitignore
└── README.md
/requirements.txt:
--------------------------------------------------------------------------------
1 | django
2 |
--------------------------------------------------------------------------------
/deductivereasoning/proofs/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/deductivereasoning/accounts/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/deductivereasoning/comments/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/deductivereasoning/proofs/migrations/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/deductivereasoning/accounts/migrations/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/deductivereasoning/comments/migrations/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/deductivereasoning/deductivereasoning/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/deductivereasoning/accounts/models.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
4 |
--------------------------------------------------------------------------------
/deductivereasoning/accounts/tests.py:
--------------------------------------------------------------------------------
1 | from django.test import TestCase
2 |
3 | # Create your tests here.
4 |
--------------------------------------------------------------------------------
/deductivereasoning/comments/tests.py:
--------------------------------------------------------------------------------
1 | from django.test import TestCase
2 |
3 | # Create your tests here.
4 |
--------------------------------------------------------------------------------
/deductivereasoning/proofs/tests.py:
--------------------------------------------------------------------------------
1 | from django.test import TestCase
2 |
3 | # Create your tests here.
4 |
--------------------------------------------------------------------------------
/deductivereasoning/accounts/admin.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 |
3 | # Register your models here.
4 |
--------------------------------------------------------------------------------
/deductivereasoning/static/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lyk2018-python/deductive-reasoning/HEAD/deductivereasoning/static/logo.png
--------------------------------------------------------------------------------
/deductivereasoning/proofs/apps.py:
--------------------------------------------------------------------------------
1 | from django.apps import AppConfig
2 |
3 |
4 | class ProofsConfig(AppConfig):
5 | name = 'proofs'
6 |
--------------------------------------------------------------------------------
/deductivereasoning/static/github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lyk2018-python/deductive-reasoning/HEAD/deductivereasoning/static/github.png
--------------------------------------------------------------------------------
/deductivereasoning/accounts/apps.py:
--------------------------------------------------------------------------------
1 | from django.apps import AppConfig
2 |
3 |
4 | class AccountsConfig(AppConfig):
5 | name = 'accounts'
6 |
--------------------------------------------------------------------------------
/deductivereasoning/comments/apps.py:
--------------------------------------------------------------------------------
1 | from django.apps import AppConfig
2 |
3 |
4 | class CommentsConfig(AppConfig):
5 | name = 'Comments'
6 |
--------------------------------------------------------------------------------
/deductivereasoning/static/facebook.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lyk2018-python/deductive-reasoning/HEAD/deductivereasoning/static/facebook.png
--------------------------------------------------------------------------------
/deductivereasoning/static/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lyk2018-python/deductive-reasoning/HEAD/deductivereasoning/static/favicon.ico
--------------------------------------------------------------------------------
/deductivereasoning/static/twitter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lyk2018-python/deductive-reasoning/HEAD/deductivereasoning/static/twitter.png
--------------------------------------------------------------------------------
/deductivereasoning/comments/admin.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 | from .models import *
3 | admin.site.register(Comment)
4 | # Register your models here.
5 |
--------------------------------------------------------------------------------
/deductivereasoning/comments/forms.py:
--------------------------------------------------------------------------------
1 | from django import forms
2 | from .models import Comment
3 |
4 | class CommentForm(forms.ModelForm):
5 | class Meta:
6 | model = Comment
7 | fields = ('text',)
--------------------------------------------------------------------------------
/deductivereasoning/proofs/admin.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 | from proofs.models import Proposition, Proof
3 |
4 | # Register your models here.
5 | admin.site.register(Proposition)
6 | admin.site.register(Proof)
7 |
--------------------------------------------------------------------------------
/deductivereasoning/templates/about.html:
--------------------------------------------------------------------------------
1 | {% extends "base.html" %}
2 |
3 | {% block title %}{{ 'About Page' }}{% endblock %}
4 |
5 | {% block content %}
6 |
7 |
This site made in "Mustafa Akgül Özgür Yazılım Yaz Kampı" as a django course project and gives you a deductive reasoning tool.
8 |
You can check the validity of primeses and conclusion via our tool.
9 | Have Fun!
10 |
11 | {% endblock %}
12 |
--------------------------------------------------------------------------------
/deductivereasoning/deductivereasoning/wsgi.py:
--------------------------------------------------------------------------------
1 | """
2 | WSGI config for deductivereasoning project.
3 |
4 | It exposes the WSGI callable as a module-level variable named ``application``.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
8 | """
9 |
10 | import os
11 |
12 | from django.core.wsgi import get_wsgi_application
13 |
14 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "deductivereasoning.settings")
15 |
16 | application = get_wsgi_application()
17 |
--------------------------------------------------------------------------------
/deductivereasoning/comments/models.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 | from proofs.models import *
3 | from django.conf import settings
4 |
5 | class Comment(models.Model):
6 | modelObject=models.ForeignKey(Proof,on_delete=models.CASCADE)
7 | user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, null=True)
8 | text=models.TextField()
9 | created_date=models.DateField(auto_now_add=True)
10 |
11 | def __str__(self):
12 | return self.text
13 |
14 |
15 | # Create your models here.
16 |
--------------------------------------------------------------------------------
/deductivereasoning/proofs/migrations/0002_proof_form_type.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.1 on 2018-08-17 19:46
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('proofs', '0001_initial'),
10 | ]
11 |
12 | operations = [
13 | migrations.AddField(
14 | model_name='proof',
15 | name='form_type',
16 | field=models.CharField(default='none', max_length=15),
17 | preserve_default=False,
18 | ),
19 | ]
20 |
--------------------------------------------------------------------------------
/deductivereasoning/manage.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | import os
3 | import sys
4 |
5 | if __name__ == "__main__":
6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "deductivereasoning.settings")
7 | try:
8 | from django.core.management import execute_from_command_line
9 | except ImportError as exc:
10 | raise ImportError(
11 | "Couldn't import Django. Are you sure it's installed and "
12 | "available on your PYTHONPATH environment variable? Did you "
13 | "forget to activate a virtual environment?"
14 | ) from exc
15 | execute_from_command_line(sys.argv)
16 |
--------------------------------------------------------------------------------
/deductivereasoning/templates/accounts/dashboard.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html' %}
2 |
3 | {% block title %}{{ title }}{% endblock %}
4 |
5 | {% block content %}
6 |
7 |
Welcome {{ user.username }}
8 | {% if user.first_name and user.last_name %}
9 | Name: {{ user.first_name }}
10 |
11 | Surname: {{ user.last_name }}
12 |
13 | {% endif %}
14 | Username: {{ user.username }}
15 |
16 | {% if user.email %}
17 | User Email: {{ user.email }}
18 |
19 | {% endif %}
20 | Last Login: {{ user.last_login }}
21 |
22 | Date Joined: {{ user.date_joined }}
23 |
24 | {% endblock %}
25 |
--------------------------------------------------------------------------------
/deductivereasoning/templates/accounts/profile.html:
--------------------------------------------------------------------------------
1 | {% extends "base.html" %}
2 |
3 | {% block title %}{{ title }}{% endblock %}
4 |
5 | {% block content %}
6 |
7 |
{{ user.username }}
8 | {% if user.first_name and user.last_name %}
9 | Name: {{ user.first_name }}
10 |
11 | Surname: {{ user.last_name }}
12 |
13 | {% endif %}
14 | Username: {{ user.username }}
15 |
16 | {% if user.email %}
17 | User Email: {{ user.email }}
18 |
19 | {% endif %}
20 | {% if numOfConcs %}
21 | Number of conclusions created by user: {{ numOfConcs }}
22 |
23 | {% endif %}
24 | Last Login: {{ user.last_login }}
25 |
26 | Date Joined: {{ user.date_joined }}
27 |
28 | {% endblock %}
--------------------------------------------------------------------------------
/deductivereasoning/templates/registration/login.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html' %}
2 | {% block title %}Login{% endblock %}
3 |
4 | {% block content %}
5 |
28 | {% endblock %}
29 |
--------------------------------------------------------------------------------
/deductivereasoning/comments/migrations/0001_initial.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.0.7 on 2018-08-03 15:29
2 |
3 | from django.conf import settings
4 | from django.db import migrations, models
5 | import django.db.models.deletion
6 |
7 |
8 | class Migration(migrations.Migration):
9 |
10 | initial = True
11 |
12 | dependencies = [
13 | ('proofs', '0001_initial'),
14 | migrations.swappable_dependency(settings.AUTH_USER_MODEL),
15 | ]
16 |
17 | operations = [
18 | migrations.CreateModel(
19 | name='Comment',
20 | fields=[
21 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
22 | ('text', models.TextField()),
23 | ('created_date', models.DateField(auto_now_add=True)),
24 | ('modelObject', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='proofs.Proof')),
25 | ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
26 | ],
27 | ),
28 | ]
29 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 lyk2018-python
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/deductivereasoning/static/layout/styles/reset.css:
--------------------------------------------------------------------------------
1 | /* http://meyerweb.com/eric/tools/css/reset/
2 | v2.0 | 20110126
3 | License: none (public domain)
4 | */
5 |
6 | html, body, div, span, applet, object, iframe,
7 | h1, h2, h3, h4, h5, h6, p, blockquote, pre,
8 | a, abbr, acronym, address, big, cite, code,
9 | del, dfn, em, img, ins, kbd, q, s, samp,
10 | small, strike, strong, sub, sup, tt, var,
11 | b, u, i, center,
12 | dl, dt, dd, ol, ul, li,
13 | fieldset, form, label, legend,
14 | table, caption, tbody, tfoot, thead, tr, th, td,
15 | article, aside, canvas, details, embed,
16 | figure, figcaption, footer, header, hgroup,
17 | menu, nav, output, ruby, section, summary,
18 | time, mark, audio, video {
19 | margin: 0;
20 | padding: 0;
21 | border: 0;
22 | font-size: 100%;
23 | font: inherit;
24 | vertical-align: baseline;
25 | }
26 | /* HTML5 display-role reset for older browsers */
27 | article, aside, details, figcaption, figure,
28 | footer, header, hgroup, menu, nav, section {
29 | display: block;
30 | }
31 | body {
32 | line-height: 1;
33 | }
34 | ol, ul {
35 | list-style: none;
36 | }
37 | blockquote, q {
38 | quotes: none;
39 | }
40 | blockquote:before, blockquote:after,
41 | q:before, q:after {
42 | content: '';
43 | content: none;
44 | }
45 | table {
46 | border-collapse: collapse;
47 | border-spacing: 0;
48 | }
49 |
--------------------------------------------------------------------------------
/deductivereasoning/accounts/views.py:
--------------------------------------------------------------------------------
1 | from django.contrib.auth import login, authenticate
2 | from django.shortcuts import render, redirect
3 | from django.contrib.auth.forms import UserCreationForm
4 | from django.contrib.auth.models import User
5 | from .forms import CustomUserCreationForm
6 | from django.contrib import messages
7 | from proofs.models import *
8 |
9 |
10 | def signup(request):
11 | if request.method == 'POST':
12 | form = CustomUserCreationForm(request.POST)
13 | if form.is_valid():
14 | form.save()
15 | user = authenticate(username=form.cleaned_data['username'], password=form.cleaned_data['password1'])
16 | login(request, user)
17 | return redirect('home')
18 | else:
19 | form = CustomUserCreationForm()
20 | return render(request, 'registration/signup.html', {'form': form})
21 |
22 | def profile(request, username):
23 | user = User.objects.get(username=username)
24 | proofs = Proof.objects.all();
25 | num_of_concs = 0
26 | for i in range(len(proofs)):
27 | if proofs[i].minor.user == user:
28 | num_of_concs += 1
29 | return render(request, 'accounts/profile.html', {
30 | 'user': user,
31 | 'numOfConcs': num_of_concs,
32 | })
33 |
34 | def dashboard(request):
35 | return render(request, 'accounts/dashboard.html', {'title': 'Profile Page'})
36 |
--------------------------------------------------------------------------------
/deductivereasoning/templates/proposition_detail.html:
--------------------------------------------------------------------------------
1 | {% extends "base.html" %}
2 |
3 | {% block title %}{{ title }}{% endblock %}
4 | {% block content %}
5 |
19 |