Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display different eva links depending on semester #633

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

joaquintomas2003
Copy link
Contributor

What

  • Si corresponde, mostrar mas de un link de EVA, uno por cada semestre.

Pending questions

  • Hay mas cursos con mas de un EVA?
  • Podríamos guardar los eva_ids de otra forma?

@@ -73,7 +73,7 @@ CP49:
'1052':
category: 'inactive'
'1062':
eva_id: '1131'
eva_id: '1594/1131'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thoughts about adding a separate field/column for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean adding an extra column for the eva_id of the second semester?
I think it would look cleaner for sure, but in 99% of cases it would be null, are we ok with that?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean adding an extra column for the eva_id of the second semester?
yeah

IMO it's ok if it's almost always null, but open to discuss it if others prefer reusing the same field

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wdyt about it now?
I like it more than having it in the same field, but I'm still not convinced, the naming of the column seems kind of odd, but maybe that's me 🤣

@joaquintomas2003 joaquintomas2003 force-pushed the jt--multiple_eva_links branch 3 times, most recently from e25ddc4 to 298a7c2 Compare January 23, 2025 01:04
Comment on lines +2 to +8
def up
add_column :subjects, :second_semester_eva_id, :string, if_not_exists: true
end

def down
remove_column :subjects, :second_semester_eva_id, if_exists: true
end
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def up
add_column :subjects, :second_semester_eva_id, :string, if_not_exists: true
end
def down
remove_column :subjects, :second_semester_eva_id, if_exists: true
end
def change
add_column :subjects, :second_semester_eva_id, :string
end

<span class="mdc-deprecated-list-item__graphic material-icons">forum</span>
<span class="mdc-deprecated-list-item__text">EVA</span>
</a>
<%= display_eva_links(@subject) %>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<%= display_eva_links(@subject) %>
<% second_semester_eva_id = @subject.second_semester_eva_id %>
<%= render 'shared/eva_links_component', eva_id: @subject.eva_id, text: second_semester_eva_id ? "EVA - Primer semestre" : "EVA" %>
<%= render 'shared/eva_links_component', eva_id: second_semester_eva_id, text: "EVA - Segundo semestre" if second_semester_eva_id %>

if you like it better, i think you can do something like this to make it more direct and avoid the helper and method on the model.

I'm ok either way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants