diff --git a/ROADMAP.md b/ROADMAP.md index 107247ff..78801ce0 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -5,11 +5,11 @@ The following are the goals for a 1.0 release, good enough for production use. I ### Basic functionality - ✅ log in, register, reset password -- ✅ browse and subscribe to communities +- ✅ browse and join communities - ✅ post in local community - ✅ comment on posts in local community - ✅ vote -- sort posts by hotness algo +- ✅ sort posts by hotness algo - ✅ markdown - ✅ logging and debugging support @@ -30,7 +30,7 @@ The following are the goals for a 1.0 release, good enough for production use. I ### Moderation - community moderation -- blocking - users, communities, domains, instances. bi-directional. +- ✅ blocking - users, communities, domains, instances. bi-directional. - import/export of block lists ### Onboarding diff --git a/app/admin/routes.py b/app/admin/routes.py index 44c21c7f..bf10ce37 100644 --- a/app/admin/routes.py +++ b/app/admin/routes.py @@ -385,10 +385,11 @@ def admin_user_edit(user_id): profile_file = request.files['profile_file'] if profile_file and profile_file.filename != '': # remove old avatar - file = File.query.get(user.avatar_id) - file.delete_from_disk() - user.avatar_id = None - db.session.delete(file) + if user.avatar_id: + file = File.query.get(user.avatar_id) + file.delete_from_disk() + user.avatar_id = None + db.session.delete(file) # add new avatar file = save_icon_file(profile_file, 'users') @@ -397,10 +398,11 @@ def admin_user_edit(user_id): banner_file = request.files['banner_file'] if banner_file and banner_file.filename != '': # remove old cover - file = File.query.get(user.cover_id) - file.delete_from_disk() - user.cover_id = None - db.session.delete(file) + if user.cover_id: + file = File.query.get(user.cover_id) + file.delete_from_disk() + user.cover_id = None + db.session.delete(file) # add new cover file = save_banner_file(banner_file, 'users') diff --git a/app/auth/routes.py b/app/auth/routes.py index 9d49573d..5084cb03 100644 --- a/app/auth/routes.py +++ b/app/auth/routes.py @@ -104,7 +104,7 @@ def register(): if current_app.config['MODE'] == 'development': current_app.logger.info('Verify account:' + url_for('auth.verify_email', token=user.verification_token, _external=True)) - flash(_('Great, you are now a registered user! Choose some communities to subscribe to. Use the topic filter to narrow things down.')) + flash(_('Great, you are now a registered user! Choose some communities to join. Use the topic filter to narrow things down.')) resp = make_response(redirect(url_for('main.list_communities'))) if user_ip_banned(): diff --git a/app/community/routes.py b/app/community/routes.py index 7079093e..6606ce76 100644 --- a/app/community/routes.py +++ b/app/community/routes.py @@ -222,9 +222,9 @@ def subscribe(actor): success = post_request(community.ap_inbox_url, follow, current_user.private_key, current_user.profile_id() + '#main-key') if success: - flash('Your request to subscribe has been sent to ' + community.title) + flash('Your request to join has been sent to ' + community.title) else: - flash('There was a problem while trying to subscribe.', 'error') + flash('There was a problem while trying to join.', 'error') else: # for local communities, joining is instant banned = CommunityBan.query.filter_by(user_id=current_user.id, community_id=community.id).first() if banned: @@ -232,7 +232,7 @@ def subscribe(actor): member = CommunityMember(user_id=current_user.id, community_id=community.id) db.session.add(member) db.session.commit() - flash('You are subscribed to ' + community.title) + flash('You joined ' + community.title) referrer = request.headers.get('Referer', None) if referrer is not None: return redirect(referrer) @@ -278,14 +278,14 @@ def unsubscribe(actor): activity.result = 'success' db.session.commit() if not success: - flash('There was a problem while trying to subscribe', 'error') + flash('There was a problem while trying to join', 'error') if proceed: db.session.query(CommunityMember).filter_by(user_id=current_user.id, community_id=community.id).delete() db.session.query(CommunityJoinRequest).filter_by(user_id=current_user.id, community_id=community.id).delete() db.session.commit() - flash('You are unsubscribed from ' + community.title) + flash('You are left ' + community.title) cache.delete_memoized(community_membership, current_user, community) else: diff --git a/app/main/routes.py b/app/main/routes.py index 4f49b2c5..030d1e0d 100644 --- a/app/main/routes.py +++ b/app/main/routes.py @@ -163,8 +163,11 @@ def list_local_communities(): @bp.route('/communities/subscribed', methods=['GET']) def list_subscribed_communities(): verification_warning() - communities = Community.query.filter_by(banned=False).join(CommunityMember).filter(CommunityMember.user_id == current_user.id).all() - return render_template('list_communities.html', communities=communities, title=_('Subscribed communities'), + if current_user.is_authenticated: + communities = Community.query.filter_by(banned=False).join(CommunityMember).filter(CommunityMember.user_id == current_user.id).all() + else: + communities = [] + return render_template('list_communities.html', communities=communities, title=_('Joined communities'), SUBSCRIPTION_PENDING=SUBSCRIPTION_PENDING, SUBSCRIPTION_MEMBER=SUBSCRIPTION_MEMBER) diff --git a/app/static/js/scripts.js b/app/static/js/scripts.js index f5ae68a8..bf37ada2 100644 --- a/app/static/js/scripts.js +++ b/app/static/js/scripts.js @@ -87,6 +87,15 @@ function setupConfirmFirst() { event.preventDefault(); // As the user clicked "Cancel" in the dialog, prevent the default action. } }); + }); + + const go_back = document.querySelectorAll('.go_back'); + go_back.forEach(element => { + element.addEventListener("click", function(event) { + history.back(); + event.preventDefault(); + return false; + }); }) } diff --git a/app/static/styles.css b/app/static/styles.css index 71c67130..2b39f51d 100644 --- a/app/static/styles.css +++ b/app/static/styles.css @@ -454,6 +454,7 @@ nav.navbar { max-height: 30px; min-width: 20px; min-height: 20px; + vertical-align: text-top; } .community_icon_big { diff --git a/app/static/styles.scss b/app/static/styles.scss index f92e45c7..15a97f11 100644 --- a/app/static/styles.scss +++ b/app/static/styles.scss @@ -120,6 +120,7 @@ nav.navbar { max-height: 30px; min-width: 20px; min-height: 20px; + vertical-align: text-top; } .community_icon_big { diff --git a/app/templates/base.html b/app/templates/base.html index 415da616..8051e75b 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -73,7 +73,7 @@ {% block navbar %}
{% if subscribed %} - {{ _('Unsubscribe') }} + {{ _('Leave') }} {% else %} - {{ _('Subscribe') }} + {{ _('Join') }} {% endif %}
diff --git a/app/templates/community/community.html b/app/templates/community/community.html index 9d51b591..b433c887 100644 --- a/app/templates/community/community.html +++ b/app/templates/community/community.html @@ -64,11 +64,11 @@Hi {{ user.display_name() }},
To reset your password diff --git a/app/templates/email/verification.html b/app/templates/email/verification.html index 5eb7a158..bdca16ea 100644 --- a/app/templates/email/verification.html +++ b/app/templates/email/verification.html @@ -1,3 +1,4 @@ +
Hi {{ user.display_name() }},
To verify your email address diff --git a/app/templates/email/welcome.html b/app/templates/email/welcome.html index 867dc9b3..e2617290 100644 --- a/app/templates/email/welcome.html +++ b/app/templates/email/welcome.html @@ -1,4 +1,4 @@ -
+Hello {{ first_name }} and welcome!
I'm Rimu, the founder of PieFed and I'd like to personally thank you for signing up.
As this software is still being developed I need your feedback and ideas for how to improve it. You will notice diff --git a/app/templates/errors/404.html b/app/templates/errors/404.html index 3247388a..cda52e29 100644 --- a/app/templates/errors/404.html +++ b/app/templates/errors/404.html @@ -9,7 +9,7 @@
{{ _('The page your browser tried to load could not be found.') }}
- +{{ _('Sorry for the inconvenience! Please let us know about this, so we can repair it and make ChoreBuster better for everyone.') }}
- +{{ _('Sorry for the inconvenience! Please let us know about this, so we can repair it and make PieFed better for everyone.') }}
+{{ _('No posts yet. Subscribe to some communities to see more.') }}
+{{ _('No posts yet. Join some communities to see more.') }}
{{ _('Explore communities') }}
{% endfor %} diff --git a/app/templates/list_communities.html b/app/templates/list_communities.html index 11d9e2e5..c8ff3254 100644 --- a/app/templates/list_communities.html +++ b/app/templates/list_communities.html @@ -12,7 +12,7 @@ {{ _('Local') }} - {{ _('Subscribed') }} + {{ _('Joined') }} {% if topics %} @@ -25,7 +25,7 @@ - {% endif %} + {% endif %} @@ -34,41 +34,42 @@ {{ _('Create local') }} {{ _('Add remote') }} -