Skip to content
Snippets Groups Projects
Commit 345f02bf authored by Matthew Juhl's avatar Matthew Juhl
Browse files

Profile view cleaned up.

parent bf4aef16
No related branches found
No related tags found
No related merge requests found
......@@ -72,7 +72,7 @@ echo "<div id=\"profile_info\">";
//This function controls the alternating class
$even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even';
$body .= "<p class=\"{$even_odd}\"><b>";
$body .= "<p id=\"profile_data_" . $item->title . "\" class=\"{$even_odd}\"><b>";
$body .= $item->title.':</b> ';
$body .= $item->value;
......@@ -129,7 +129,7 @@ END;
//This function controls the alternating class
$even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even';
$body .= "<p class=\"{$even_odd}\"><b>";
$body .= "<p id=\"profile_data_" . str_replace(" ", "_", $item->title) . "\" class=\"{$even_odd}\"><b>";
$body .= $item->title.':</b> ';
$body .= $item->value;
......
WDN.jQuery(document).ready(function() {
//handle the search form label
WDN.jQuery('form#searchform label').css({display: "block"});
WDN.jQuery('form#searchform input#search_input').focus(function(){
WDN.jQuery(this).siblings("label").hide();
});
(function($) {
$(document).ready(function(){
//handle the search form label
$('form#searchform label').css({display: "block"});
$('form#searchform input#search_input').focus(function(){
$(this).siblings("label").hide();
});
$('form#searchform input#search_input').blur(function(){
if ($('form#searchform input#search_input').val() == "") {
$(this).siblings("label").show();
};
});
//end handling of the search form label
//Add CSS to forms
WDN.jQuery('#maincontent div.formCool form').addClass("cool");
$("#profile_data_Hometown_City a,p.odd a[href*=profile_city]").css("text-transform","capitalize");
if ($("#profile_info").length > 0) {
// fix the profile display
// fix the current/map location display
var city = $("#profile_data_City a").html(), state, country;
if (city){
$("#profile_data_State b, #profile_data_Country b").remove();
state = $("#profile_data_State").html();
country = $("#profile_data_Country").html();
$("#profile_data_City b").html("Location:");
if (state) {
$("#profile_data_City").append(", " + state);
$("#profile_data_State").remove();
}
if (country) {
$("#profile_data_City").append(", " + country);
$("#profile_data_Country").remove();
}
}
//$("#profile_data_Explanation b").remove();
// fix the hometown location display
var hcity = $("#profile_data_Hometown_City a").html(), hstate, hcountry;
if (hcity){
$("#profile_data_Hometown_State b, #profile_data_Hometown_Country b").remove();
$("#profile_data_Hometown_City b").html("Hometown:");
hstate = $("#profile_data_Hometown_State").html();
hcountry = $("#profile_data_Hometown_Country").html();
if (hstate) {
$("#profile_data_Hometown_City").append(", " + hstate);
$("#profile_data_Hometown_State").remove();
}
if (hcountry) {
$("#profile_data_Hometown_City").append(", " + hcountry);
$("#profile_data_Hometown_Country").remove();
}
}
// fix the years attended
if ($("#profile_data_To").length > 0) {
if ($("#profile_data_Years_Attended_UNL").length > 0) {
// we have to and from here
$("#profile_data_To b").remove();
var to = $("#profile_data_To").html();
$("#profile_data_Years_Attended_UNL").append(" to " + to);
$("#profile_data_To").remove();
} else {
$("#profile_data_To b").html("Year Attended UNL: ");
}
}
// fix birthday (set up to handle various cases, even though right now we require all fields)
if ($("#profile_data_Month").length > 0){
$("#profile_data_Month b").html("Birthday:");
$("#profile_data_Day b").remove();
$("#profile_data_Day").append(", ");
$("#profile_data_Month").append($("#profile_data_Day").html());
$("#profile_data_Day").remove();
$("#profile_data_Year b").remove();
$("#profile_data_Month").append($("#profile_data_Year").html());
$("#profile_data_Year").remove();
} else if ($("#profile_data_Year").length > 0) {
// just birth year should be displayed
$("#profile_data_Day").remove();
$("#profile_data_Year b").html("Birthday");
}
}
});
WDN.jQuery('form#searchform input#search_input').blur(function(){
if (WDN.jQuery('form#searchform input#search_input').val() == "") {
WDN.jQuery(this).siblings("label").show();
};
});
//end handling of the search form label
//Add CSS to forms
WDN.jQuery('#maincontent div.formCool form').addClass("cool");
});
\ No newline at end of file
})(WDN.jQuery);
......@@ -173,7 +173,7 @@ if ($vars['title'] == "Edit profile") {
var selFrom = document.createElement("select");
selFrom.name = "form_data_profile_attended_from";
x = 1940;
html = "<option></option><option>Did Not Attend UNL</option>";
html = '<option></option>';
while (x++ < curYear + 6) {
html+= '<option';
if (x == from_year) {
......@@ -188,7 +188,7 @@ if ($vars['title'] == "Edit profile") {
var selTo = document.createElement("select");
selTo.name = "form_data_profile_attended_to";
x = 1940;
html = "<option></option><option>Did Not Attend UNL</option>";
html = '<option></option>';
while (x++ < curYear + 6) {
html+= '<option';
if (x == to_year) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment