All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit 5fac962d authored by Keith Downie's avatar Keith Downie

Added My profiles to profile picker

parent 6db95f98
......@@ -400,6 +400,7 @@ function SPITFORM($formfields, $newuser, $errors)
echo " window.DOCONSTRAINTS = 1;\n";
echo " window.SKIPFIRSTSTEP = " . ($skipfirststep ? "true" : "false") . ";\n";
echo " window.PORTAL_NAME = '$PORTAL_NAME';\n";
echo " window.USERNAME = '" . $formfields["username"] . "';\n";
echo "</script>\n";
echo "<script src='js/lib/jquery-2.0.3.min.js'></script>\n";
......
......@@ -110,6 +110,7 @@ $(function ()
var html = mainTemplate({
formfields: decodejson('#form-json'),
profiles: profilelist,
myprofiles: projcategories.myprofiles,
projprofiles: projcategories.inproj,
systemprofiles: projcategories.sysproj,
otherprofiles: projcategories.otherproj,
......@@ -382,7 +383,7 @@ $(function ()
// Put profiles into the correct categories to be built in the template
function MakeProfileCategories(profiles) {
var result = {favorite:{},inproj:{},sysproj:{},otherproj:{}};
var result = {favorite:{},myprofiles:{},inproj:{},sysproj:{},otherproj:{}};
// This section should probably be rethought as it's not very clean.
// Didn't have time to refactor for initial release.
......@@ -397,9 +398,15 @@ $(function ()
result.favorite[key] = obj;
}
}
if (window.USERNAME == obj.creator) {
result.myprofiles[key] = obj;
}
if (isSystem) {
result.sysproj[key] = obj;
}
if (projlist && _.has(projlist, obj.project)) {
if (!result.inproj[obj.project]) {
result.inproj[obj.project] = {};
......
......@@ -465,8 +465,8 @@
<% }; %>
</ul>
<% var hide = (registered && !$.isEmptyObject(favorites)) ? '' : 'hidden';%>
<span id='title_favorites' class='<%- hide %>'>
<% var hidefav = (registered && !$.isEmptyObject(favorites)) ? '' : 'hidden';%>
<span id='title_favorites' class='<%- hidefav %>'>
Favorites
<span class='category_collapsable expanded'></span>
</span>
......@@ -479,6 +479,20 @@
<% }); %>
</ul>
<% var hidemy = (registered && !$.isEmptyObject(myprofiles)) ? '' : 'hidden';%>
<span id='title_my_profiles' class='<%- hidemy %>'>
My Profiles
<span class='category_collapsable expanded'></span>
</span>
<ul class='list-category' id='myprofiles'>
<% _.each(myprofiles, function(value, key) { %>
<li class='list-group-item profile-item clearfix'
value='<%- key %>' name='<%- value.name %>'><%- value.name %>
<div class="project_info pull-right"><%- value.project %></div>
</li>
<% }); %>
</ul>
<% _.each(projprofiles, function(value, key) { %>
<span id='title_<%- key %>_profiles'>
<%- key %>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment