└── stackprj ├── db.sqlite3 ├── manage.py ├── media ├── default.jpg └── profile_pic │ ├── 242989057_582281286238891_5985422734923016994_n.jpg │ ├── 243552539_239717571446640_6744186283718526694_n.jpg │ └── AAPL_2021-10-03_22-30-50.png ├── stackbase ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-39.pyc │ ├── admin.cpython-39.pyc │ ├── apps.cpython-39.pyc │ ├── forms.cpython-39.pyc │ ├── models.cpython-39.pyc │ ├── urls.cpython-39.pyc │ └── views.cpython-39.pyc ├── admin.py ├── apps.py ├── forms.py ├── migrations │ ├── 0001_initial.py │ ├── 0002_question_user.py │ ├── 0003_auto_20211011_0037.py │ ├── 0004_question_likes.py │ ├── 0005_auto_20211011_2351.py │ ├── __init__.py │ └── __pycache__ │ │ ├── 0001_initial.cpython-39.pyc │ │ ├── 0002_question_user.cpython-39.pyc │ │ ├── 0003_auto_20211011_0037.cpython-39.pyc │ │ ├── 0004_question_likes.cpython-39.pyc │ │ ├── 0005_auto_20211011_2351.cpython-39.pyc │ │ └── __init__.cpython-39.pyc ├── models.py ├── templates │ └── stackbase │ │ ├── question-answer.html │ │ ├── question_confirm_delete.html │ │ ├── question_detail.html │ │ ├── question_form.html │ │ └── question_list.html ├── tests.py ├── urls.py └── views.py ├── stackprj ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-39.pyc │ ├── settings.cpython-39.pyc │ ├── urls.cpython-39.pyc │ └── wsgi.cpython-39.pyc ├── asgi.py ├── settings.py ├── urls.py └── wsgi.py ├── stackusers ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-39.pyc │ ├── admin.cpython-39.pyc │ ├── apps.cpython-39.pyc │ ├── forms.cpython-39.pyc │ ├── models.cpython-39.pyc │ ├── signals.cpython-39.pyc │ └── views.cpython-39.pyc ├── admin.py ├── apps.py ├── forms.py ├── migrations │ ├── 0001_initial.py │ ├── 0002_auto_20211007_0118.py │ ├── 0003_alter_profile_phone.py │ ├── __init__.py │ └── __pycache__ │ │ ├── 0001_initial.cpython-39.pyc │ │ ├── 0002_auto_20211007_0118.cpython-39.pyc │ │ ├── 0003_alter_profile_phone.cpython-39.pyc │ │ └── __init__.cpython-39.pyc ├── models.py ├── signals.py ├── templates │ └── stackusers │ │ ├── login.html │ │ ├── logout.html │ │ ├── profile.html │ │ ├── profile_update.html │ │ └── register.html ├── tests.py └── views.py ├── static ├── main.css ├── main.js └── main.scss └── templates ├── base.html └── home.html /stackprj/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/db.sqlite3 -------------------------------------------------------------------------------- /stackprj/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'stackprj.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /stackprj/media/default.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/media/default.jpg -------------------------------------------------------------------------------- /stackprj/media/profile_pic/242989057_582281286238891_5985422734923016994_n.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/media/profile_pic/242989057_582281286238891_5985422734923016994_n.jpg -------------------------------------------------------------------------------- /stackprj/media/profile_pic/243552539_239717571446640_6744186283718526694_n.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/media/profile_pic/243552539_239717571446640_6744186283718526694_n.jpg -------------------------------------------------------------------------------- /stackprj/media/profile_pic/AAPL_2021-10-03_22-30-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/media/profile_pic/AAPL_2021-10-03_22-30-50.png -------------------------------------------------------------------------------- /stackprj/stackbase/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackbase/__init__.py -------------------------------------------------------------------------------- /stackprj/stackbase/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackbase/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackbase/__pycache__/admin.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackbase/__pycache__/admin.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackbase/__pycache__/apps.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackbase/__pycache__/apps.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackbase/__pycache__/forms.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackbase/__pycache__/forms.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackbase/__pycache__/models.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackbase/__pycache__/models.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackbase/__pycache__/urls.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackbase/__pycache__/urls.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackbase/__pycache__/views.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackbase/__pycache__/views.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackbase/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import Question, Comment 3 | 4 | admin.site.register(Question) 5 | admin.site.register(Comment) 6 | -------------------------------------------------------------------------------- /stackprj/stackbase/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class StackbaseConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'stackbase' 7 | -------------------------------------------------------------------------------- /stackprj/stackbase/forms.py: -------------------------------------------------------------------------------- 1 | from .models import Comment 2 | from django import forms 3 | 4 | 5 | class CommentForm(forms.ModelForm): 6 | class Meta: 7 | model = Comment 8 | fields = ['name', 'content'] 9 | 10 | widgets = { 11 | 'name': forms.TextInput(attrs={'class': 'form-control' }), 12 | 'body': forms.Textarea(attrs={'class': 'form-control'}), 13 | } -------------------------------------------------------------------------------- /stackprj/stackbase/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.8 on 2021-10-07 22:28 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | initial = True 9 | 10 | dependencies = [ 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='Question', 16 | fields=[ 17 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 18 | ('title', models.CharField(max_length=10000)), 19 | ('content', models.TextField(blank=True, null=True)), 20 | ('date_created', models.DateTimeField(auto_now_add=True)), 21 | ], 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /stackprj/stackbase/migrations/0002_question_user.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.8 on 2021-10-07 22:32 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 | dependencies = [ 11 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 12 | ('stackbase', '0001_initial'), 13 | ] 14 | 15 | operations = [ 16 | migrations.AddField( 17 | model_name='question', 18 | name='user', 19 | field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='auth.user'), 20 | preserve_default=False, 21 | ), 22 | ] 23 | -------------------------------------------------------------------------------- /stackprj/stackbase/migrations/0003_auto_20211011_0037.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.8 on 2021-10-10 23:37 2 | 3 | from django.db import migrations, models 4 | import django.db.models.deletion 5 | import django.utils.timezone 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('stackbase', '0002_question_user'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='question', 17 | name='date_created', 18 | field=models.DateTimeField(default=django.utils.timezone.now), 19 | ), 20 | migrations.CreateModel( 21 | name='Comment', 22 | fields=[ 23 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 24 | ('name', models.CharField(max_length=1000)), 25 | ('content', models.TextField(blank=True, null=True)), 26 | ('date_created', models.DateTimeField(default=django.utils.timezone.now)), 27 | ('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comment', to='stackbase.question')), 28 | ], 29 | ), 30 | ] 31 | -------------------------------------------------------------------------------- /stackprj/stackbase/migrations/0004_question_likes.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.8 on 2021-10-11 21:52 2 | 3 | from django.conf import settings 4 | from django.db import migrations, models 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 11 | ('stackbase', '0003_auto_20211011_0037'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='question', 17 | name='likes', 18 | field=models.ManyToManyField(related_name='question_post', to=settings.AUTH_USER_MODEL), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /stackprj/stackbase/migrations/0005_auto_20211011_2351.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.8 on 2021-10-11 22:51 2 | 3 | import ckeditor.fields 4 | from django.db import migrations 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('stackbase', '0004_question_likes'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AlterField( 15 | model_name='comment', 16 | name='content', 17 | field=ckeditor.fields.RichTextField(), 18 | ), 19 | migrations.AlterField( 20 | model_name='question', 21 | name='content', 22 | field=ckeditor.fields.RichTextField(), 23 | ), 24 | ] 25 | -------------------------------------------------------------------------------- /stackprj/stackbase/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackbase/migrations/__init__.py -------------------------------------------------------------------------------- /stackprj/stackbase/migrations/__pycache__/0001_initial.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackbase/migrations/__pycache__/0001_initial.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackbase/migrations/__pycache__/0002_question_user.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackbase/migrations/__pycache__/0002_question_user.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackbase/migrations/__pycache__/0003_auto_20211011_0037.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackbase/migrations/__pycache__/0003_auto_20211011_0037.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackbase/migrations/__pycache__/0004_question_likes.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackbase/migrations/__pycache__/0004_question_likes.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackbase/migrations/__pycache__/0005_auto_20211011_2351.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackbase/migrations/__pycache__/0005_auto_20211011_2351.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackbase/migrations/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackbase/migrations/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackbase/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.urls import reverse 3 | from django.utils import timezone 4 | from django.contrib.auth.models import User 5 | from ckeditor.fields import RichTextField 6 | 7 | class Question(models.Model): 8 | user = models.ForeignKey(User, on_delete=models.CASCADE) 9 | title = models.CharField(max_length=10000) 10 | # content = models.TextField(null=True, blank=True) 11 | content = RichTextField() 12 | likes = models.ManyToManyField(User, related_name='question_post') 13 | date_created = models.DateTimeField(default=timezone.now) 14 | 15 | def __str__(self): 16 | return f'{self.user.username} - Question' 17 | 18 | def get_absolute_url(self): 19 | return reverse('stackbase:question-detail', kwargs={'pk':self.pk}) 20 | 21 | def total_likes(self): 22 | return self.likes.count() 23 | 24 | class Comment(models.Model): 25 | question = models.ForeignKey(Question, related_name="comment", on_delete=models.CASCADE) 26 | name = models.CharField(max_length=1000) 27 | content = RichTextField() 28 | date_created = models.DateTimeField(default=timezone.now) 29 | 30 | def __str__(self): 31 | return '%s - %s' % (self.question.title, self.question.user) 32 | 33 | def get_success_url(self): 34 | return reverse('stackbase:question-detail', kwargs={'pk':self.pk}) 35 | 36 | def save(self, *args, **kwargs): 37 | super().save(*args, **kwargs) -------------------------------------------------------------------------------- /stackprj/stackbase/templates/stackbase/question-answer.html: -------------------------------------------------------------------------------- 1 | 2 | {% extends 'base.html' %} 3 | {% load crispy_forms_tags %} 4 | 5 | {% block content %} 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 160 | 161 | 162 |
163 |
164 |
165 | 166 |
167 |
168 | 175 |
176 |
177 |
178 | 179 |
180 | {% csrf_token %} 181 | {{form|crispy}} 182 | {{ form.media }} 183 | 184 | Cancel 185 |
186 | 187 | 188 | 189 |
190 | 191 |
192 | 197 |
198 |
199 |
200 |
201 |
202 |
203 | 204 | 205 | 208 | 209 | 210 | {% endblock content %} -------------------------------------------------------------------------------- /stackprj/stackbase/templates/stackbase/question_confirm_delete.html: -------------------------------------------------------------------------------- 1 | 2 | {% extends 'base.html' %} 3 | 4 | {% block content %} 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Delete Question 13 | 14 | 15 | 92 | 93 | 94 |
95 | {% csrf_token %} 96 |
97 |

Do you wanna delete this question? {{ question.title }}

98 |
99 | 100 | 101 | Cancel 102 |
103 |
104 |
105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 116 | 117 | 118 | {% endblock content %} -------------------------------------------------------------------------------- /stackprj/stackbase/templates/stackbase/question_detail.html: -------------------------------------------------------------------------------- 1 | 2 | {% extends 'base.html' %} 3 | {% block content %} 4 | 5 | 6 | 7 | 8 | 9 | 10 | Document 11 | 12 | 13 | 80 | 81 | 82 |
83 | 91 |
92 |
93 |
94 |

{{question.title}}

95 |
96 |
{{ question.content|safe }}
97 |
98 |
Asked By: {{ object.user|title }}    |    On: {{ object.date_created|date:"j F, Y" }}
99 |
100 |
101 | {% csrf_token %} 102 | {% if user.is_authenticated %} 103 | {% if liked %} 104 |
105 |
| {{ total_likes }} Likes
106 |
107 | {% else %} 108 |
109 |
| {{ total_likes }} Likes
110 |
111 | {% endif %} 112 | {% else %} 113 |
Login to Like Question | {{ total_likes }} Likes
114 | {% endif %} 115 | 116 |
117 |
118 |

Answers...




119 | 120 | {% if not question.comment.all %} 121 |

No Answers yet... Answer Question

122 | {% else %} 123 | {% for comment in question.comment.all %} 124 |

{{comment.content|safe}}

125 |

Answered by: {{comment.name}} - On: {{comment.date_created|date:"j F, Y"}}

126 |
127 | {% endfor %} 128 | {% endif %} 129 | 130 | 131 | 132 | 161 | 162 | Answer Question 163 | 164 | 165 | 166 |


167 | 168 | 169 |

170 |
171 |
172 |
173 | 174 | 175 | 177 | 178 | 179 | {% endblock content %} -------------------------------------------------------------------------------- /stackprj/stackbase/templates/stackbase/question_form.html: -------------------------------------------------------------------------------- 1 | 2 | {% extends 'base.html' %} 3 | {% load static %} 4 | {% load crispy_forms_tags %} 5 | 6 | {% block content %} 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 161 | 162 | 163 |
164 |
165 |
166 | 167 |
168 |
169 | 176 |
177 |
178 |
179 |
180 | {% csrf_token %} 181 | {{form|crispy}} 182 | 183 | Cancel 184 | 185 |
186 |
187 | 188 | 189 |
190 | 195 |
196 |
197 |
198 |
199 |
200 |
201 | 202 | 203 | 206 | 207 | 208 | {% endblock content %} -------------------------------------------------------------------------------- /stackprj/stackbase/templates/stackbase/question_list.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block content %} 3 | 4 | 5 | 6 | 7 | 8 | 9 | Document 10 | 11 | 12 | 83 | 84 | 85 |
86 | 94 |
95 |
96 | {% for question in questions %} 97 |
98 |
99 | 100 |

{{ question.title }}

101 |
102 |
103 | {% if question.content|wordcount <= 10 %} 104 |
{{ question.content}}
105 | {% else %} 106 |
{{ question.content|truncatewords:10}} Read More
107 | {% endif %} 108 |
Asked By: {{ question.user }}    |    On: {{question.date_created|date:"j F, Y"}}
109 |
Tags
110 |

111 | {% endfor %} 112 |
113 |
114 |
115 | 116 | 117 | {% endblock content %} -------------------------------------------------------------------------------- /stackprj/stackbase/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /stackprj/stackbase/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | 4 | app_name = 'stackbase' 5 | 6 | urlpatterns = [ 7 | path('', views.home, name="home"), 8 | path('about/', views.about, name="about"), 9 | 10 | # CRUD Function 11 | path('questions/', views.QuestionListView.as_view(), name="question-lists"), 12 | path('questions/new/', views.QuestionCreateView.as_view(), name="question-create"), 13 | path('questions//', views.QuestionDetailView.as_view(), name="question-detail"), 14 | path('questions//update/', views.QuestionUpdateView.as_view(), name="question-update"), 15 | path('questions//delete/', views.QuestionDeleteView.as_view(), name="question-delete"), 16 | path('questions//comment/', views.AddCommentView.as_view(), name="question-comment"), 17 | path('like/', views.like_view, name="like_post") 18 | 19 | ] 20 | -------------------------------------------------------------------------------- /stackprj/stackbase/views.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.shortcuts import render, get_object_or_404 3 | from django.http import HttpResponseRedirect 4 | from django.views.generic import ListView, DetailView, CreateView, UpdateView, DeleteView 5 | from django.contrib.auth.mixins import UserPassesTestMixin, LoginRequiredMixin 6 | from .models import Question, Comment 7 | from .forms import CommentForm 8 | from django.urls import reverse, reverse_lazy 9 | 10 | def home(request): 11 | return render(request, 'home.html') 12 | 13 | def about(request): 14 | return render(request, 'about.html') 15 | 16 | # CRUD Function 17 | def like_view(request, pk): 18 | post = get_object_or_404(Question, id=request.POST.get('question_id')) 19 | liked = False 20 | if post.likes.filter(id=request.user.id).exists(): 21 | post.likes.remove(request.user) 22 | liked = False 23 | else: 24 | post.likes.add(request.user) 25 | liked = True 26 | return HttpResponseRedirect(reverse('stackbase:question-detail', args=[str(pk)])) 27 | 28 | class QuestionListView(ListView): 29 | model = Question 30 | context_object_name = 'questions' 31 | ordering = ['-date_created'] 32 | 33 | def get_context_data(self, **kwargs): 34 | context = super().get_context_data(**kwargs) 35 | search_input = self.request.GET.get('search-area') or "" 36 | if search_input: 37 | context['questions'] = context['questions'].filter(title__icontains = search_input) 38 | context['search_input'] = search_input 39 | return context 40 | 41 | class QuestionDetailView(DetailView): 42 | model = Question 43 | 44 | def get_context_data(self, *args, **kwargs): 45 | context = super(QuestionDetailView, self).get_context_data() 46 | something = get_object_or_404(Question, id=self.kwargs['pk']) 47 | total_likes = something.total_likes() 48 | liked = False 49 | if something.likes.filter(id=self.request.user.id).exists(): 50 | liked = True 51 | 52 | context['total_likes'] = total_likes 53 | context['liked'] = liked 54 | return context 55 | 56 | class QuestionCreateView(LoginRequiredMixin, CreateView): 57 | model = Question 58 | fields = ['title', 'content'] 59 | context_object_name = 'question' 60 | 61 | def form_valid(self, form): 62 | form.instance.user = self.request.user 63 | return super().form_valid(form) 64 | 65 | class QuestionUpdateView(UserPassesTestMixin, LoginRequiredMixin, UpdateView): 66 | model = Question 67 | fields = ['title', 'content'] 68 | 69 | def form_valid(self, form): 70 | form.instance.user = self.request.user 71 | return super().form_valid(form) 72 | 73 | def test_func(self): 74 | questions = self.get_object() 75 | if self.request.user == questions.user: 76 | return True 77 | return False 78 | 79 | class QuestionDeleteView(UserPassesTestMixin, LoginRequiredMixin, DeleteView): 80 | model = Question 81 | context_object_name = 'question' 82 | success_url = "/" 83 | 84 | def test_func(self): 85 | questions = self.get_object() 86 | if self.request.user == questions.user: 87 | return True 88 | return False 89 | 90 | class CommentDetailView(CreateView): 91 | model = Comment 92 | form_class = CommentForm 93 | template_name = 'stackbase/question-detail.html' 94 | 95 | def form_valid(self, form): 96 | form.instance.question_id = self.kwargs['pk'] 97 | return super().form_valid(form) 98 | success_url = reverse_lazy('stackbase:question-detail') 99 | 100 | class AddCommentView(CreateView): 101 | model = Comment 102 | form_class = CommentForm 103 | 104 | template_name = 'stackbase/question-answer.html' 105 | 106 | def form_valid(self, form): 107 | form.instance.question_id = self.kwargs['pk'] 108 | return super().form_valid(form) 109 | success_url = reverse_lazy('stackbase:question-lists') 110 | -------------------------------------------------------------------------------- /stackprj/stackprj/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackprj/__init__.py -------------------------------------------------------------------------------- /stackprj/stackprj/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackprj/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackprj/__pycache__/settings.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackprj/__pycache__/settings.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackprj/__pycache__/urls.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackprj/__pycache__/urls.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackprj/__pycache__/wsgi.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackprj/__pycache__/wsgi.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackprj/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for stackprj project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'stackprj.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /stackprj/stackprj/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for stackprj project. 3 | 4 | Generated by 'django-admin startproject' using Django 3.2.8. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.2/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/3.2/ref/settings/ 11 | """ 12 | 13 | from pathlib import Path 14 | import os 15 | 16 | # Build paths inside the project like this: BASE_DIR / 'subdir'. 17 | BASE_DIR = Path(__file__).resolve().parent.parent 18 | 19 | 20 | # Quick-start development settings - unsuitable for production 21 | # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/ 22 | 23 | # SECURITY WARNING: keep the secret key used in production secret! 24 | SECRET_KEY = 'django-insecure-jaelsf1%p)ryf^8w7-&o9e+4rqpiyn9*j_!3r1q#t@&+b!8+bh' 25 | 26 | # SECURITY WARNING: don't run with debug turned on in production! 27 | DEBUG = True 28 | 29 | ALLOWED_HOSTS = [] 30 | 31 | 32 | # Application definition 33 | 34 | INSTALLED_APPS = [ 35 | 'django.contrib.admin', 36 | 'django.contrib.auth', 37 | 'django.contrib.contenttypes', 38 | 'django.contrib.sessions', 39 | 'django.contrib.messages', 40 | 'django.contrib.staticfiles', 41 | 42 | # own 43 | 'stackbase', 44 | 'stackusers', 45 | 'crispy_forms', 46 | 'ckeditor' 47 | ] 48 | 49 | MIDDLEWARE = [ 50 | 'django.middleware.security.SecurityMiddleware', 51 | 'django.contrib.sessions.middleware.SessionMiddleware', 52 | 'django.middleware.common.CommonMiddleware', 53 | 'django.middleware.csrf.CsrfViewMiddleware', 54 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 55 | 'django.contrib.messages.middleware.MessageMiddleware', 56 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 57 | ] 58 | 59 | ROOT_URLCONF = 'stackprj.urls' 60 | 61 | TEMPLATES = [ 62 | { 63 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 64 | 'DIRS': [os.path.join(BASE_DIR, 'templates')], 65 | 'APP_DIRS': True, 66 | 'OPTIONS': { 67 | 'context_processors': [ 68 | 'django.template.context_processors.debug', 69 | 'django.template.context_processors.request', 70 | 'django.contrib.auth.context_processors.auth', 71 | 'django.contrib.messages.context_processors.messages', 72 | ], 73 | }, 74 | }, 75 | ] 76 | 77 | WSGI_APPLICATION = 'stackprj.wsgi.application' 78 | 79 | 80 | # Database 81 | # https://docs.djangoproject.com/en/3.2/ref/settings/#databases 82 | 83 | DATABASES = { 84 | 'default': { 85 | 'ENGINE': 'django.db.backends.sqlite3', 86 | 'NAME': BASE_DIR / 'db.sqlite3', 87 | } 88 | } 89 | 90 | 91 | # Password validation 92 | # https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators 93 | 94 | AUTH_PASSWORD_VALIDATORS = [ 95 | { 96 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 97 | }, 98 | { 99 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 100 | }, 101 | { 102 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 103 | }, 104 | { 105 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 106 | }, 107 | ] 108 | 109 | 110 | # Internationalization 111 | # https://docs.djangoproject.com/en/3.2/topics/i18n/ 112 | 113 | LANGUAGE_CODE = 'en-us' 114 | 115 | TIME_ZONE = 'UTC' 116 | 117 | USE_I18N = True 118 | 119 | USE_L10N = True 120 | 121 | USE_TZ = True 122 | 123 | 124 | # Static files (CSS, JavaScript, Images) 125 | # https://docs.djangoproject.com/en/3.2/howto/static-files/ 126 | 127 | STATIC_URL = '/static/' 128 | STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static'),] 129 | MEDIA_URL = '/media/' 130 | MEDIA_ROOT = os.path.join(BASE_DIR, 'media') 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | # Default primary key field type 140 | # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field 141 | 142 | DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' 143 | 144 | LOGIN_REDIRECT_URL = 'stackbase:home' 145 | 146 | LOGIN_URL = 'login' 147 | 148 | CRISPY_TEMPLATE_PACK = 'bootstrap4' -------------------------------------------------------------------------------- /stackprj/stackprj/urls.py: -------------------------------------------------------------------------------- 1 | """stackprj URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.2/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path, include 18 | from stackusers import views as user_view 19 | from django.contrib.auth import views as auth_view 20 | from django.conf import settings 21 | from django.conf.urls.static import static 22 | 23 | urlpatterns = [ 24 | path('admin/', admin.site.urls), 25 | path('', include('stackbase.urls')), 26 | 27 | # Authentication System 28 | path('register/', user_view.register, name="register"), 29 | path('login/', auth_view.LoginView.as_view(template_name="stackusers/login.html"), name='login'), 30 | path('logout/', auth_view.LogoutView.as_view(template_name="stackusers/logout.html"), name='logout'), 31 | 32 | # Profile system 33 | path('profile/', user_view.profile, name="profile"), 34 | path('profile/update/', user_view.profile_update, name="profile_update") 35 | ] 36 | 37 | if settings.DEBUG: 38 | urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) 39 | -------------------------------------------------------------------------------- /stackprj/stackprj/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for stackprj 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/3.2/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', 'stackprj.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /stackprj/stackusers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackusers/__init__.py -------------------------------------------------------------------------------- /stackprj/stackusers/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackusers/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackusers/__pycache__/admin.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackusers/__pycache__/admin.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackusers/__pycache__/apps.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackusers/__pycache__/apps.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackusers/__pycache__/forms.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackusers/__pycache__/forms.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackusers/__pycache__/models.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackusers/__pycache__/models.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackusers/__pycache__/signals.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackusers/__pycache__/signals.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackusers/__pycache__/views.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackusers/__pycache__/views.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackusers/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import Profile 3 | admin.site.register(Profile) 4 | -------------------------------------------------------------------------------- /stackprj/stackusers/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class StackusersConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'stackusers' 7 | 8 | def ready(self): 9 | import stackusers.signals 10 | -------------------------------------------------------------------------------- /stackprj/stackusers/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | from django.contrib.auth.models import User 3 | from django.contrib.auth.forms import UserCreationForm 4 | from django.db import models 5 | from django.db.models import fields 6 | from .models import Profile 7 | 8 | class UserRegisterForm(UserCreationForm): 9 | email = models.EmailField() 10 | 11 | class Meta: 12 | model = User 13 | fields = ['username', 'email', 'password1', 'password2'] 14 | 15 | class UserUpdateForm(forms.ModelForm): 16 | email = forms.EmailField() 17 | 18 | class Meta: 19 | model = User 20 | fields = ['username', 'email'] 21 | 22 | class ProfileUpdateForm(forms.ModelForm): 23 | class Meta: 24 | model = Profile 25 | fields = ['bio', 'phone', 'image'] -------------------------------------------------------------------------------- /stackprj/stackusers/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.8 on 2021-10-07 00:16 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 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 14 | ] 15 | 16 | operations = [ 17 | migrations.CreateModel( 18 | name='Profile', 19 | fields=[ 20 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 21 | ('image', models.ImageField(default='default.jpg', upload_to='profile_pic')), 22 | ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), 23 | ], 24 | ), 25 | ] 26 | -------------------------------------------------------------------------------- /stackprj/stackusers/migrations/0002_auto_20211007_0118.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.8 on 2021-10-07 00:18 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('stackusers', '0001_initial'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='profile', 15 | name='bio', 16 | field=models.CharField(default=1, max_length=1000), 17 | preserve_default=False, 18 | ), 19 | migrations.AddField( 20 | model_name='profile', 21 | name='phone', 22 | field=models.IntegerField(default=1), 23 | preserve_default=False, 24 | ), 25 | ] 26 | -------------------------------------------------------------------------------- /stackprj/stackusers/migrations/0003_alter_profile_phone.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.8 on 2021-10-07 00:39 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('stackusers', '0002_auto_20211007_0118'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='profile', 15 | name='phone', 16 | field=models.IntegerField(blank=True, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /stackprj/stackusers/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackusers/migrations/__init__.py -------------------------------------------------------------------------------- /stackprj/stackusers/migrations/__pycache__/0001_initial.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackusers/migrations/__pycache__/0001_initial.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackusers/migrations/__pycache__/0002_auto_20211007_0118.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackusers/migrations/__pycache__/0002_auto_20211007_0118.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackusers/migrations/__pycache__/0003_alter_profile_phone.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackusers/migrations/__pycache__/0003_alter_profile_phone.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackusers/migrations/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/desphixs/Stackoverflow-Clone-with-django/059c8d36e360d7d223cb64896c40dbcaaec03725/stackprj/stackusers/migrations/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /stackprj/stackusers/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.contrib.auth.models import User 3 | from PIL import Image 4 | 5 | class Profile(models.Model): 6 | user = models.OneToOneField(User, on_delete=models.CASCADE) 7 | bio = models.CharField(max_length=1000) 8 | phone = models.IntegerField(null=True, blank=True) 9 | image = models.ImageField(default='default.jpg', upload_to="profile_pic") 10 | 11 | def __str__(self): 12 | return f'{self.user.username} - Profile' 13 | 14 | def save(self, *args, **kwargs): 15 | super().save(*args, **kwargs) 16 | img = Image.open(self.image.path) 17 | if img.height > 300 or img.width > 300: 18 | output_size = (300, 300) 19 | img.thumbnail(output_size) 20 | img.save(self.image.path) -------------------------------------------------------------------------------- /stackprj/stackusers/signals.py: -------------------------------------------------------------------------------- 1 | from django.db.models.signals import post_save 2 | from django.contrib.auth.models import User 3 | from django.dispatch import receiver 4 | from .models import Profile 5 | 6 | @receiver(post_save, sender=User) 7 | def create_profile(sender, instance, created, **kwargs): 8 | if created: 9 | Profile.objects.create(user=instance) 10 | 11 | @receiver(post_save, sender=User) 12 | def save_profile(sender, instance, **kwargs): 13 | instance.profile.save() -------------------------------------------------------------------------------- /stackprj/stackusers/templates/stackusers/login.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load crispy_forms_tags %} 3 | {% block content %} 4 | 5 | 6 | 7 | 8 | 9 | 10 | Document 11 | 283 | 284 | 285 |
286 |
287 | 288 |

Sign In

289 |

Sign Up

290 | 291 | 292 | 293 |
294 |
295 | 296 | 297 | 300 | 301 | 302 | 303 | 304 |
305 | {% csrf_token %} 306 | {{form|crispy}} 307 | 308 | 309 |
310 | 311 | 312 |
313 |

Don't have an account yet? Register

314 |
315 | 316 |
317 |
318 | 319 | 320 | {% endblock content %} 321 | -------------------------------------------------------------------------------- /stackprj/stackusers/templates/stackusers/logout.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load crispy_forms_tags %} 3 | {% block content %} 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Logout Page 13 | 41 | 42 | 43 |
44 |

You have been logged out!!

45 |
46 | 47 | 48 |
49 |
50 | 51 | 52 | {% endblock content %} -------------------------------------------------------------------------------- /stackprj/stackusers/templates/stackusers/profile.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load crispy_forms_tags %} 3 | {% block content %} 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 157 | 158 | 159 |
160 |
161 |
162 |
163 |
164 |
165 | 175 |
176 |
177 |
Information
178 |
179 |
180 |

Email

181 |
{{ user.email }}
182 |
183 |
184 |

Phone

185 |
{{ user.profile.phone|title }}
186 |
187 |
188 |
Projects
189 |
190 |
191 |

Recent

192 |
Project1
193 |
194 |
195 |

Most Viewed

196 |
Project2
197 |
198 |
199 | 200 | 201 |
202 |
203 | 204 | 205 | 210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 | 221 | 222 | 223 | {% endblock content %} -------------------------------------------------------------------------------- /stackprj/stackusers/templates/stackusers/profile_update.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load crispy_forms_tags %} 3 | {% block content %} 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 159 | 160 | 161 |
162 |
163 |
164 |
165 |
166 |
167 | 174 |
175 |
176 |
177 |
178 | 179 | {% csrf_token %} 180 | {{u_form|crispy}} 181 | {{p_form|crispy}} 182 | 183 |
184 |
185 | 186 | 187 |
188 | 193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 | 201 | 204 | 205 | 206 | 207 | {% endblock content %} 208 | -------------------------------------------------------------------------------- /stackprj/stackusers/templates/stackusers/register.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load crispy_forms_tags %} 3 | {% block content %} 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Document 12 | 285 | 286 | 287 |
288 |
289 | 290 |

Sign Up

291 |

Sign In

292 | 293 | 294 | 295 |
296 |
297 | 298 | 299 | 305 | 306 |
307 | {% csrf_token %} 308 | {{form|crispy}} 309 | 310 | 311 |
312 | 313 | 314 |
315 |

Already have an account? Login

316 |
317 | 318 |
319 |
320 | 321 | 322 | {% endblock content %} 323 | -------------------------------------------------------------------------------- /stackprj/stackusers/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /stackprj/stackusers/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render, redirect 2 | from django.contrib.auth.forms import UserCreationForm 3 | from django.contrib import messages 4 | from .forms import UserRegisterForm 5 | from django.contrib.auth.decorators import login_required 6 | from .forms import ProfileUpdateForm, UserUpdateForm 7 | 8 | def register(request): 9 | if request.method == "POST": 10 | form = UserRegisterForm(request.POST) 11 | if form.is_valid(): 12 | form.save() 13 | username = form.cleaned_data.get('username') 14 | messages.success(request, f'Account Successfully created for {username}! Login In Now') 15 | return redirect('login') 16 | else: 17 | form = UserRegisterForm() 18 | 19 | return render(request, 'stackusers/register.html', {'form': form}) 20 | 21 | @login_required 22 | def profile(request): 23 | return render(request, 'stackusers/profile.html') 24 | 25 | @login_required 26 | def profile_update(request): 27 | if request.method == "POST": 28 | u_form = UserUpdateForm(request.POST, instance=request.user) 29 | p_form = ProfileUpdateForm(request.POST, request.FILES, instance=request.user.profile) 30 | if u_form.is_valid() and p_form.is_valid(): 31 | u_form.save() 32 | p_form.save() 33 | messages.success(request, f'Acount Updated Successfully!') 34 | return redirect('profile') 35 | else: 36 | u_form = UserUpdateForm(request.POST, instance=request.user) 37 | p_form = ProfileUpdateForm(request.POST, request.FILES, instance=request.user.profile) 38 | context = { 39 | 'u_form': u_form, 40 | 'p_form': p_form 41 | } 42 | return render(request, 'stackusers/profile_update.html', context) 43 | -------------------------------------------------------------------------------- /stackprj/static/main.js: -------------------------------------------------------------------------------- 1 | /*Hamburger Menu */ 2 | var hamburger_menu = document.querySelector('.hamburger-menu-container'); 3 | var button = hamburger_menu.querySelector('.hamburger-menu') 4 | button.addEventListener('click', (event) => { 5 | hamburger_menu.classList.toggle('open') 6 | }) 7 | 8 | 9 | /*Questions Section */ 10 | 11 | let questions_img=[ 12 | 'https://cdn.sstatic.net/Img/home/illo-feats-ask.svg?v=b6cd07f0765a', 13 | 'https://cdn.sstatic.net/Img/home/illo-feats-vote.svg?v=9d2eb0efdc17', 14 | 'https://cdn.sstatic.net/Img/home/illo-feats-answer.svg?v=b637b99bc32a', 15 | 'https://cdn.sstatic.net/Img/home/illo-feats-tags.svg?v=0655cbe6bffa', 16 | 'https://cdn.sstatic.net/Img/home/illo-feats-accept.svg?v=f2be4b8dfdac', 17 | 'https://cdn.sstatic.net/Img/home/illo-feats-recognize.svg?v=4f011d7173e8' 18 | ] 19 | 20 | var questionsBody=document.querySelector('.questions-body'); 21 | var question_items=questionsBody.querySelectorAll('.questions-body-item') 22 | var question_content_img=questionsBody.querySelector('.question-item-content-img') 23 | var question_item_isSelected=false; 24 | 25 | function resetActive(){ 26 | question_items.forEach(item=>{ 27 | item.classList.remove("active"); 28 | }) 29 | } 30 | function getDataId(item){ 31 | return item.getAttribute('data-id'); 32 | } 33 | function changeImage(id){ 34 | question_content_img.src=questions_img[id]; 35 | } 36 | 37 | question_items.forEach(item=>{ 38 | item.addEventListener('click',function (event){ 39 | question_item_isSelected=true; 40 | resetActive(); 41 | this.classList.add('active') 42 | changeImage(getDataId(item)) 43 | }) 44 | }) 45 | 46 | /*Questions Animation*/ 47 | var index=0; 48 | firstSlider(); 49 | durationSlider(); 50 | 51 | function firstSlider(){ 52 | changeImage(index) 53 | question_items[index].classList.add('active'); 54 | index++; 55 | } 56 | 57 | function durationSlider(){ 58 | setInterval(()=>{ 59 | if (!question_item_isSelected){ 60 | changeImage(index) 61 | resetActive(); 62 | question_items[index].classList.add('active'); 63 | index{ 76 | search_hint.classList.add('open'); 77 | }) 78 | 79 | window.addEventListener('click', function(e){ 80 | if (!(nav_search.contains(e.target) || search_btn.contains(e.target))){ 81 | search_hint.classList.remove('open'); 82 | } 83 | }); 84 | 85 | search_btn.addEventListener('click',()=>{ 86 | 87 | if (!nav_search.classList.contains('open')){ 88 | search_hint.classList.remove('open'); 89 | } 90 | nav_search.classList.toggle('open'); 91 | search_input.focus(); 92 | setTimeout(()=>{ 93 | search_hint.classList.toggle('open'); 94 | },50) 95 | }); 96 | 97 | let $id = (id) => document.getElementById(id); 98 | var [login, register, form] = ['login', 'register', 'form'].map(id => $id(id)); 99 | 100 | [login, register].map(element => { 101 | element.onclick = function () { 102 | [login, register].map($ele => { 103 | $ele.classList.remove("active"); 104 | }); 105 | this.classList.add("active"); 106 | this.getAttribute("id") === "register"? form.classList.add("active") : form.classList.remove("active"); 107 | } 108 | }); -------------------------------------------------------------------------------- /stackprj/static/main.scss: -------------------------------------------------------------------------------- 1 | /* Global Styles */ 2 | :root{ 3 | --white: #fff; 4 | --black: #0c0d0e; 5 | --orange: #f48024; 6 | --yellow: #fbf2d4; 7 | --green: #5eba7d; 8 | --blue: #0077cc; 9 | --powder: #e1ecf4; 10 | --red: #d1383d; 11 | --black-025: #fafafb; 12 | --black-050: #eff0f1; 13 | --black-075: #e4e6e8; 14 | --black-100: #d6d9dc; 15 | --black-150: #c8ccd0; 16 | --black-200: #bbc0c4; 17 | --black-300: #9fa6ad; 18 | --black-350: #9199a1; 19 | --black-400: #848d95; 20 | --black-500: #6a737c; 21 | --black-600: #535a60; 22 | --black-700: #3c4146; 23 | --black-750: #2f3337; 24 | --black-800: #242729; 25 | --black-900: #0c0d0e; 26 | --orange-050: #fff7f2; 27 | --orange-100: #fee3cf; 28 | --orange-200: #fcd0ad; 29 | --orange-300: #f7aa6d; 30 | --orange-400: #f48024; 31 | --orange-500: #f2720c; 32 | --orange-600: #da670b; 33 | --orange-700: #bd5c00; 34 | --orange-800: #a35200; 35 | --orange-900: #874600; 36 | --blue-050: #f2f9ff; 37 | --blue-100: #cfeafe; 38 | --blue-200: #addafc; 39 | --blue-300: #6cbbf7; 40 | --blue-400: #379fef; 41 | --blue-500: #0095ff; 42 | --blue-600: #0077cc; 43 | --blue-700: #0064bd; 44 | --blue-800: #0054a3; 45 | --blue-900: #004487; 46 | --powder-050: #f4f8fb; 47 | --powder-100: #e1ecf4; 48 | --powder-200: #d1e5f1; 49 | --powder-300: #b3d3ea; 50 | --powder-400: #a0c7e4; 51 | --powder-500: #7aa7c7; 52 | --powder-600: #5b8db1; 53 | --powder-700: #39739d; 54 | --powder-800: #2c5777; 55 | --powder-900: #1e3c52; 56 | --green-025: #eef8f1; 57 | --green-050: #dcf0e2; 58 | --green-100: #cae8d4; 59 | --green-200: #a6d9b7; 60 | --green-300: #82ca9a; 61 | --green-400: #5eba7d; 62 | --green-500: #48a868; 63 | --green-600: #3d8f58; 64 | --green-700: #2f6f44; 65 | --green-800: #29603b; 66 | --green-900: #1e472c; 67 | --yellow-050: #fdf7e3; 68 | --yellow-100: #fbf2d4; 69 | --yellow-200: #f1e5bc; 70 | --yellow-300: #e6d178; 71 | --yellow-400: #e9c63f; 72 | --yellow-500: #ddb624; 73 | --yellow-600: #cea51b; 74 | --yellow-700: #b89516; 75 | --yellow-800: #9f8010; 76 | --yellow-900: #826a0b; 77 | --red-050: #fdf3f4; 78 | --red-100: #f9d3d7; 79 | --red-200: #f4b4bb; 80 | --red-300: #e87c87; 81 | --red-400: #de535e; 82 | --red-500: #d1383d; 83 | --red-600: #c02d2e; 84 | --red-700: #ac2726; 85 | --red-800: #942121; 86 | --red-900: #7a1819; 87 | --gold: #ffcc01; 88 | --gold-lighter: #fff4d1; 89 | --gold-darker: #f1b600; 90 | --silver: #b4b8bc; 91 | --silver-lighter: #e8e8e8; 92 | --silver-darker: #9a9c9f; 93 | --bronze: #caa789; 94 | --bronze-lighter: #f2e9e1; 95 | --bronze-darker: #ab825f; 96 | --fc-dark: #0c0d0e; 97 | --fc-medium: #3c4146; 98 | --fc-light: #6a737c; 99 | --focus-ring: rgba(0,149,255,0.15); 100 | --focus-ring-success: rgba(166,217,183,0.4); 101 | --focus-ring-warning: rgba(233,198,63,0.4); 102 | --focus-ring-error: rgba(192,45,46,0.15); 103 | --focus-ring-muted: rgba(36,39,41,0.1); 104 | --bs-sm: 0 1px 2px rgba(0,0,0,0.05),0 1px 4px rgba(0,0,0,0.05),0 2px 8px rgba(0,0,0,0.05); 105 | --bs-md: 0 1px 3px rgba(0,0,0,0.06),0 2px 6px rgba(0,0,0,0.06),0 3px 8px rgba(0,0,0,0.09); 106 | --bs-lg: 0 1px 4px rgba(0,0,0,0.09),0 3px 8px rgba(0,0,0,0.09),0 4px 13px rgba(0,0,0,0.13); 107 | --scrollbar: rgba(0,0,0,0.2); 108 | --highlight-bg: #f6f6f6; 109 | --highlight-color: #2f3337; 110 | --highlight-comment: #656e77; 111 | --highlight-punctuation: var(--black-600); 112 | --highlight-namespace: #b75501; 113 | --highlight-attribute: #015692; 114 | --highlight-literal: #b75501; 115 | --highlight-symbol: #803378; 116 | --highlight-keyword: #015692; 117 | --highlight-variable: #54790d; 118 | --highlight-addition: #2f6f44; 119 | --highlight-deletion: #c02d2e; 120 | --dark-blue:#2b2d6e; 121 | --magnolia:#f7f6f9; 122 | } 123 | 124 | @font-face{font-family:"Source Sans Pro";font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSans Pro-Regular"),local("Source Sans Pro 400"),local("SourceSans Pro-400"),local("Source Sans Pro"),url("https://cdn.sstatic.net/Fonts/source-sans-pro/source-sans-pro-regular-webfont.woff?v=993db0ec4347") format("woff");} 125 | 126 | @font-face{font-family:"Source Sans Pro Bold";font-style:normal;font-weight:700;src:local("Source Sans Pro Bold Bold"),local("SourceSans Pro Bold-Bold"),local("Source Sans Pro Bold 700"),local("SourceSans Pro Bold-700"),url("https://cdn.sstatic.net/Fonts/source-sans-pro/source-sans-pro-bold-webfont.woff?v=f52ccc0bbce9") format("woff");} 127 | 128 | 129 | @font-face{font-family:"Roboto Slab";font-style:normal;font-weight:400;src:local("Roboto Slab Regular"),local("RobotoSlab-Regular"),local("Roboto Slab 400"),local("RobotoSlab-400"),local("Roboto Slab"),url("https://cdn.sstatic.net/Fonts/roboto-slab/roboto-slab-regular-webfont.woff?v=a75088a46d79") format("woff");} 130 | 131 | @font-face{font-family:"Roboto Slab Bold";font-style:normal;font-weight:700;src:local("Roboto Slab Bold Bold"),local("RobotoSlab Bold-Bold"),local("Roboto Slab Bold 700"),local("RobotoSlab Bold-700"),url("https://cdn.sstatic.net/Fonts/roboto-slab/roboto-slab-bold-webfont.woff?v=719d1c709127") format("woff");} 132 | 133 | 134 | 135 | *,*::before,*::after{ 136 | margin: 0; 137 | padding: 0; 138 | box-sizing: border-box; 139 | } 140 | html{ 141 | font-family: Arial,"Helvetica Neue",Helvetica,sans-serif; 142 | font-size: 10px; 143 | color: var(--black-800); 144 | } 145 | .container{ 146 | width: 100%; 147 | max-width: 126.4rem; 148 | margin: 0 auto; 149 | padding: 0 1.5rem; 150 | } 151 | section{ 152 | padding: 5rem 0; 153 | } 154 | ul{ 155 | list-style: none; 156 | } 157 | a{ 158 | text-decoration: none; 159 | color: var(--blue-600); 160 | cursor: pointer; 161 | } 162 | img{ 163 | width: 100%; 164 | max-width: 100%; 165 | height: auto; 166 | } 167 | 168 | .btn{ 169 | text-align: center; 170 | font-size: 1.3rem; 171 | border-radius: 3px; 172 | transition: all 0.5s; 173 | padding: 1.3rem 2.5rem; 174 | } 175 | .btn-orange{ 176 | background-color:var(--orange); 177 | color: var(--white); 178 | 179 | } 180 | .btn-dark-blue{ 181 | background-color:var(--dark-blue); 182 | color: var(--white); 183 | 184 | } 185 | 186 | 187 | /* Header */ 188 | header{ 189 | width: 100%; 190 | height: 50px; 191 | background-color: var(--black-025); 192 | border-top: 3px solid var(--orange); 193 | position: fixed; 194 | left: 0; 195 | top: 0; 196 | z-index: 99; 197 | box-shadow: var(--bs-sm); 198 | } 199 | .nav-container{ 200 | width: 100%; 201 | height: 100%; 202 | max-width: 126.4rem; 203 | margin: 0 auto; 204 | } 205 | nav{ 206 | display: flex; 207 | width: inherit; 208 | height: inherit; 209 | } 210 | .nav-brand{ 211 | flex: 1 0 auto; 212 | display: flex; 213 | align-items: center; 214 | } 215 | .hamburger-menu-container{ 216 | height: 100%; 217 | cursor: pointer; 218 | position: relative; 219 | &:hover{ 220 | background-color: var(--silver-lighter); 221 | } 222 | } 223 | .hamburger-menu-container.open{ 224 | background-color: var(--silver-lighter); 225 | 226 | .hamburger-menu{ 227 | .line:nth-of-type(1) { 228 | transform: rotateZ(-45deg) translate(-0.3rem, 0.5rem); 229 | } 230 | .line:nth-of-type(2) { 231 | display: none; 232 | } 233 | .line:nth-of-type(3) { 234 | transform: rotateZ(45deg) translate(-0.2rem, -0.3rem); 235 | } 236 | } 237 | 238 | .nav-dropdown-menu{ 239 | display: flex; 240 | } 241 | } 242 | 243 | .hamburger-menu { 244 | width: 4rem; 245 | height: inherit; 246 | padding: 1.5rem 1.1rem; 247 | display: flex; 248 | flex-wrap: wrap; 249 | align-items: center; 250 | position: relative; 251 | transition: all 0.5s; 252 | .line { 253 | background-color:var(--black-400); 254 | height: 2px; 255 | width: 100%; 256 | -webkit-transition: all 0.3s; 257 | transition: all 0.3s; 258 | } 259 | } 260 | 261 | .nav-icon{ 262 | height: 100%; 263 | display: flex; 264 | align-items: center; 265 | justify-content: center; 266 | padding:0 1.5rem 0; 267 | &:hover{ 268 | background-color: var(--silver-lighter); 269 | } 270 | i{ 271 | font-size: 3rem; 272 | } 273 | } 274 | .fa-stack-overflow{ 275 | color: var(--orange); 276 | } 277 | .nav-icon-text{ 278 | font-size: 1.8rem; 279 | margin-left: .5rem; 280 | color: var(--black); 281 | span{ 282 | font-weight: bold; 283 | } 284 | } 285 | .nav-dropdown-menu{ 286 | display: none; 287 | flex-direction: column; 288 | position: absolute; 289 | left: 0; 290 | top: 50px; 291 | font-size: 1.3rem; 292 | padding: 2rem 0; 293 | width: 240px; 294 | border-left: 1px solid var(--black-075); 295 | border-right: 1px solid var(--black-075); 296 | border-bottom: 1px solid var(--black-075); 297 | background-color: var(--white); 298 | box-shadow: var(--bs-sm); 299 | & > a { 300 | display: flex; 301 | padding: 1rem 0 1rem .5rem; 302 | span{ 303 | margin-left: .5rem; 304 | } 305 | } 306 | h5{ 307 | color: var(--fc-light); 308 | font-size: 1.1rem; 309 | text-transform: uppercase; 310 | font-weight: 400; 311 | padding: 1rem .5rem; 312 | display: flex; 313 | justify-content: space-between; 314 | a{ 315 | font-size: 1rem; 316 | text-transform: initial; 317 | font-weight: 550; 318 | color: var(--black-500); 319 | } 320 | } 321 | i{ 322 | font-size: 1.5rem; 323 | &.fa-briefcase{ 324 | color: var(--orange); 325 | } 326 | } 327 | } 328 | .nav-link{ 329 | color: var(--black-600); 330 | font-weight: 400; 331 | } 332 | .current-link{ 333 | background-color: var(--black-050); 334 | color: var(--black-900); 335 | font-weight: bold; 336 | } 337 | .nav-ul { 338 | i{ 339 | margin-left: -1.5rem; 340 | color: var(--black-400); 341 | } 342 | } 343 | .nav-item{ 344 | width: 100%; 345 | padding: 1rem 2rem; 346 | } 347 | .nav-base-links{ 348 | flex: 1 0 auto; 349 | display: flex; 350 | align-items: center; 351 | font-size: 1.3rem; 352 | ul{ 353 | display: flex; 354 | align-items: center; 355 | justify-content: center; 356 | 357 | li{ 358 | padding: .8rem 1.2rem; 359 | border-radius: 3rem; 360 | margin:0 .3rem; 361 | &:hover{ 362 | background-color: var(--silver-lighter); 363 | } 364 | } 365 | } 366 | a{ 367 | color: var(--black-600); 368 | } 369 | } 370 | .nav-search{ 371 | flex: 30 0 auto; 372 | display: flex; 373 | align-items: center; 374 | margin-right: 1rem; 375 | position: relative; 376 | } 377 | .search-container{ 378 | width: 100%; 379 | border: 1px solid var(--black-200); 380 | border-radius: 3px; 381 | padding: .8rem; 382 | background-color: var(--white); 383 | display: flex; 384 | align-items: center; 385 | i{ 386 | color: var(--black-200); 387 | font-size: 1.5rem; 388 | font-weight: 600; 389 | } 390 | input[type='text']{ 391 | flex: 1 1 auto; 392 | margin-left: .5rem; 393 | border: none; 394 | outline: none; 395 | color: var(--black-700); 396 | &::placeholder{ 397 | color: var(--black-200); 398 | } 399 | } 400 | &:focus-within { 401 | border-color: var(--blue-300); 402 | box-shadow: 0 0 0 .4rem var(--focus-ring); 403 | } 404 | } 405 | 406 | .search-btn{ 407 | height: 100%; 408 | align-items: center; 409 | justify-content: center; 410 | padding: 0 1rem; 411 | cursor: pointer; 412 | display: none; 413 | margin-right: 1rem; 414 | i{ 415 | font-size: 1.7rem; 416 | color: var(--black-700); 417 | } 418 | &:hover{ 419 | background-color: var(--silver-lighter); 420 | } 421 | } 422 | .search-hints{ 423 | display: none; 424 | position: absolute; 425 | top:5rem; 426 | left: 0; 427 | width: 100%; 428 | background-color: var(--white); 429 | border-radius: .3rem; 430 | box-shadow: var(--bs-lg); 431 | &.open{ 432 | display: block; 433 | } 434 | 435 | } 436 | .search-arrow-up{ 437 | position: absolute; 438 | content: ''; 439 | top: -1.2rem; 440 | height: 1.2rem; 441 | width: 100%; 442 | overflow: hidden; 443 | &:before{ 444 | position: absolute; 445 | content: ''; 446 | top:1.2rem; 447 | left: 2rem; 448 | width: 1.2rem; 449 | height: 1.2rem; 450 | background-color: var(--white); 451 | border: 1px solid var(--black-150); 452 | box-shadow: 2px 0 8px rgba(59, 64, 69, 0.1); 453 | transform:translate(-50%,-50%) rotate(45deg) ; 454 | transition: all 0.2s; 455 | } 456 | } 457 | .search-hint-body{ 458 | border-bottom: 1px solid var(--black-075); 459 | padding: 1.2rem 1.2rem 0; 460 | display: flex; 461 | } 462 | .hints-grid-column{ 463 | flex-basis: 50%; 464 | } 465 | .hint-text{ 466 | margin-bottom: 1.2rem; 467 | font-size: 1.3rem; 468 | font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; 469 | font-weight: 400; 470 | color: var(--black-300); 471 | span{ 472 | font-family: Consolas,Menlo,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New,monospace,sans-serif !important; 473 | color:var(--fc-medium); 474 | } 475 | } 476 | .search-hint-footer { 477 | display: flex; 478 | align-items: center; 479 | justify-content: space-between; 480 | padding: 1.2rem ; 481 | .btn{ 482 | background-color: var(--powder-100); 483 | color: var(--powder-800); 484 | padding: .6rem; 485 | border-radius: .3rem; 486 | border:1px solid var(--powder-600); 487 | font-size: 1.1rem; 488 | font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; 489 | &:hover{ 490 | background-color: var(--powder-300); 491 | } 492 | } 493 | } 494 | .search-help{ 495 | font-size: 1.1rem; 496 | font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; 497 | font-weight: 400; 498 | } 499 | 500 | 501 | .nav-right-buttons{ 502 | flex: 1 0 auto; 503 | display: flex; 504 | align-items: center; 505 | justify-content: center; 506 | } 507 | .btn-login{ 508 | background-color: var(--powder); 509 | color: var(--blue-700); 510 | border: 1px solid var(--blue-300); 511 | padding: .8rem 1rem; 512 | &:hover{ 513 | background-color: var(--blue-200); 514 | } 515 | } 516 | .btn-register{ 517 | background-color: var(--blue-500); 518 | color: var(--white); 519 | margin-left: .5rem; 520 | padding: .8rem 1rem; 521 | &:hover{ 522 | background-color: var(--blue-600); 523 | } 524 | } 525 | 526 | 527 | /* End Header */ 528 | 529 | 530 | /* Hero */ 531 | .hero{ 532 | background-image: url("https://cdn.sstatic.net/Img/home/illo-hero-full.svg?v=e2018a5f9272"); 533 | background-repeat: no-repeat; 534 | background-position: top center; 535 | background-color: #FFCF10; 536 | height: 80vh; 537 | display: flex; 538 | justify-content: center; 539 | align-items: center; 540 | margin-top: 50px; 541 | 542 | } 543 | .hero-content{ 544 | display: flex; 545 | flex-direction: column; 546 | align-items: center; 547 | margin: 0 3rem; 548 | } 549 | .hero-title{ 550 | color: var(--black-800); 551 | font-family: 'Roboto Slab Bold',serif; 552 | font-weight: 700; 553 | font-weight: bold; 554 | font-size: 5.5rem; 555 | text-align: center; 556 | max-width: 100%; 557 | span{ 558 | font-family: Consolas,Menlo,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New,monospace,sans-serif; 559 | } 560 | } 561 | .hero-paragraph{ 562 | margin:2rem 0; 563 | font-size: 2rem; 564 | color: var(--black-800); 565 | max-width: 40rem; 566 | font-weight: 400; 567 | text-align: center; 568 | font-family: 'Source Sans Pro', sans-serif; 569 | } 570 | .hero-options{ 571 | display: flex; 572 | } 573 | .btn-developers{ 574 | background-color: var(--white); 575 | color: var(--orange-400); 576 | border: 1px solid var(--orange-400); 577 | } 578 | .btn-businesses{ 579 | background-color: var(--orange-400); 580 | color: var(--white); 581 | margin-left: .5rem; 582 | } 583 | /*End Hero*/ 584 | 585 | 586 | /* For Developers*/ 587 | .section-head{ 588 | display: flex; 589 | flex-direction: column; 590 | justify-content: center; 591 | align-items: center; 592 | color: var(--black-800); 593 | 594 | } 595 | .section-title{ 596 | font-size: 3.4rem; 597 | font-family: 'Roboto Slab Bold',serif; 598 | font-weight: 700; 599 | 600 | } 601 | .section-line{ 602 | width: 64px; 603 | height: 8px; 604 | margin: 3rem auto; 605 | border-radius:100rem; 606 | background-color: var(--orange-400); 607 | } 608 | .section-description{ 609 | font-size: 1.7rem; 610 | max-width: 52.6rem; 611 | text-align: center; 612 | a{ 613 | color: var(--orange-400); 614 | } 615 | } 616 | .for-developers{ 617 | .options{ 618 | display: flex; 619 | justify-content: space-between; 620 | align-items: center; 621 | max-width: 90%; 622 | margin-left: auto; 623 | margin-right: auto; 624 | } 625 | .option{ 626 | flex-basis: 30%; 627 | display: flex; 628 | flex-direction: column; 629 | align-items: center; 630 | justify-content: center; 631 | padding: 3rem; 632 | background-color: var(--white); 633 | box-shadow: var(--bs-md); 634 | border-radius: .7rem; 635 | &:nth-child(1),&:nth-child(3){ 636 | margin-top:12rem; 637 | } 638 | &:hover{ 639 | box-shadow: var(--bs-lg); 640 | } 641 | } 642 | 643 | .option-title{ 644 | color: var(--black-800); 645 | font-size: 2.1rem; 646 | font-weight: 400; 647 | margin: 2rem 0; 648 | } 649 | .option-description{ 650 | font-size: 1.4rem; 651 | font-weight: 400; 652 | text-align: center; 653 | color: var(--black-800); 654 | a{ 655 | color: var(--orange-400); 656 | } 657 | } 658 | .option-button{ 659 | margin:3rem 0 2rem; 660 | } 661 | .option-link{ 662 | color: var(--white); 663 | } 664 | } 665 | 666 | /* End For Developers*/ 667 | 668 | 669 | 670 | /*For Businesses*/ 671 | .for-businesses{ 672 | background-color: var(--magnolia); 673 | padding: 10rem 0; 674 | .options{ 675 | margin-top: 6rem; 676 | display: flex; 677 | justify-content: space-evenly; 678 | } 679 | .option{ 680 | flex-basis: 30%; 681 | display: flex; 682 | align-items: center; 683 | justify-content: center; 684 | padding: 3.5rem; 685 | background-color: var(--white); 686 | box-shadow: var(--bs-md); 687 | border-radius: .7rem; 688 | } 689 | .option-description{ 690 | font-size: 1.7rem; 691 | font-weight: 400; 692 | margin-left: 1rem; 693 | color: var(--black-800); 694 | } 695 | .option-link{ 696 | color: var(--orange-400); 697 | } 698 | } 699 | 700 | /* End For Businesses */ 701 | 702 | 703 | /* Teams*/ 704 | .teams{ 705 | background-image: url("https://cdn.sstatic.net/Img/product/teams/illo-teams-pricing.svg?v=8afb8ac7c580"); 706 | background-repeat: no-repeat; 707 | background-size: contain; 708 | background-position:center; 709 | background-color: var(--dark-blue); 710 | padding: 12rem 0; 711 | .options{ 712 | margin-top: 6rem; 713 | display: flex; 714 | justify-content: space-evenly; 715 | } 716 | .option{ 717 | flex-basis: 30%; 718 | display: flex; 719 | align-items: center; 720 | justify-content: center; 721 | padding: 3.5rem; 722 | background-color: var(--white); 723 | box-shadow: var(--bs-md); 724 | border-radius: .7rem; 725 | } 726 | .option-description{ 727 | font-size: 1.7rem; 728 | font-weight: 400; 729 | margin-left: 1rem; 730 | color: var(--black-800); 731 | } 732 | .option-link{ 733 | color: var(--orange-400); 734 | } 735 | } 736 | .teams-head{ 737 | display: flex; 738 | flex-direction: column; 739 | justify-content: center; 740 | align-items: center; 741 | color: var(--white); 742 | text-align: center; 743 | 744 | } 745 | .teams-title{ 746 | font-size: 3.4rem; 747 | font-family: 'Roboto Slab Bold',serif; 748 | font-weight: bold; 749 | max-width: 55rem; 750 | } 751 | .teams-description{ 752 | font-size: 1.7rem; 753 | max-width: 52.6rem; 754 | text-align: center; 755 | margin: 3rem 0 2rem; 756 | } 757 | .teams-plan{ 758 | display: flex; 759 | flex-wrap: wrap; 760 | width: 80%; 761 | margin:10rem auto 0; 762 | } 763 | .card{ 764 | flex: 1 auto; 765 | flex-basis: calc(33% - 4rem); 766 | display: flex; 767 | flex-direction: column; 768 | background-color: var(--white); 769 | box-shadow: var(--bs-sm); 770 | padding: 3rem; 771 | border-radius: .7rem; 772 | margin:2rem; 773 | position: relative; 774 | } 775 | .card-body{ 776 | margin:4rem 0; 777 | } 778 | .plan-type{ 779 | display: inline-block; 780 | padding: .5rem 1rem; 781 | font-family: 'Roboto Slab',serif; 782 | font-size: 1.8rem; 783 | font-weight: 500; 784 | border-radius: .3rem; 785 | } 786 | .card-basic{ 787 | .plan-type{ 788 | background-color: var(--black-150); 789 | color: var(--black-750); 790 | } 791 | .btn-card{ 792 | background-color: var(--black-100); 793 | color: var(--black-750); 794 | 795 | } 796 | } 797 | .card-business{ 798 | .plan-type{ 799 | background-color: var(--black-700); 800 | color: var(--white); 801 | } 802 | .btn-card{ 803 | background-color: var(--black-700); 804 | color: var(--white); 805 | } 806 | } 807 | .card-enterprise{ 808 | 809 | .plan-type{ 810 | background-color: var(--dark-blue); 811 | color: var(--white); 812 | } 813 | .btn-card{ 814 | background-color: var(--dark-blue); 815 | color: var(--white); 816 | } 817 | } 818 | .card-most-used{ 819 | 820 | position: absolute; 821 | width: 90%; 822 | left: 5%; 823 | top:-3.7rem; 824 | padding: 1rem 2rem; 825 | background-color: var(--black-075); 826 | color: var(--black-800); 827 | font-size: 1.2rem; 828 | font-family: "Source Sans Pro Bold",sans-serif; 829 | font-weight: 700; 830 | display: flex; 831 | justify-content: space-between; 832 | border: 1px solid var(--black-100); 833 | border-top-left-radius: .7rem; 834 | border-top-right-radius: .7rem; 835 | } 836 | .plan-description{ 837 | color: var(--black-800); 838 | font-size: 1.5rem; 839 | font-family: 'Roboto Slab',serif; 840 | font-weight: 500; 841 | margin-top: 2rem; 842 | } 843 | .plan-price{ 844 | border-bottom: 1px solid var(--black-075); 845 | padding-bottom: 2rem; 846 | margin-bottom: 2rem; 847 | } 848 | .price{ 849 | font-size: 3.4rem; 850 | font-family: 'Roboto Slab Bold',serif; 851 | font-weight: 900; 852 | color: var(--black-800); 853 | } 854 | .per{ 855 | color: var(--black-350); 856 | font-size: 1.3rem; 857 | display: block; 858 | margin-top: 1rem; 859 | } 860 | .plan-features{ 861 | display: flex; 862 | flex-direction: column; 863 | } 864 | .plan-feature{ 865 | margin: .6rem 0; 866 | display: flex; 867 | align-items: center; 868 | i{ 869 | font-size: 1.8rem; 870 | color: var(--black-800); 871 | } 872 | &:last-child{ 873 | margin-bottom: 1.5rem; 874 | } 875 | } 876 | .plan-text{ 877 | color: var(--black-800); 878 | font-size: 1.5rem; 879 | font-weight: 400; 880 | font-family: "Source Sans Pro",sans-serif; 881 | margin-left: 1rem; 882 | } 883 | .card-footer{ 884 | position: absolute; 885 | bottom: 3rem; 886 | width: calc(100% - 6rem); 887 | } 888 | .btn-card{ 889 | font-size: 1.5rem; 890 | 891 | font-family: "Source Sans Pro Bold",sans-serif; 892 | font-weight: 700; 893 | padding: 1.5rem 1rem; 894 | display: block; 895 | &:hover{ 896 | background-color: var(--blue-500); 897 | color: var(--white); 898 | } 899 | } 900 | 901 | .teams-footer{ 902 | display: flex; 903 | flex-wrap: wrap; 904 | justify-content: space-evenly; 905 | width: 80%; 906 | margin:5rem auto 0; 907 | img{ 908 | max-height: 24px; 909 | width: initial; 910 | margin-right: 1rem; 911 | } 912 | } 913 | .teams-footer-item{ 914 | margin:2rem; 915 | display: flex; 916 | align-items: center; 917 | font-size: 1.5rem; 918 | color: var(--black-200); 919 | } 920 | .teams-footer-text{ 921 | display: inline-block; 922 | } 923 | /* End Teams*/ 924 | 925 | 926 | 927 | 928 | /* Hire */ 929 | .hire{ 930 | background-color: var(--magnolia); 931 | padding: 10rem 0; 932 | .container{ 933 | display: flex; 934 | justify-content: center; 935 | padding: 0 5rem; 936 | } 937 | } 938 | .hire-content{ 939 | display: grid; 940 | grid-template-columns: repeat(auto-fill, minmax(40rem, 1fr)); 941 | grid-column-gap: 3rem; 942 | grid-row-gap:6rem; 943 | } 944 | .hire-item{ 945 | display: block; 946 | color: var(--black-800); 947 | .btn{ 948 | font-size: 1.5rem; 949 | font-family: "Source Sans Pro",sans-serif; 950 | font-weight: 400; 951 | padding: 1.2rem 2rem; 952 | } 953 | } 954 | .hire-icon{ 955 | max-width: 7.6rem; 956 | } 957 | .hire-item-title{ 958 | font-size: 2.7rem; 959 | font-family: 'Roboto Slab Bold',serif; 960 | font-weight: 700; 961 | margin: 1rem 0; 962 | } 963 | .hire-item-description{ 964 | font-size: 1.5rem; 965 | font-family: "Source Sans Pro",sans-serif; 966 | font-weight: 400; 967 | margin-bottom: 3.5rem; 968 | } 969 | /* End Hire */ 970 | 971 | 972 | /* Questions */ 973 | 974 | @mixin question-arrow{ 975 | position: absolute; 976 | top: 0; 977 | height: 100%; 978 | overflow: hidden; 979 | width: 1.6rem; 980 | } 981 | @mixin question-arrow-content{ 982 | position: absolute; 983 | top: 50%; 984 | content: ""; 985 | width: 1.6rem; 986 | height: 1.6rem; 987 | background-color: #fff; 988 | border: 1px solid #d6d9dc; 989 | box-shadow: 2px 0 8px rgba(59, 64, 69, 0.1); 990 | transform:translate(-50%,-50%) rotate(45deg) ; 991 | transition: all 0.2s; 992 | } 993 | 994 | .questions-content{ 995 | display: flex; 996 | justify-content: center; 997 | align-items: center; 998 | flex-direction: column; 999 | .question-title{ 1000 | font-family: 'Roboto Slab Bold',serif; 1001 | font-weight: 900; 1002 | color: var(--black-800); 1003 | font-size: 3.4rem; 1004 | text-align: center; 1005 | } 1006 | } 1007 | .questions-header{ 1008 | margin: 3rem 0 6rem; 1009 | } 1010 | 1011 | .questions-body{ 1012 | display: flex; 1013 | justify-content: center; 1014 | } 1015 | .questions-body-item{ 1016 | flex-basis: 20%; 1017 | display: flex; 1018 | align-items: center; 1019 | padding: 1.5rem 5rem 1.5rem 1.5rem; 1020 | margin-bottom: 2rem; 1021 | position: relative; 1022 | cursor: pointer; 1023 | z-index: 2; 1024 | &:hover{ 1025 | border-color: transparent; 1026 | box-shadow: var(--bs-md); 1027 | } 1028 | &.active{ 1029 | box-shadow: var(--bs-lg); 1030 | &:hover{ 1031 | box-shadow: var(--bs-md); 1032 | } 1033 | .question-arrow-right{ 1034 | @include question-arrow; 1035 | left: 100%; 1036 | &:after{ 1037 | @include question-arrow-content; 1038 | } 1039 | } 1040 | .question-arrow-left{ 1041 | @include question-arrow; 1042 | right: 100%; 1043 | &:before{ 1044 | @include question-arrow-content; 1045 | right: -100%; 1046 | } 1047 | } 1048 | } 1049 | } 1050 | .question-item-icon{ 1051 | width: 5rem; 1052 | } 1053 | .question-item-text{ 1054 | margin-left: 1rem; 1055 | color: var(--black-800); 1056 | font-size: 1.7rem; 1057 | font-family: "Source Sans Pro", sans-serif; 1058 | font-weight: 400; 1059 | } 1060 | .questions-body-item-content{ 1061 | flex-basis: 40%; 1062 | margin: 0 3rem; 1063 | display: block; 1064 | text-align: center; 1065 | 1066 | } 1067 | .question-item-content-text{ 1068 | padding: 4rem 0; 1069 | font-size: 2.1rem; 1070 | font-family: 'Roboto Slab',serif; 1071 | font-weight: 500; 1072 | color: var(--black-800); 1073 | } 1074 | .question-item-content-btn{ 1075 | margin-top: 2rem; 1076 | padding: 1.5rem 2.5rem; 1077 | } 1078 | .questions-footer{ 1079 | margin: 20rem 0 10rem; 1080 | width: 100%; 1081 | } 1082 | .questions-grid{ 1083 | margin-top: 6rem; 1084 | padding: 0 5rem; 1085 | display: grid; 1086 | grid-template-columns:repeat(auto-fit,minmax(20rem,1fr)); 1087 | grid-gap: 2.5rem; 1088 | 1089 | } 1090 | .grid-item-img{ 1091 | max-height: 15rem; 1092 | img{ 1093 | width: auto; 1094 | } 1095 | } 1096 | .grid-item-title{ 1097 | font-size: 1.9rem; 1098 | font-family: "Roboto Slab Bold",serif; 1099 | font-weight: 700; 1100 | margin:2rem 0; 1101 | } 1102 | .grid-item-description{ 1103 | font-family: "Source Sans Pro", sans-serif; 1104 | font-size: 1.5rem; 1105 | line-height: 19px; 1106 | font-weight: 400; 1107 | } 1108 | 1109 | /* End Questions */ 1110 | 1111 | /* Jobs */ 1112 | .jobs{ 1113 | background-color: var(--powder-100); 1114 | padding: 10rem 0; 1115 | } 1116 | .jobs-content{ 1117 | padding: 0 2rem; 1118 | } 1119 | .jobs-title{ 1120 | font-size: 3.4rem; 1121 | font-weight: 700; 1122 | font-family: "Roboto Slab Bold", serif; 1123 | margin-bottom: 2rem; 1124 | } 1125 | .jobs-body{ 1126 | display: flex; 1127 | align-items: center; 1128 | } 1129 | .jobs-items{ 1130 | display: flex; 1131 | flex-basis: 86%; 1132 | .column{ 1133 | display: flex; 1134 | flex-basis: 50%; 1135 | &:nth-child(even){ 1136 | margin-left: 3rem; 1137 | } 1138 | } 1139 | } 1140 | 1141 | .jobs-item{ 1142 | flex-basis: 50%; 1143 | background-color: var(--white); 1144 | box-shadow: var(--bs-md); 1145 | border-radius: .7rem; 1146 | padding: 1.8rem 2rem; 1147 | display: flex; 1148 | align-items: center; 1149 | font-size: 1.5rem; 1150 | font-family: "Roboto Slab", serif; 1151 | font-weight: 400; 1152 | &:nth-child(even){ 1153 | margin-left: 3rem; 1154 | } 1155 | } 1156 | 1157 | .jobs-item-img{ 1158 | width: 5rem; 1159 | } 1160 | .jobs-item-description{ 1161 | margin-left: 2rem; 1162 | } 1163 | /* End Jobs */ 1164 | 1165 | 1166 | /* Footer */ 1167 | .footer{ 1168 | background-color: var(--black-800); 1169 | color: var(--black-500); 1170 | padding-top: 4rem; 1171 | padding-bottom: 4rem; 1172 | position: relative; 1173 | } 1174 | .footer-content{ 1175 | display: flex; 1176 | } 1177 | .footer-icon { 1178 | flex: 0 0 64px; 1179 | i { 1180 | font-size: 4rem; 1181 | margin-top: -2rem; 1182 | margin-bottom: 2rem; 1183 | } 1184 | } 1185 | .footer-nav{ 1186 | display: flex; 1187 | flex: 2 1 auto; 1188 | flex-wrap: wrap; 1189 | } 1190 | .footer-nav-col{ 1191 | flex: 1 0 auto; 1192 | padding-right: 1rem; 1193 | padding-bottom: 2.4rem; 1194 | } 1195 | .footer-another-links{ 1196 | flex: 1 1 150px; 1197 | display: flex; 1198 | flex-direction: column; 1199 | justify-content: space-between; 1200 | } 1201 | .footer-links-title{ 1202 | margin-bottom: 1rem; 1203 | a{ 1204 | color: var(--black-200); 1205 | font-size: 1.3rem; 1206 | font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; 1207 | font-weight: 700; 1208 | text-transform: uppercase; 1209 | } 1210 | } 1211 | .footer-link-item{ 1212 | padding: .4rem 0; 1213 | display: flex; 1214 | align-items: center; 1215 | } 1216 | .footer-arrow-icon{ 1217 | display: flex; 1218 | align-items: center; 1219 | justify-content: center; 1220 | width: 1.2rem; 1221 | height: 1.2rem; 1222 | background-color: rgba(132,141,149,0.35); 1223 | opacity: .5; 1224 | border-radius:.3rem; 1225 | margin-left: 1rem; 1226 | i{ 1227 | font-size: .5rem; 1228 | color: var(--black-200); 1229 | } 1230 | } 1231 | .footer-link{ 1232 | color: var(--black-400); 1233 | font-size: 1.3rem; 1234 | font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; 1235 | font-weight: 400; 1236 | } 1237 | .social-media{ 1238 | ul { 1239 | display: flex; 1240 | li{ 1241 | margin-right: 1rem; 1242 | a{ 1243 | color: var(--black-400); 1244 | font-size: 1.1rem; 1245 | } 1246 | } 1247 | } 1248 | } 1249 | .copyright{ 1250 | color: var(--black-500); 1251 | font-size: 1.1rem; 1252 | font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; 1253 | font-weight: 400; 1254 | a{ 1255 | color: var(--black-400); 1256 | } 1257 | } 1258 | .footer-robot-img{ 1259 | width: 5.1rem; 1260 | height: 5.1rem; 1261 | position: absolute; 1262 | right: 6rem; 1263 | top:-4.5rem; 1264 | } 1265 | /* End Footer */ 1266 | 1267 | 1268 | 1269 | 1270 | /* Media Queries */ 1271 | @media screen and (max-width: 1100px) { 1272 | .for-businesses { 1273 | .option{ 1274 | flex-direction: column; 1275 | } 1276 | .option-icon{ 1277 | margin-bottom: 1.5rem; 1278 | img{ 1279 | max-width: 7.6rem; 1280 | } 1281 | } 1282 | } 1283 | .jobs-title{ 1284 | text-align: center; 1285 | } 1286 | .jobs-body{ 1287 | flex-direction: column; 1288 | } 1289 | .jobs-items{ 1290 | flex-direction: column; 1291 | .column{ 1292 | &:nth-child(even){ 1293 | margin-left:initial; 1294 | } 1295 | } 1296 | } 1297 | .jobs-item{ 1298 | margin-bottom: 3rem; 1299 | } 1300 | .hire-content{ 1301 | grid-template-columns: repeat(auto-fill, minmax(35rem, 1fr)); 1302 | } 1303 | } 1304 | @media screen and (max-width: 850px){ 1305 | .hire-content{ 1306 | grid-template-columns: repeat(auto-fill, minmax(25rem, 1fr)); 1307 | } 1308 | } 1309 | @media screen and (max-width: 830px){ 1310 | .footer-content{ 1311 | flex-wrap: wrap; 1312 | } 1313 | .social-media{ 1314 | margin-bottom: 1rem; 1315 | } 1316 | } 1317 | @media screen and (max-width: 810px) { 1318 | .nav-brand{ 1319 | flex: initial; 1320 | } 1321 | .nav-base-links ul li:not(:nth-child(2)){ 1322 | display: none; 1323 | } 1324 | .nav-search{ 1325 | flex: initial; 1326 | align-items: center; 1327 | width: 100%; 1328 | position: absolute; 1329 | top: 4.7rem; 1330 | padding: .8rem 1rem; 1331 | background-color: var(--black-100); 1332 | margin-right: initial; 1333 | display: none; 1334 | &.open{ 1335 | display: flex; 1336 | } 1337 | } 1338 | .search-btn{ 1339 | display: flex; 1340 | } 1341 | .nav-right-buttons{ 1342 | flex: initial; 1343 | margin-right: 1rem; 1344 | } 1345 | .search-hints{ 1346 | width: 94%; 1347 | left: 3%; 1348 | top: 5.2rem; 1349 | } 1350 | .for-developers{ 1351 | .options{ 1352 | justify-content: initial; 1353 | flex-direction: column; 1354 | max-width: initial; 1355 | margin-top: 6rem; 1356 | & > .option{ 1357 | margin-top: initial; 1358 | } 1359 | } 1360 | .option{ 1361 | max-width: 28rem; 1362 | margin-bottom: 3rem; 1363 | margin-top: initial; 1364 | } 1365 | } 1366 | 1367 | .for-businesses { 1368 | .options { 1369 | flex-direction: column; 1370 | } 1371 | .option{ 1372 | flex-direction: row; 1373 | margin-bottom: 2.5rem; 1374 | max-width: 35rem; 1375 | margin-left: auto; 1376 | margin-right: auto; 1377 | } 1378 | .option-icon{ 1379 | margin-bottom: 0; 1380 | img{ 1381 | max-width: initial; 1382 | } 1383 | } 1384 | } 1385 | .teams{ 1386 | background-image: none; 1387 | } 1388 | .teams-plan { 1389 | width: 90%; 1390 | .card{ 1391 | flex-basis: initial; 1392 | &:nth-child(2){ 1393 | order: -1; 1394 | } 1395 | } 1396 | } 1397 | .teams-footer{ 1398 | width: 90%; 1399 | } 1400 | .questions-content .question-title{ 1401 | font-size: 2.3rem; 1402 | } 1403 | .questions-body{ 1404 | flex-direction: column; 1405 | justify-content: initial; 1406 | } 1407 | .questions-body-items{ 1408 | display: flex; 1409 | } 1410 | .questions-body-item{ 1411 | flex-basis: 33%; 1412 | flex-direction: column; 1413 | padding: 1rem; 1414 | justify-content: center; 1415 | text-align: center; 1416 | margin: 0; 1417 | } 1418 | .question-item-text{ 1419 | margin-left: initial; 1420 | margin-top: 1rem; 1421 | } 1422 | .question-arrow-right,.question-arrow-left{ 1423 | display: none; 1424 | } 1425 | .questions-body-item-content{ 1426 | margin: 2rem 0 0; 1427 | order: 3; 1428 | } 1429 | .question-item-content-img{ 1430 | padding: 0 2rem; 1431 | } 1432 | .question-item-content-text{ 1433 | font-size: 1.8rem ; 1434 | padding-left: 1rem; 1435 | padding-right: 1rem; 1436 | } 1437 | .questions-grid-item{ 1438 | display: flex; 1439 | flex-direction: column; 1440 | align-items: center; 1441 | justify-content: center; 1442 | margin-bottom:3rem; 1443 | text-align: center; 1444 | } 1445 | } 1446 | @media screen and (max-width: 640px) { 1447 | .nav-icon { 1448 | padding: 0 1rem; 1449 | } 1450 | .nav-icon-text { 1451 | display: none; 1452 | } 1453 | .nav-base-links { 1454 | font-size: 1.1rem; 1455 | } 1456 | .search-hint-body{ 1457 | flex-direction: column; 1458 | } 1459 | 1460 | .hero { 1461 | background-image: url("https://cdn.sstatic.net/Img/home/illo-hero-small.svg?v=884735d21ea5"); 1462 | } 1463 | .hero-title { 1464 | font-size: 3rem; 1465 | } 1466 | .hero-options { 1467 | flex-direction: column; 1468 | } 1469 | .btn-developers { 1470 | margin-bottom: 1rem; 1471 | } 1472 | .btn-businesses { 1473 | margin-left: initial; 1474 | } 1475 | .section-title { 1476 | font-size: 2.3rem; 1477 | } 1478 | .section-description { 1479 | font-size: 1.4rem; 1480 | line-height: 2rem; 1481 | } 1482 | .for-businesses { 1483 | .option-description { 1484 | font-size: 1.4rem; 1485 | line-height: 2rem; 1486 | } 1487 | } 1488 | .teams-head { 1489 | padding: 0 6rem; 1490 | } 1491 | .teams-title { 1492 | font-size: 2.3rem; 1493 | } 1494 | .teams-description { 1495 | font-size: 1.4rem; 1496 | line-height: 2rem; 1497 | } 1498 | .questions-grid { 1499 | grid-template-columns: repeat(auto-fit, minmax(25rem, 1fr)); 1500 | padding: 0 9rem; 1501 | } 1502 | .jobs-title { 1503 | font-size: 2.3rem; 1504 | } 1505 | .jobs-items { 1506 | .column { 1507 | flex-direction: column; 1508 | } 1509 | 1510 | .jobs-item { 1511 | margin-left: initial; 1512 | margin-bottom: 2rem; 1513 | } 1514 | } 1515 | .footer-icon { 1516 | display: none; 1517 | } 1518 | .footer-links-title { 1519 | a { 1520 | font-size: 1.1rem; 1521 | } 1522 | } 1523 | .footer-link { 1524 | font-size: 1.1rem; 1525 | } 1526 | .hire .container{ 1527 | padding: 0 3rem; 1528 | } 1529 | } 1530 | @media screen and (max-width: 500px) { 1531 | .questions-grid{ 1532 | padding: 0; 1533 | } 1534 | } 1535 | /* End Media Queries */ -------------------------------------------------------------------------------- /stackprj/templates/base.html: -------------------------------------------------------------------------------- 1 | {% load static %} 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | Stack Overflow - Where Developers Learn, Share, & Build Careers 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 118 | 119 |
120 | {% if messages %} 121 | {% for message in messages %} 122 | 125 | {% endfor %} 126 | {% endif %} 127 |
128 | 129 | 130 |
131 | 132 | 133 | 134 | 135 | {% block content %} 136 | 137 | {% endblock content %} 138 | 139 |
140 |
141 | 142 |
143 |

Looking for a job?

144 |
145 |
146 |
147 |
148 | 149 |

Browse jobs by technology

150 |
151 |
152 | 153 |

Browse jobs by salary

154 |
155 |
156 |
157 |
158 | 159 |

Browse jobs by visa sponsorship

160 |
161 |
162 | 163 |

Browse remote-friendly jobs

164 |
165 |
166 |
167 |
168 |
View all jobs
169 |
170 |
171 |
172 |
173 |
174 | 175 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | -------------------------------------------------------------------------------- /stackprj/templates/home.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block content %} 3 |
4 |
5 |

We <3 people who code

6 |

7 | We build products that empower developers and connect them to solutions that enable productivity, growth, and discovery. 8 |

9 | 15 |
16 |
17 | 18 | 19 |
20 |
21 |
22 |

For developers, by developers 23 |

24 |
25 |

Stack Overflow is an open community for anyone that codes. We help you get answers to your toughest coding questions, share knowledge with your coworkers in private, and find your next dream job. 26 |

27 |
28 |
29 |
30 |
31 | Public Q & A 32 |
33 |
34 | Public Q&A 35 |
36 |
37 | Get answers to more than 16.5 million questions and give back by sharing your knowledge with others. 38 | Sign up for an account. 39 |
40 | 45 |
46 |
47 |
48 | Private Q & A 49 |
50 |
51 | Public Q&A 52 |
53 |
54 | Level up with Stack Overflow while you work. Share knowledge privately with your coworkers using our flagship Q&A engine. 55 |
56 | 61 |
62 |
63 |
64 | Browse jobs
 65 | 66 |
67 |
68 | Public Q&A 69 |
70 |
71 | Find the right job through high quality listings and search for roles based on title, technology stack, salary, location, and more. 72 | 73 | 74 |
75 | 80 |
81 |
82 |
83 |
84 | 85 |
86 |
87 |
88 |

For businesses, by developers

89 |
90 |

Our mission is to help developers write the script of the future. This means helping you find and hire skilled developers for your business and providing them the tools they need to share knowledge and work effectively.

91 |
92 | 93 | 94 | 95 |
96 |
97 |
98 | Private Q&A 99 |
100 |
101 | Quickly find and share internal knowledge with Private Q&A 102 |
103 |
104 |
105 |
106 | Talent solutions 107 |
108 |
109 | Find the perfect candidate for your growing technical team with Talent solutions 110 | 111 | 112 |
113 |
114 |
115 |
116 |  Advertising platform 117 |
118 |
119 | Accelerate the discovery of your products or services through our Advertising platform 120 |
121 |
122 |
123 | 124 | 125 |
126 |
127 | 128 | 129 |
130 |
131 |
132 |

Unlock siloed knowledge with Stack Overflow for Teams 133 |

134 |

Wikis, chat messages, or formal documentation for knowledge management aren’t effective. Our question and answer format is a proven approach for accessing the right information in less time. 135 |

136 |
137 | Learn More 138 |
139 |
140 | 141 |
142 |
143 |
144 |

Basic

145 |

Private knowledge base for teams

146 |
147 |
148 |
149 |
$6 USD
150 | per teammate / month 151 |
152 |
153 |
154 | 155 | Free 30 day trial 156 |
157 |
158 | 159 | Your own private space hosted on stackoverflow.com 160 |
161 |
162 | 163 | Fully searchable archive 164 |
165 |
166 |
167 | 170 | 171 |
172 | 173 |
174 |
175 | MOST USED 176 | 177 |
178 |
179 |

Business

180 |

Private knowledge base with SSO and premium features

181 |
182 |
183 |
184 |
$12 USD 185 |
186 | per teammate / month 187 |
188 |
189 |
190 | 191 | Single sign-on (SSO) with SAML 192 |
193 |
194 | 195 | Reporting and analytics 196 |
197 |
198 | 199 | Priority customer support 200 |
201 |
202 | 203 | 99.5% uptime 204 | 205 |
206 |
207 | 208 | All the features of Basic tier 209 |
210 |
211 |
212 | 215 | 216 |
217 | 218 |
219 |
220 |

Enterprise

221 |

Standalone knowledge base with enhanced security and flexible hosting 222 | 223 |

224 |
225 |
226 |
227 |
Custom pricing
228 | Let’s talk about what you need 229 |
230 |
231 |
232 | 233 | Single sign-on with AD or SAML 234 |
235 |
236 | 237 | Host on your cloud or servers – or our private managed cloud 238 |
239 |
240 | 241 | Robust read and write API 242 |
243 |
244 | 245 | Your own customer success and community building representative 246 |
247 |
248 | 249 | 99.5% uptime SLA and priority support 250 |
251 |
252 |
253 | 256 | 257 |
258 |
259 | 260 | 261 | 275 | 276 | 277 |
278 |
279 | 280 |
281 |
282 |
283 |
284 | 285 |

Hire your technical talent

286 |

We help expand your technical hiring strategy to promote your employer brand and highlight relevant open roles to our community of over 100 million developers and technologists.

287 | Stack Overflow Talent 288 |
289 |
290 | 291 |

Reach developers worldwide 292 |

293 |

Use the world’s largest resource for people who code to help you increase awareness and showcase your product or service across Stack Overflow’s network of Q&A sites.

294 | Stack Overflow Advertising 295 |
296 |
297 |
298 |
299 | 300 |
301 |
302 |
303 |
304 |

Questions are everywhere, answers are on Stack Overflow

305 |
306 |
307 |
308 |
309 | 310 |
Ask a question
311 |
312 |
313 |
314 | 315 |
Vote on everything
316 |
317 |
318 |
319 | 320 |
Answer questions
321 |
322 |
323 |
324 |
325 | 326 |

327 | Accept the answer which solved your problem to let others benefit from the valuable information. 328 |

329 | Create an account 330 |
331 |
332 |
333 | 334 |
Tag your question
335 |
336 |
337 |
338 | 339 |
Accept a answer
340 |
341 |
342 |
343 | 344 |
Get recognized
345 |
346 |
347 |
348 |
349 | 394 |
395 |
396 |
397 | 398 | {% endblock content %} 399 | --------------------------------------------------------------------------------