Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces real authentication and database-backed profile functionality, replacing several placeholder flows and adding a new landing page to funnel unauthenticated users into login/registration.
Changes:
- Added real login/cadastro/logout routes, plus
login_requiredprotection across most authenticated pages. - Implemented DB-backed “meu perfil”, edição de perfil (incl. curso por instituto/departamento) e exclusão de conta.
- Updated multiple templates to link avatars/names to connection profiles and added a new landing page.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| seed.py | Updates seed data to add new institutes/departments/courses (but currently creates inconsistent academic relations). |
| routes.py | Adds authentication routes/queries integration and login protection; updates profile routes to use real DB data. |
| app/templates/profile/partials/edit_feedback.html | Adds partial for edit-profile feedback rendering. |
| app/templates/profile/my_profile.html | Adds real “deletar perfil” POST form with confirmation. |
| app/templates/profile/edit_profile.html | Reworks edit profile UI to use institute/department/course selection and password change fields. |
| app/templates/profile/connection_profile.html | Simplifies connection profile rendering and conditionally shows actions only when logged in. |
| app/templates/main/partials/feed_post.html | Adds links from post header (avatar/name) to the author’s connection profile. |
| app/templates/main/partials/explore_results.html | Reformats results and adds profile link behavior for students (currently conflicts with HTMX behavior). |
| app/templates/main/index.html | Refactors feed UI and adds links from connection requests to profiles (but currently breaks image upload UI). |
| app/templates/main/explore.html | Adds links from highlight posts to author profiles. |
| app/templates/landing.html | Adds a new landing page with CTA buttons to login/cadastro. |
| app/templates/chat/direct_messages.html | Adds profile links in conversation list (currently conflicts with HTMX open-conversation click). |
| app/templates/chat/direct_messages_content.html | Adds profile links on message avatars. |
| app/templates/base.html | Updates base layout formatting and adds a “Olá, ” greeting in the sidebar. |
| app/templates/auth/register.html | Updates cadastro page UI and adds institute/department/course selection via fetch. |
| app/templates/auth/partials/departamento_options.html | Adds options partial for departments (HTMX/fetch response). |
| app/templates/auth/partials/curso_options.html | Adds options partial for courses (HTMX/fetch response). |
| app/templates/auth/login.html | Updates login page UI and adds server-side error display. |
| app/static/css/style.css | Adds sidebar greeting styles and minor formatting change. |
| app/queries/conexoes.py | Extends pending connection requests query to include user_id for profile linking. |
| app/queries/auth.py | Adds auth/profile DB queries (create user, authenticate, profile CRUD, password change). |
| app/queries/academico.py | Adds academic listing queries for institutes/departments/courses to support cadastro/edição. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| bcc = inserir_curso('BCC', 'Bacharelado em Ciência da Computação', dcc['idDepartamento'], ie['idInstituto']) | ||
| bma = inserir_curso('BMA', 'Bacharelado em Matemática', dma['idDepartamento'], ie['idInstituto']) | ||
| bfis = inserir_curso('BFIS', 'Bacharelado em Física', dfis['idDepartamento'], ie['idInstituto']) | ||
| bfis = inserir_curso('BFIS', 'Bacharelado em Física', fu['idDepartamento'], ifis['idInstituto']) |
Comment on lines
+33
to
+37
| @functools.wraps(f) | ||
| def decorated_function(*args, **kwargs): | ||
| if 'user_id' not in session: | ||
| return redirect(url_for('auth.acesso_restrito')) | ||
| return f(*args, **kwargs) |
| """ | ||
|
|
||
| from flask import Blueprint, render_template, request, redirect, url_for, session, abort, make_response, Response, send_file | ||
| from flask import Blueprint, render_template, request, redirect, url_for, session, abort, make_response, Response, send_file, flash |
Comment on lines
+316
to
+320
| status_info = conexoes_queries.get_status_conexao(current_user_id, user_id) | ||
|
|
||
| posts_raw = auth_queries.get_publicacoes_do_usuario(user_id) | ||
| groups_raw = auth_queries.get_grupos_do_usuario(user_id) | ||
|
|
Comment on lines
+22
to
+29
| <section class="card"> | ||
| <h3>Publicações</h3> | ||
| <ul class="profile-list"> | ||
| {% for post in student.posts %} | ||
| <li>{{ post }}</li> | ||
| {% endfor %} | ||
| </ul> | ||
| </section> |
Comment on lines
+31
to
+38
| <section class="card"> | ||
| <h3>Grupos de Estudos</h3> | ||
| <ul class="profile-list"> | ||
| {% for group in student.groups %} | ||
| <li>{{ group }}</li> | ||
| {% endfor %} | ||
| </ul> | ||
| </section> |
Comment on lines
+23
to
+32
| <a | ||
| href="{{ url_for('main.perfil_conexao', user_id=student.id) }}" | ||
| style="text-decoration: none; color: inherit" | ||
| > | ||
| <div | ||
| class="result-row" | ||
| hx-get="{{ url_for('main.resumo_aluno', user_id=student.id) }}" | ||
| hx-target="#explore-right-panel" | ||
| hx-swap="innerHTML" | ||
| style="cursor: pointer" |
Comment on lines
+13
to
+33
| <a | ||
| href="{{ url_for('main.perfil_conexao', user_id=conversation.user_id) }}" | ||
| style=" | ||
| text-decoration: none; | ||
| color: inherit; | ||
| display: flex; | ||
| align-items: center; | ||
| gap: 12px; | ||
| flex: 1; | ||
| " | ||
| > | ||
| <div class="conversation-avatar"> | ||
| <div class="avatar">{{ conversation.initials }}</div> | ||
| </div> | ||
| <div class="conversation-info"> | ||
| <div class="conversation-name">{{ conversation.name }}</div> | ||
| <div class="conversation-preview"> | ||
| {{ conversation.last_message }} | ||
| </div> | ||
| </div> | ||
| </a> |
Comment on lines
+6
to
+10
| <form | ||
| hx-post="{{ url_for('main.criar_publicacao') }}" | ||
| hx-target="#feed-posts" | ||
| hx-swap="afterbegin" | ||
| hx-on="htmx:afterRequest: if(event.detail.successful){ this.reset() }" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.