(function($) {
function loadProfile(gid, success) {
- $.get('/drupal/civicrm/profile/edit', {
+ $.get('/civicrm/profile/edit', {
gid: gid,
json: 1
}, success);
return _.isString(field.label) && _.isString(field.html);
})
.map(function (field) {
- return $('<div></div>')
- .append(field.label)
- .append(field.html);
+ return $('<div class="crm-section"></div>')
+ .append($('<div class="form-item"></div>')
+ .append($('<div class="label"></div>')
+ .append(field.label))
+ .append($('<div class="content"></div>')
+ .append(field.html))
+ .append($('<div class="clear"></div>')));
})
.value();
}
+ // Support older versions of jQuery that don't parse the JSON by
+ // default.
+ profile = _.isString(profile) ? JSON.parse(profile): profile;
var form = $('<form' + profile.attributes + '></form>');
form.append(profile.requirednote)
.append(profile.hidden)
.append.apply(form, renderFields());
- $('#crm-main-content-wrapper').append(form);
+ $('#info-loading').remove();
+ $('#info-form').append(form);
}
$(document).ready(function() {
- loadProfile(memberDashboard.profile_id, renderProfile);
+ loadProfile(memberDashboard.profileId, renderProfile);
});
})(jQuery);