Skip to content

Commit

Permalink
Added link to EAC (Issue #188)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcnulty387 committed Feb 27, 2024
1 parent bbb08ad commit eebbfbd
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 64 deletions.
75 changes: 52 additions & 23 deletions profiles/static/js/edit.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
//show edit forms
$(function() {
$("#edit").on('click', function () {
$(".user-form-input").show()
$(".user-form-value").hide()
$("#save").show()
$("#edit").hide()
});
});

//show image upload on click
$(function() {
$("#self-picture").on('click', function () {
$("#upload-form").toggle()
});
});

//upload form data
$(function() {
$("#save").on('click', function (e) {

var form_data = {
function submitFormData() {
return new Promise((resolve, reject) => {
var form_data = {
"name": $("#user-name").val(),
"birthday": $("#user-birthday").val(),
"phone": $(".user-mobile").map(function() {
Expand Down Expand Up @@ -52,14 +33,62 @@ $(function() {
contentType: 'application/json',
data: JSON.stringify(form_data),
success: function (data, textStatus, jqXHR) {
location.reload();
resolve(data);
},
error: function(error) {
console.log(error);
reject(error);
}
});

});
}


//show edit forms
$(function() {
$("#edit").on('click', function () {
$(".user-form-input").show()
$(".user-form-value").hide()
$("#save").show()
$("#edit").hide()
$("#social-media").css("text-align", "left")
});
});

//show image upload on click
$(function () {
$("#self-picture").on('click', function () {
$("#upload-form").toggle()
});
});

//upload form data
$(function () {
$("#save").on('click', function (e) {
submitFormData().then(function (data) {
location.reload();
}).catch(function (error) {
console.log(error);
});
});
});

//redirects to eac
$(function () {
$(".add-socials").on('click', function () {
submitFormData().then(function (data) {
$(".user-form-input").hide()
$(".user-form-value").show()
$("#save").hide()
$("#edit").show()
$("#social-media").css("text-align", "center")

window.location.href = 'https://eac.csh.rit.edu'
}).catch(function (error) {
console.log(error);
});
});
});

//************* PROFILE PICTURE *************
Expand Down
85 changes: 44 additions & 41 deletions profiles/templates/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,48 +106,51 @@ <h6 class="card-subtitle mb-2 text-muted">

{% if member_info.user_obj.homepageURL or member_info.user_obj.blogURL or member_info.user_obj.github or member_info.user_obj.googleScreenName or member_info.user_obj.twitterName or member_info.user_obj.resumeURL %}
<hr>

{% if member_info.user_obj.homepageURL %}
<a href="{{ member_info.user_obj.homepageURL }}" data-toggle="tooltip" data-placement="bottom" title="{{ member_info.user_obj.homepageURL }}">
<h2 style="display: inline" class="text-muted">
<i class="fas fa-globe" data-fa-transform="shrink-7" data-fa-mask="fas fa-circle"></i>
</h2>
</a>
{% endif %}
{% if member_info.user_obj.blogURL %}
<a href="{{ member_info.user_obj.blogURL }}" data-toggle="tooltip" data-placement="bottom" title="{{ member_info.user_obj.blogURL }}">
<h2 style="display: inline" class="text-warning">
<i class="fas fa-rss" data-fa-transform="shrink-7" data-fa-mask="fas fa-circle"></i>
</h2>
</a>
{% endif %}
{% if member_info.user_obj.resumeURL %}
<a href="{{ member_info.user_obj.resumeURL }}" data-toggle="tooltip" data-placement="bottom" title="{{ member_info.user_obj.resumeURL }}">
<h2 style="display: inline" class="text-info">
<i class="far fa-file-alt" data-fa-transform="shrink-7" data-fa-mask="fas fa-circle"></i>
</h2>
</a>
{% endif %}
{% if member_info.user_obj.github %}
<a href="https://github.com/{{ member_info.user_obj.github }}" data-toggle="tooltip" data-placement="bottom" title="@{{ member_info.user_obj.github }}">
<h2 style="display: inline; color: #6e5494;">
<i class="fab fa-github" data-fa-transform="shrink-7" data-fa-mask="fas fa-circle"></i>
</h2>
</a>
{% endif %}
{% if member_info.user_obj.googleScreenName %}
<h2 style="display: inline" class="text-success" data-toggle="tooltip" data-placement="bottom" title="{{ member_info.user_obj.googleScreenName }}">
<i class="fab fa-google" data-fa-transform="shrink-7" data-fa-mask="fas fa-circle"></i>
</h2>
{% endif %}
{% if member_info.user_obj.twitterName %}
<a href="https://twitter.com/{{ member_info.user_obj.twitterName }}" data-toggle="tooltip" data-placement="bottom" title="@{{ member_info.user_obj.twitterName }}">
<h2 style="display: inline; color: #00aced;">
<i class="fab fa-twitter" data-fa-transform="shrink-7" data-fa-mask="fas fa-circle"></i>
<div id="social-media" style="position: relative;">
{% if member_info.user_obj.homepageURL %}
<a href="{{ member_info.user_obj.homepageURL }}" data-toggle="tooltip" data-placement="bottom" title="{{ member_info.user_obj.homepageURL }}">
<h2 style="display: inline" class="text-muted">
<i class="fas fa-globe" data-fa-transform="shrink-7" data-fa-mask="fas fa-circle"></i>
</h2>
</a>
{% endif %}
{% if member_info.user_obj.blogURL %}
<a href="{{ member_info.user_obj.blogURL }}" data-toggle="tooltip" data-placement="bottom" title="{{ member_info.user_obj.blogURL }}">
<h2 style="display: inline" class="text-warning">
<i class="fas fa-rss" data-fa-transform="shrink-7" data-fa-mask="fas fa-circle"></i>
</h2>
</a>
{% endif %}
{% if member_info.user_obj.resumeURL %}
<a href="{{ member_info.user_obj.resumeURL }}" data-toggle="tooltip" data-placement="bottom" title="{{ member_info.user_obj.resumeURL }}">
<h2 style="display: inline" class="text-info">
<i class="far fa-file-alt" data-fa-transform="shrink-7" data-fa-mask="fas fa-circle"></i>
</h2>
</a>
{% endif %}
{% if member_info.user_obj.github %}
<a href="https://github.com/{{ member_info.user_obj.github }}" data-toggle="tooltip" data-placement="bottom" title="@{{ member_info.user_obj.github }}">
<h2 style="display: inline; color: #6e5494;">
<i class="fab fa-github" data-fa-transform="shrink-7" data-fa-mask="fas fa-circle"></i>
</h2>
</a>
{% endif %}
{% if member_info.user_obj.googleScreenName %}
<h2 style="display: inline" class="text-success" data-toggle="tooltip" data-placement="bottom" title="{{ member_info.user_obj.googleScreenName }}">
<i class="fab fa-google" data-fa-transform="shrink-7" data-fa-mask="fas fa-circle"></i>
</h2>
</a>
{% endif %}

{% endif %}
{% if member_info.user_obj.twitterName %}
<a href="https://twitter.com/{{ member_info.user_obj.twitterName }}" data-toggle="tooltip" data-placement="bottom" title="@{{ member_info.user_obj.twitterName }}">
<h2 style="display: inline; color: #00aced;">
<i class="fab fa-twitter" data-fa-transform="shrink-7" data-fa-mask="fas fa-circle"></i>
</h2>
</a>
{% endif %}
<button class="add-socials user-form-input" style="position: absolute; right: 0; bottom: 0;">
<span>+</span>
</button>
</div>
{% endif %}
<div style="text-align: left;">
<div class="form-group user-form-input">
Expand Down

0 comments on commit eebbfbd

Please sign in to comment.