diff --git a/TODO.txt b/TODO.txt index 9e4cca8..f57fc6b 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,14 +1,44 @@ +v1.0 [x] login page [x] logout -[ ] change password [x] member profile update and avatar [x] forum -[ ] view other's profiles, add links in forums +[x] anonymous prayerbox +[x] view other's profiles, add links in forums [x] member type +[x] change password page +[x] users must be authed +[x] signup must redirect NOT auto grant users access, and MUST give them some info on what to expect + +v1.1 +[ ] polls +[ ] watch forum, get email notifications when someone replies +[ ] @ replies? +[ ] display if user is currently logged on when seeing their posts and their profile +[ ] show how many posts a user has made, flair for high amounts of posts? +[ ] chat room? IRC? + +TO DISCUSS: [ ] nav bar -[ ] users must be authed -[ ] signup must redirect NOT auto grant users access, and MUST give them some info on what to expect +[ ] page that displays all users and links to their websites (this already exists on neko, but better to automate it) +[ ] Pick better anonymous avatar [ ] determine where which pages should live where [ ] easier way to handle sites var, API endpoint? -[ ] send out emails to existing users letting them know they have a password and to change it -[ ] + +ACTION ITEMS: +DOMINIC --- +[x] join option without member area access +[x] NAV BAR +[x] list user api endpoint +[x] CSS +[x] Assets +[ ] soft-release +[ ] email notifications when user signs up: disroot email +[ ] maybe start sending emails to users automatically too + +KYRIE ---- +[ ] Welcome message +[ ] Signup screen +[ ] new css design +[ ] send out emails to existing users to sign up AFTER website is released + diff --git a/cwr/settings.py b/cwr/settings.py index a193610..9bdf66e 100644 --- a/cwr/settings.py +++ b/cwr/settings.py @@ -110,6 +110,10 @@ USE_TZ = True STATIC_URL = 'static/' STATIC_ROOT = 'static/' +site_root = '/home/dominic/repos/cwr' +STATICFILES_DIRS = ( + os.path.join(site_root, 'assets/'), +) LOGIN_REDIRECT_URL = 'forum_threads' LOGOUT_REDIRECT_URL = "login" # Default primary key field type diff --git a/cwr/urls.py b/cwr/urls.py index bd58c44..2548015 100644 --- a/cwr/urls.py +++ b/cwr/urls.py @@ -1,15 +1,20 @@ from django.contrib import admin from django.urls import path, include -from web.views import signup, forum_threads, thread, custom_logout, profile +from web.views import signup, forum_threads, thread, custom_logout, profile, user_profile, denied, users urlpatterns = [ path('markdownx/', include('markdownx.urls')), path('admin/', admin.site.urls), + path('api/users/', users, name='users'), path("accounts/", include("django.contrib.auth.urls")), path("accounts/signup/", signup, name="signup"), path("accounts/profile/", profile, name="profile"), + path("accounts/user/", user_profile, name="user"), + path("accounts/denied/", denied, name="denied"), path('logout/', custom_logout, name='custom_logout'), + path("", forum_threads, name='index'), path("forum/threads/", forum_threads, name='forum_threads'), path("forum/thread/", thread, name='thread'), + # path("test/", test_endpoint, name='test'), ] diff --git a/static/img/bg.png b/static/img/bg.png new file mode 100644 index 0000000..413e053 Binary files /dev/null and b/static/img/bg.png differ diff --git a/static/img/bible.png b/static/img/bible.png new file mode 100644 index 0000000..e460cf9 Binary files /dev/null and b/static/img/bible.png differ diff --git a/static/img/widget-example.png b/static/img/widget-example.png new file mode 100644 index 0000000..f4c4bfe Binary files /dev/null and b/static/img/widget-example.png differ diff --git a/web/forms.py b/web/forms.py index 1ba2fe7..8facf6b 100644 --- a/web/forms.py +++ b/web/forms.py @@ -8,14 +8,22 @@ class SignupForm(UserCreationForm): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - for field_name in self.fields: + self.fields['email'].required = True + self.fields['email'].help_text = 'Email will be used to alert you of major announcements or information regarding your account.' + ignored_help_text_fields = ['password1', 'password2', 'username'] + for field_name in ignored_help_text_fields: self.fields[field_name].help_text = '' - url = forms.URLField(max_length=200, help_text='Required') - description = forms.CharField(widget=forms.Textarea) - rule_conf = forms.BooleanField(label='Have you read the rules?') + url = forms.URLField(max_length=200, required=True, help_text='The URL of the website that you intend to add the widget to. please follow the format of: https://your-website.com') + description = forms.CharField(widget=forms.Textarea, help_text='Please provide a description about your website. Feel free to add a description about yourself as well.') + + rule_conf = forms.BooleanField(label='Have you read the rules?', help_text='Please be sure to read the rules before signing up for this webring. The rules can be found here') rule_conf.widget.attrs.update({'class': 'checkmark'}) - comments = forms.CharField(widget=forms.Textarea) + + email_only = forms.BooleanField(label='Skip Member Area', help_text='If you just want to add the webring widget to your website and do not care about the community aspect of this webring, click this checkmark. Any important announcements will be sent to you via email. If you decide you would like to join the member area later on, contact an admin.', required=False) + email_only.widget.attrs.update({'class': 'checkmark'}) + + comments = forms.CharField(widget=forms.Textarea, required=False) class Meta: model = CustomUser @@ -27,6 +35,7 @@ class SignupForm(UserCreationForm): 'url', 'description', 'rule_conf', + 'email_only', 'comments' ) diff --git a/web/migrations/0006_forumsubcategory_can_by_anon.py b/web/migrations/0006_forumsubcategory_can_by_anon.py new file mode 100644 index 0000000..90039e5 --- /dev/null +++ b/web/migrations/0006_forumsubcategory_can_by_anon.py @@ -0,0 +1,18 @@ +# Generated by Django 5.2.7 on 2025-10-23 18:20 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('web', '0005_remove_forumpost_title_alter_forumpost_content'), + ] + + operations = [ + migrations.AddField( + model_name='forumsubcategory', + name='can_by_anon', + field=models.BooleanField(default=False), + ), + ] diff --git a/web/migrations/0007_customuser_email_only_alter_customuser_comments_and_more.py b/web/migrations/0007_customuser_email_only_alter_customuser_comments_and_more.py new file mode 100644 index 0000000..2e557d5 --- /dev/null +++ b/web/migrations/0007_customuser_email_only_alter_customuser_comments_and_more.py @@ -0,0 +1,28 @@ +# Generated by Django 5.2.7 on 2025-11-01 01:00 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('web', '0006_forumsubcategory_can_by_anon'), + ] + + operations = [ + migrations.AddField( + model_name='customuser', + name='email_only', + field=models.BooleanField(default=False), + ), + migrations.AlterField( + model_name='customuser', + name='comments', + field=models.TextField(blank=True, default=''), + ), + migrations.AlterField( + model_name='customuser', + name='flair', + field=models.CharField(blank=True, default=''), + ), + ] diff --git a/web/models/custom_user.py b/web/models/custom_user.py index b76045a..3282c09 100644 --- a/web/models/custom_user.py +++ b/web/models/custom_user.py @@ -7,6 +7,7 @@ class CustomUser(AbstractUser): description = models.TextField(default='') avatar = models.TextField(default='', blank=True) rule_conf = models.BooleanField(default=True) - comments = models.TextField(default='') - flair = models.CharField(default='') + comments = models.TextField(default='', blank=True) + flair = models.CharField(default='', blank=True) + email_only = models.BooleanField(default=False) diff --git a/web/models/forum_subcategory.py b/web/models/forum_subcategory.py index cd995a5..eebad76 100644 --- a/web/models/forum_subcategory.py +++ b/web/models/forum_subcategory.py @@ -9,6 +9,7 @@ class ForumSubcategory(BaseModel): description = models.TextField() forum_category = models.ForeignKey(ForumCategory, on_delete=models.CASCADE) sticky = models.BooleanField() + can_by_anon = models.BooleanField(default=False) class Meta: db_table = 'forum_subcategory' diff --git a/web/templates/base.html b/web/templates/base.html index 704d85a..84dc99c 100644 --- a/web/templates/base.html +++ b/web/templates/base.html @@ -1,7 +1,7 @@ +{% load static %} - Christians of the Internet @@ -9,124 +9,182 @@

Christians of the Internet