Ver Fonte

More fixes in the skills UI see #1791

Julio Montoya há 12 anos atrás
pai
commit
4038165d0c

+ 1 - 2
main/inc/ajax/skill.ajax.php

@@ -98,8 +98,7 @@ switch ($action) {
         break;
     case 'get_saved_profiles':
         $skill_profile   = new SkillProfile();
-        $profiles = $skill_profile->get_all();
-        
+        $profiles = $skill_profile->get_all();        
         Display::display_no_header();        
         Display::$global_template->assign('profiles', $profiles);
         echo Display::$global_template->fetch('default/skill/profile_item.tpl');

+ 1 - 1
main/template/default/layout/no_layout.tpl

@@ -10,7 +10,7 @@
 {% block name%}
 {% endblock %}
 {% block body %}
-    {{content}}
+    {{ content }}
 {% endblock %}
 </body>
 </html>

+ 14 - 9
main/template/default/skill/profile.tpl

@@ -50,19 +50,24 @@
         <div class="row-fluid">
         {% for user in user_list %}
             <div class="span4">
-                <div class="well">
-                    <div class="ui-widget-header">                    
-                        <h3>
-                            <img src="{{user.user.avatar_small}}" /> {{user['user'].complete_name}} ({{user['user'].username}})
-                        </h3>
-                    </div>
+                <div class="well_border">                                 
+                    <h3>
+                        <img src="{{user.user.avatar_small}}" /> 
+                        <a href="{{ _p.web_main }}social/profile.php?u={{ user['user'].user_id }}">{{ user['user'].complete_name }} ({{user['user'].username}}) </a>
+                    </h3>
+                    <hr >
                     <div class="ui-widget-content ">
                         <h4>{{ "Skills"|get_lang }} {{ user.total_found_skills }} / {{ total_search_skills }}</h4>
                         <ul>                
-                            {% for skill_data in user.skills %}                 
+                            {% for skill_data in user.skills %}                                     
                                 <li>
-                                    {% if skill_list[skill_data.skill_id].name is not null %}                                    
-                                        <span class="label_tag skill">{{skill_list[skill_data.skill_id].name}}</span>
+                                    {% if skill_list[skill_data.skill_id].name is not null %}                       
+                                        {% if skill_data.found %}                                        
+                                            <span class="label label-important">{{ skill_list[skill_data.skill_id].name }}</span>
+                                        {% else %} 
+                                            <span class="label_tag skill">{{ skill_list[skill_data.skill_id].name }}</span>
+                                        {% endif %}        
+                                        
                                     {% else %} 
                                         {{ "SkillNotFound"|get_lang }}
                                     {% endif %}

+ 22 - 8
main/template/default/skill/skill_wheel.js.tpl

@@ -12,7 +12,7 @@ var main_depth = 4;
 var main_parent_id = 0;
 
 // Used to split in two word or not
-var max_size_text_length = 14; 
+var max_size_text_length = 13; 
   
 /* ColorBrewer settings */
 var my_domain = [1,2,3,4,5,6,7,8,9];
@@ -385,7 +385,6 @@ function open_popup(skill_id, parent_id) {
                      var params = $("#add_item").find(':input').serialize();
                      add_skill(params);                     
                   }
-
             },
             close: function() {     
                 $("#name").attr('value', '');
@@ -414,8 +413,9 @@ function handle_mousedown_event(d, path, text, icon, arc, x, y, r, padding, vis)
             break;
         default:
             //alert('You have a strange mouse :D '); //
-    }        
     }
+}
+    
 
 /* 
     Loads the skills partitions thanks to a json call
@@ -591,6 +591,10 @@ function load_nodes(load_skill_id, main_depth, extra_parent_id) {
         .attr("text-anchor", function(d) {
             return x(d.x + d.dx / 2) > Math.PI ? "end" : "start";
         })
+        .attr("rel", "tooltip_skill")
+        .attr("title", function(d) {
+            return d.name;
+        })
         .attr("dy", ".2em")
         .attr("transform", function(d) {
             /** Get the text details and define the rotation and general position */
@@ -600,10 +604,10 @@ function load_nodes(load_skill_id, main_depth, extra_parent_id) {
             return "rotate(" + rotate + ")translate(" + (y(d.y) + padding) + ")rotate(" + (angle > 90 ? -180 : 0) + ")";
         })
         .on("mouseover", function(d, i) {                    
-            $("#icon-" + i).show();                         
+            //$("#icon-" + i).show();                
         })
         .on("mouseout", function(d, i) {
-            $("#icon-" + i).hide();                
+            //$("#icon-" + i).hide();                
         })
         .on("contextmenu", function(d, i) {            
             handle_mousedown_event(d, path, text, icon, arc, x, y, r, padding, vis);  
@@ -622,14 +626,24 @@ function load_nodes(load_skill_id, main_depth, extra_parent_id) {
         .attr("x", 0)
         .text(function(d) {
             if (d.depth && d.name.length > max_size_text_length) {
-                insert_two_words = true;
-                return d.depth ? d.name.split(" ")[0] : "";
+                if (d.depth) {                    
+                    first_part = d.name.split(" ")[0];
+                    second_part = d.name.split(" ")[1];                    
+                    if (first_part.length >= max_size_text_length) {
+                        insert_two_words = false;
+                        return first_part.substring(0, max_size_text_length -3)  + ' ... ';
+                    } else {
+                        return first_part;
+                    }                
+                } else {
+                    return "";
+                }
             } else {
                 insert_two_words = false;
                 return d.depth ? d.name : "";
             }            
         });
-
+        
         if (insert_two_words) {
             textEnter.append("tspan")
             .attr("x", 0)

+ 8 - 2
main/template/default/skill/skill_wheel.tpl

@@ -226,6 +226,12 @@ function toogle_save_profile_form() {
 $(document).ready(function() {
     /* Skill search */ 
     
+        //Tool tip (in exercises)
+    var tip_options = {
+        placement : 'right'
+    }
+    $('.tooltip_skill').tooltip(tip_options);
+    
     /* Skill item list onclick  */
     $("#skill_holder").on("click", "input.skill_to_select", function() {
         skill_id = $(this).attr('rel');
@@ -352,7 +358,7 @@ $(document).ready(function() {
         autoOpen: false,
         modal   : true, 
         width   : 600, 
-        height  : 580
+        height  : 630
     });
     
     //Save search profile dialog
@@ -483,7 +489,7 @@ $(document).ready(function() {
         </div>
 </div>
 
-<div id="dialog-form" style="display:none; z-index:9001;">
+<div id="dialog-form" style="">
     <p class="validateTips"></p>
     <form id="add_item" class="form-horizontal"  name="form">
         <fieldset>