{% extends "layout.html" %}
{% import '_macros/activity_log.html' as activity_log %}
{% import '_macros/contribution_summary.html' as contribution_summary %}
{% import '_macros/user_profile.html' as user_profile %}
{% set show_company_breakdown = (not company) and (not user_id) %}
{% set show_engineer_breakdown = (not user_id) %}
{% set show_bp_breakdown = (metric in ['bpd', 'bpc']) %}
{% set show_module_breakdown = (not module) %}
{% set show_user_activity = (user_id) %}
{% set show_module_activity = (module) and (not user_id) %}
{% set show_activity = (show_user_activity) or (show_module_activity) %}
{% set show_contribution_on_left = (not user_id) and (module) %}
{% set show_contribution_on_right = (user_id) or (company and not module) %}
{% set show_user_profile = (user_id) %}
{% set show_top_mentors_options = (metric == 'tm_marks') %}
{% set show_review_ratio = (metric in ['marks', 'tm_marks']) %}
{% macro show_report_links(module=None, company=None, user_id=None) -%}
    {% if module %}
        
        
        
    {% endif %}
    {% if company %}
        
    {% endif %}
    {% if user_id %}
        
    {% endif %}
{%- endmacro %}
{% block scripts %}
{% endblock %}
{% block report_options %}
    {% if show_top_mentors_options %}
        
        
            
            
        
    {% endif %}
{% endblock %}
{% block left_frame %}
    {% if show_company_breakdown %}
    
    Contribution by companies
    
    
        
            
                | # | 
                Company | 
                {{ metric_label }} | 
            
        
        
        
    
    
     
    {% endif %}
    {% if show_engineer_breakdown %}
    
    Contribution by engineers
    
    
        
            
                | # | 
                Engineer | 
                {% if show_review_ratio %}
                    -2|-1|+1|+2|A (+/- ratio) | 
                {% endif %}
                {{ metric_label }} | 
            
        
        
        
    
    
     
    {% endif %}
    {% if show_user_profile %}
        {{ user_profile.show_user_profile(user_id=user_id) }}
    {% endif %}
    {% if show_user_activity %}
        {{ activity_log.show_activity_log(gravatar_size=32, show_all=False) }}
    {% endif %}
    {% if show_contribution_on_left %}
        {{ contribution_summary.show_contribution_summary(show_all=False) }}
        {{ show_report_links(module, company, user_id) }}
    {% endif %}
{% endblock %}
{% block right_frame %}
    {% if show_module_breakdown %}
    
    Contribution by modules
    
    
        
            
                | # | 
                Module | 
                {{ metric_label }} | 
            
        
        
        
    
    
     
    {% endif %}
    {% if show_bp_breakdown %}
    
    Blueprint popularity
    
        This metric shows how many times a blueprint was mentioned in emails and commit messages.
    
    
    
        
            
                | # | 
                Blueprint | 
                Status | 
                Date | 
                Mentions | 
            
        
        
        
    
    
     
    {% endif %}
    {% if show_contribution_on_right %}
        {{ contribution_summary.show_contribution_summary(show_all=False) }}
        {{ show_report_links(module, company, user_id) }}
    {% endif %}
    {% if show_module_activity %}
        {{ activity_log.show_activity_log(gravatar_size=32, show_all=False) }}
    {% endif %}
{% endblock %}