Files
stackalytics/dashboard/templates/_macros/user_profile.html
Ilya Shakhat 85e2f99134 Client-side search in drop-down boxes
1. Drop-down contents are pre-loaded during page load, search is made local
2. Search support is moved out of API
3. Removed API methods:
   * /releases/<release>
   * /project_types/<project_type>
   * /metrics/<metric>
4. Response of API methods used in drop-downs is unified. All of them
   return content under "data" key, default value under "default"
5. Rename JS functions from c_style to camelCase
6. Adapt DriverLog report to new drop-downs behavior

Part of blueprint ui-performance

Change-Id: I7bd9e9d1176d8419aa1e4bc1ccbb7ab4afdf7583
2014-05-28 18:31:12 +04:00

50 lines
1.7 KiB
HTML

{% macro show_user_profile(user_id) -%}
<script type="text/javascript">
function load_user_profile(extra_options) {
$.ajax({
url: makeURI("/api/1.0/users/{{ user_id }}", extra_options),
dataType: "json",
success: function (data) {
var user = data["user"];
extendWithGravatar(user, 64);
$("#user_profile_template").tmpl(data["user"]).appendTo("#user_profile_container");
}
});
}
$(document).ready(function () {
var uri_options = {};
load_user_profile(uri_options);
});
</script>
<script id="user_profile_template" type="text/x-jquery-tmpl">
{% raw %}
<div>
<div style="float: left;"><img src="${gravatar}"></div>
<div style="margin-left: 90px;">
<h2>${user_name}</h2>
<div>Company: {%html company_link %}
[<span style="font-style: italic;"><a
href="https://wiki.openstack.org/wiki/Stackalytics#Company_affiliation" style="color: grey" target="_blank">how to change</a></span>]
</div>
{%if launchpad_id != '' %}
<div>Launchpad: <a href="https://launchpad.net/~${launchpad_id}" target="_blank">${launchpad_id}</a></div>
{%/if%}
{%if core != '' %}
<div>Core in:
{%each( index, value ) core %}
${value[0]} (<small>${value[1]}</small>)
{%/each%}
</div>
{%/if%}
</div>
</div>
{% endraw %}
</script>
<div id="user_profile_container" style="margin-bottom: 2em;"></div>
{%- endmacro %}