Skip to content

Commit

Permalink
Peer profile updated changes
Browse files Browse the repository at this point in the history
  • Loading branch information
manojp3 committed Dec 3, 2024
1 parent e55abea commit c926fac
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
2 changes: 2 additions & 0 deletions common/djangoapps/student/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,8 @@ class Meta:
blank=True, null=True, max_length=6, db_index=True,
choices=LEVEL_OF_EDUCATION_CHOICES
)
company = models.CharField(max_length=255, blank=True, null=True)
designation = models.CharField(max_length=255, blank=True, null=True)
mailing_address = models.TextField(blank=True, null=True)
city = models.TextField(blank=True, null=True)
country = CountryField(blank=True, null=True)
Expand Down
2 changes: 2 additions & 0 deletions lms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4194,6 +4194,8 @@ def _make_locale_paths(settings): # pylint: disable=missing-function-docstring
'date_joined',
'language_proficiencies',
"level_of_education",
"company",
"designation",
'social_links',
'time_zone',

Expand Down
13 changes: 6 additions & 7 deletions lms/templates/peerProfile.html
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@ <h5>Build Connections Beyond Boundaries</h5>
<div class="profile-section d-flex flex-column flex-lg-row align-items-center flex-wrap flex-lg-nowrap text-center text-lg-left">
<img class="profile-img" id="profile_image" src="{{ profile.profile_image_urls.full }}" alt="">
<p class="ml-lg-4 font-weight-bold" id="name" style="font-size: 24px;">
{{ profile.first_name }} {{ profile.last_name }}
{{ profile.first_name }}
</p>
</div>
<div class="ed-section mt-3">
<p style="height:50px;color: rgba(0,0,0,0.5);font-size: 17px; overflow: hidden;display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;" id="level_of_education">{{ profile.level_of_education }}</p>
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;" id="level_of_education">{{ profile.designation }}, {{ profile.company }}</p>
</p>
<p id="bio" style="display: none;">{{ profile.bio }}</p>
<div id="social-links" style="display: none;">
Expand Down Expand Up @@ -274,8 +274,8 @@ <h5>Build Connections Beyond Boundaries</h5>
right: 38px;
">X</span>
<div class="d-flex flex-column flex-lg-row align-content-center modal-content-container">
<div class="peer-img d-fex flex-column align-items-center" style="max-width: 235px;">
<div class="gradient-border">
<div class="peer-img d-fex flex-column align-items-center" style="max-width: 235px;display: flex;">
<div class="gradient-border">
<img class="content profile-img-modal" src="${peer?.profile_image_urls}" style="border-radius: 50%;" alt="${peer?.name}" />
</div>
<div class="social-media d-flex justify-content-center mt-3">
Expand All @@ -290,7 +290,6 @@ <h5>Build Connections Beyond Boundaries</h5>
${peer?.social_links?.facebook ? `<a href=${peer?.social_links?.facebook} target="_blank">
<img src="https://static.talentsprint.com/lms_maple/images/facebook.svg" alt="LinkedIn" class="social-media-icons" />
</a>` : ""}
</div>
</div>
<div class="info-section ml-lg-5 text-center text-lg-left">
Expand Down Expand Up @@ -321,4 +320,4 @@ <h5>Build Connections Beyond Boundaries</h5>
</script>
</body>

</html>
</html>
6 changes: 5 additions & 1 deletion openedx/core/djangoapps/user_api/accounts/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ def to_representation(self, user): # lint-amnesty, pylint: disable=arguments-di
"goals": None,
"year_of_birth": None,
"level_of_education": None,
"company": None,
"designation": None,
"mailing_address": None,
"requires_parental_consent": None,
"accomplishments_shared": accomplishments_shared,
Expand Down Expand Up @@ -192,6 +194,8 @@ def to_representation(self, user): # lint-amnesty, pylint: disable=arguments-di
"level_of_education": AccountLegacyProfileSerializer.convert_empty_to_None(
user_profile.level_of_education
),
"company": AccountLegacyProfileSerializer.convert_empty_to_None(user_profile.company),
"designation": AccountLegacyProfileSerializer.convert_empty_to_None(user_profile.designation),
"mailing_address": user_profile.mailing_address,
"requires_parental_consent": user_profile.requires_parental_consent(),
"account_privacy": get_profile_visibility(user_profile, user, self.configuration),
Expand Down Expand Up @@ -287,7 +291,7 @@ class AccountLegacyProfileSerializer(serializers.HyperlinkedModelSerializer, Rea
class Meta:
model = UserProfile
fields = (
"name", "gender", "goals", "year_of_birth", "level_of_education", "country", "state", "social_links",
"name", "gender", "goals", "year_of_birth", "level_of_education", "company", "designation", "country", "state", "social_links",
"mailing_address", "bio", "profile_image", "requires_parental_consent", "language_proficiencies",
"phone_number", "city"
)
Expand Down

0 comments on commit c926fac

Please sign in to comment.