icon images in css, little debug, update document profile configuration
authorcavaliet
Fri, 02 Dec 2011 11:31:51 +0100
changeset 52 e804ae133f27
parent 51 67c323b2f4d1
child 53 22377c9e2eae
icon images in css, little debug, update document profile configuration
Controller/WikiTagController.php
Resources/public/css/wikiTag.css
Resources/public/js/wikiTag.js
Resources/views/WikiTag/TagListTable.html.twig
Resources/views/WikiTag/documentTags.html.twig
Resources/views/WikiTag/tagTable.html.twig
--- a/Controller/WikiTagController.php	Thu Dec 01 12:11:10 2011 +0100
+++ b/Controller/WikiTagController.php	Fri Dec 02 11:31:51 2011 +0100
@@ -686,6 +686,7 @@
                 $qb->addOrderBy('t.normalizedLabel','ASC');
                 $qb->addOrderBy('t.label','ASC');
                 $reverse_sort = "labd";
+                break;
             case "nbd":
                 $qb->addOrderBy('nb_docs','DESC');
                 $qb->addOrderBy('t.popularity','DESC');
--- a/Resources/public/css/wikiTag.css	Thu Dec 01 12:11:10 2011 +0100
+++ b/Resources/public/css/wikiTag.css	Fri Dec 02 11:31:51 2011 +0100
@@ -1,6 +1,6 @@
 @charset "UTF-8";
 
-.wikitag_hand_cursor, .wikitag_remove_wp_link, .wikitag_remove_tag_from_list, .wikitag_reset_wp_info {
+.wikitag_hand_cursor, .wikitag_reset_wp_info {
     cursor: pointer;
 }
 #wikitag_actions span {
@@ -13,6 +13,9 @@
 #wikitag_table td, th {
     padding: 3px;
 }
+#wikitag_table tr, #wikitag_alltags_table tr {
+    height: 25px;
+}
 .wikitag_text_centered {
     text-align: center;
 }
@@ -28,15 +31,51 @@
 tr.wikitag_oddline:hover, tr.wikitag_evenline:hover {
     background: lightblue;
 }
-.wikitag_updown_td {
-    width: 12px;
-    cursor: n-resize;
-}
 tr.wikitag_dragged_row td {
     color: yellow;
     background-color: black;
 }
 
+/* Styles for images in tables */
+.wikitag_a_icon {
+    width: 16px;
+    height: 16px;
+    display: block;
+    margin: 0 auto;
+}
+.wikitag_wp_link {
+    background-image: url('../images/arrow_right.png');
+}
+.wikitag_wp_nolink {
+    background-image: url('../images/wikipedia_search.png');
+}
+.wikitag_wp_permalink {
+    background-image: url('../images/clock_arrow.png');
+}
+.wikitag_wp_dbplink {
+    background-image: url('../images/arrow_green_right.png');
+}
+.wikitag_td_icon {
+    width: 16px;
+    height: 16px;
+    margin: 0 auto;
+    background-repeat: no-repeat;
+    background-position: center;
+}
+.wikitag_updown_td {
+    cursor: n-resize;
+    background-image: url('../images/arrow_up_down.png');
+}
+.wikitag_remove_wp_link {
+	cursor: pointer;
+    background-image: url('../images/red_cross.png');
+}
+.wikitag_remove_tag_from_list {
+    cursor: pointer;
+    background-image: url('../images/tag_remove.png');
+}
+
+
 /* styles for the 4 types of STATUS */ 
 .wikitag_null_result {
     color: #000000;
--- a/Resources/public/js/wikiTag.js	Thu Dec 01 12:11:10 2011 +0100
+++ b/Resources/public/js/wikiTag.js	Fri Dec 02 11:31:51 2011 +0100
@@ -359,35 +359,6 @@
     });
 }
 
-function wikitag_up_down(arrow)
-{
-    if ($(arrow).is(".up")) {
-        mv = "u";
-    } else {
-        mv = "d";
-    }
-    var url = tag_up_down_url;
-    var id_tag = $(arrow).attr('id');
-    // This indicates the position (from 0) of the tag in the list. NB : it is different from the TagSheet.order in the database.
-    var pos_tag = $(arrow).attr('pos');
-    $.ajax({
-        url: url,
-        type: 'POST',
-        data: {csrfmiddlewaretoken:global_csrf_token, 
-               wikitag_document_id:$('#wikitag_document_id').val(),
-               wikitag_document_profile:$('#wikitag_document_profile').val(),
-               tag_id:id_tag,
-               move:mv,
-               tag_pos:pos_tag
-               },
-        // bug with jquery >= 1.5, "json" adds a callback so we don't specify dataType
-        //dataType: 'json',
-        success: function(msg, textStatus, XMLHttpRequest) {
-            $('#wikitag_table_container').html(msg);
-            wikitag_init_tags_events();
-        }
-    });
-}
 
 function add_tag(tag_label)
 {
--- a/Resources/views/WikiTag/TagListTable.html.twig	Thu Dec 01 12:11:10 2011 +0100
+++ b/Resources/views/WikiTag/TagListTable.html.twig	Fri Dec 02 11:31:51 2011 +0100
@@ -3,18 +3,10 @@
     <tr><th>id</th>
         <th>
         {% if sort != "laba" and sort != "labd" %}
-            {% if searched and searched != "" %}
-                <a href="?searched={{searched}}&num_page=1&nb_by_page={{nb_by_page}}&sort=laba">label</a>
-            {% else %}
-                <a href="?num_page=1&nb_by_page={{nb_by_page}}&sort=laba">label</a>
-            {% endif %}
+            <a href="?num_page=1&nb_by_page={{nb_by_page}}&sort=laba{% if searched and searched != "" %}&searched={{searched}}{% endif %}">label</a>
         {% else %}
             label &nbsp;
-            {% if searched and searched != "" %}
-                <a href="?searched={{searched}}&num_page=1&nb_by_page={{nb_by_page}}&sort={{reverse_sort}}">
-            {% else %}
-                <a href="?num_page=1&nb_by_page={{nb_by_page}}&sort={{reverse_sort}}">
-            {% endif %}
+            <a href="?num_page=1&nb_by_page={{nb_by_page}}&sort={{reverse_sort}}{% if searched and searched != "" %}&searched={{searched}}{% endif %}">
             {% if sort == "laba" %}
                 <img src="{{ asset('bundles/wikitag/images/sort-asc.png') }}"/>
             {% else %}
@@ -31,18 +23,10 @@
         <th>Alias</th>
         <th>
         {% if sort != "nba" and sort != "nbd" %}
-            {% if searched and searched != "" %}
-                <a href="?searched={{searched}}&num_page=1&nb_by_page={{nb_by_page}}&sort=nbd">Nb de<br/>fiches</a>
-            {% else %}
-                <a href="?num_page=1&nb_by_page={{nb_by_page}}&sort=nbd">Nb de<br/>fiches</a>
-            {% endif %}
+            <a href="?num_page=1&nb_by_page={{nb_by_page}}&sort=nbd{% if searched and searched != "" %}&searched={{searched}}{% endif %}">Nb de<br/>fiches</a>
         {% else %}
             Nb de<br/>fiches
-            {% if searched and searched != "" %}
-                <a href="?searched={{searched}}&num_page=1&nb_by_page={{nb_by_page}}&sort={{reverse_sort}}">
-            {% else %}
-                <a href="?num_page=1&nb_by_page={{nb_by_page}}&sort={{reverse_sort}}">
-            {% endif %}
+            <a href="?num_page=1&nb_by_page={{nb_by_page}}&sort={{reverse_sort}}{% if searched and searched != "" %}&searched={{searched}}{% endif %}">
             {% if sort == "nba" %}
                 <img src="{{ asset('bundles/wikitag/images/sort-desc.png') }}"/>
             {% else %}
@@ -53,18 +37,10 @@
         </th>
         <th>
         {% if sort != "popa" and sort != "popd" %}
-            {% if searched and searched != "" %}
-                <a href="?searched={{searched}}&num_page=1&nb_by_page={{nb_by_page}}&sort=popd">Popularité</a>
-            {% else %}
-                <a href="?num_page=1&nb_by_page={{nb_by_page}}&sort=popd">Popularité</a>
-            {% endif %}
+            <a href="?num_page=1&nb_by_page={{nb_by_page}}&sort=popd{% if searched and searched != "" %}&searched={{searched}}{% endif %}">Popularité</a>
         {% else %}
             Popularité &nbsp;
-            {% if searched and searched != "" %}
-                <a href="?searched={{searched}}&num_page=1&nb_by_page={{nb_by_page}}&sort={{reverse_sort}}">
-            {% else %}
-                <a href="?num_page=1&nb_by_page={{nb_by_page}}&sort={{reverse_sort}}">
-            {% endif %}
+            <a href="?num_page=1&nb_by_page={{nb_by_page}}&sort={{reverse_sort}}{% if searched and searched != "" %}&searched={{searched}}{% endif %}">
             {% if sort == "popa" %}
                 <img src="{{ asset('bundles/wikitag/images/sort-desc.png') }}"/>
             {% else %}
@@ -80,21 +56,21 @@
         <td class="wikitag_{{tag.urlstatustext}} wikipediatag" id="{{tag.id}}" >{{tag.label}}</td>
         <td>{{tag.originallabel}}</td>
         <td class="wikitag_text_centered">
-            {% if tag.wikipediaurl and tag.wikipediaurl != ""  %}
-            <a href="{{tag.wikipediaurl}}" target="_blank"><img src="{{ asset('bundles/wikitag/images/arrow_right.png') }}" ></a>
-            {% else %}
-            <a href="http://fr.wikipedia.org/w/index.php?search={{tag.label}}" target="_blank"><img src="{{ asset('bundles/wikitag/images/wikipedia_search.png') }}" ></a>
-            {% endif %}
+          {% if tag.wikipediaurl and tag.wikipediaurl != ""  %}
+            <a class="wikitag_a_icon wikitag_wp_link" href="{{tag.wikipediaurl}}" target="_blank" />
+          {% else %}
+            <a class="wikitag_a_icon wikitag_wp_nolink" href="http://fr.wikipedia.org/w/index.php?search={{tag.label}}" target="_blank" />
+          {% endif %}
         </td>
         <td class="wikitag_text_centered">
             {% if tag.dbpediauri and tag.dbpediauri != ""  %}
-            <a href="{{tag.dbpediauri}}" target="_blank"><img src="{{ asset('bundles/wikitag/images/arrow_green_right.png') }}" ></a>
+            <a class="wikitag_a_icon wikitag_wp_dbplink" href="{{tag.dbpediauri}}" target="_blank" />
             {% else %}
             &nbsp;
             {% endif %}
         </td>
         <td class="wikitag_category" id="{{tag.id}}">{% if tag.category %}{{ tag.category.label }}{% endif %}</td>
-        <td class="wikitag_text_centered"><img src="{{ asset('bundles/wikitag/images/red_cross.png') }}" class="wikitag_remove_wp_link" id="{{tag.id}}" alt="{{tag.label}}" /></td>
+        <td class="wikitag_text_centered wikitag_td_icon wikitag_remove_wp_link" id="{{tag.id}}" alt="{{tag.label}}" ></td>
         <td class="wikitag_alias" id="{{tag.id}}" >{% if tag.alias %}{{tag.alias}}{% endif %}</td>
         <td class="wikitag_text_centered">
         {% if nb_docs > 0 %}
--- a/Resources/views/WikiTag/documentTags.html.twig	Thu Dec 01 12:11:10 2011 +0100
+++ b/Resources/views/WikiTag/documentTags.html.twig	Fri Dec 02 11:31:51 2011 +0100
@@ -2,7 +2,7 @@
 {% block document_tags %}
 <div id="tags_commands" style="float:left;width: 100%" >
     <div style="float:right;" id="wikitag_actions">
-     {% if columns is null or "wikipedia_link" in columns %}
+     {% if columns is null or "sort_tag" in columns %}
       <span>Trier les tags : <input type="image" src="{{ asset('bundles/wikitag/images/sort-descending.png') }}" name="trier" id="wikitag_tags_sort" /></span>
      {% endif %}
       <span>Ajouter un tag : <input type="text" name="wikitag_wp_search" id="wikitag_wp_search" size="35" /> <span id="wikitag_ok_search" class="wikitag_hand_cursor"><b>OK</b></span></span>
--- a/Resources/views/WikiTag/tagTable.html.twig	Thu Dec 01 12:11:10 2011 +0100
+++ b/Resources/views/WikiTag/tagTable.html.twig	Fri Dec 02 11:31:51 2011 +0100
@@ -40,7 +40,7 @@
         <td>{{loop.index}}</td>
       {% endif %}
       {% if columns is null or "move_up_down" in columns %}
-        <td class="wikitag_updown_td wikitag_text_centered"><img src="{{ asset('bundles/wikitag/images/arrow_up_down.png') }}" class="updown" alt="updown" id={{t.tag.id}} pos="{{loop.index0}}"></td>
+        <td class="wikitag_updown_td wikitag_td_icon wikitag_text_centered"></td>
       {% endif %}
       {% if columns is null or "id" in columns %}
         <td>{{t.tag.id}}</td>
@@ -50,17 +50,17 @@
       {% endif %}
       {% if columns is null or "wikipedia_link" in columns %}
         <td class="wikitag_text_centered">
-            {% if t.tag.wikipediaurl and t.tag.wikipediaurl != ""  %}
-            <a href="{{t.tag.wikipediaurl}}" target="_blank"><img src="{{ asset('bundles/wikitag/images/arrow_right.png') }}" ></a>
-            {% else %}
-            <a href="http://fr.wikipedia.org/w/index.php?search={{t.tag.label}}" target="_blank"><img src="{{ asset('bundles/wikitag/images/wikipedia_search.png') }}" ></a>
-            {% endif %}
+        {% if t.tag.wikipediaurl and t.tag.wikipediaurl != ""  %}
+          <a class="wikitag_a_icon wikitag_wp_link" href="{{t.tag.wikipediaurl}}" target="_blank" />
+        {% else %}
+          <a class="wikitag_a_icon wikitag_wp_nolink" href="http://fr.wikipedia.org/w/index.php?search={{t.tag.label}}" target="_blank"></a>
+        {% endif %}
         </td>
       {% endif %}
       {% if columns is null or "wikipedia_permalink" in columns %}
         <td class="wikitag_text_centered">
             {% if t.wikipediarevisionid  %}
-            <a href="{{t.wikipediaversionpermalink}}" target="_blank"><img src="{{ asset('bundles/wikitag/images/clock_arrow.png') }}" ></a>
+            <a class="wikitag_a_icon wikitag_wp_permalink" href="{{t.wikipediaversionpermalink}}" target="_blank"></a>
             {% else %}
             &nbsp;
             {% endif %}
@@ -69,7 +69,7 @@
       {% if columns is null or "dbpedia_link" in columns %}
         <td class="wikitag_text_centered">
             {% if t.tag.dbpediauri and t.tag.dbpediauri != ""  %}
-            <a href="{{t.tag.dbpediauri}}" target="_blank"><img src="{{ asset('bundles/wikitag/images/arrow_green_right.png') }}" ></a>
+            <a class="wikitag_a_icon wikitag_wp_dbplink" href="{{t.tag.dbpediauri}}" target="_blank"></a>
             {% else %}
             &nbsp;
             {% endif %}
@@ -79,13 +79,14 @@
         <td class="wikitag_category" id="{{t.tag.id}}">{% if t.tag.category %}{{ t.tag.category.label }}{% endif %}</td>
       {% endif %}
       {% if columns is null or "remove_wikipedia_link" in columns %}
-        <td class="wikitag_text_centered"><img src="{{ asset('bundles/wikitag/images/red_cross.png') }}" class="wikitag_remove_wp_link" id="{{t.tag.id}}" alt="{{t.tag.label}}" /></td>
+        <td class="wikitag_text_centered wikitag_td_icon wikitag_remove_wp_link" id="{{t.tag.id}}" alt="{{t.tag.label}}" ></td>
       {% endif %}
       {% if columns is null or "alias" in columns %}
         <td>{% if t.tag.alias %}{{t.tag.alias}}{% endif %}</td>
       {% endif %}
       {% if columns is null or "remove_tag_from_list" in columns %}
-        <td class="wikitag_text_centered"><img src="{{ asset('bundles/wikitag/images/tag_remove.png') }}" class="wikitag_remove_tag_from_list" id="{{t.tag.id}}" alt="{{t.tag.label}}" /></td></tr>
+        <!--td class="wikitag_text_centered"><img src="{{ asset('bundles/wikitag/images/tag_remove.png') }}" class="wikitag_remove_tag_from_list" id="{{t.tag.id}}" alt="{{t.tag.label}}" /></td-->
+        <td class="wikitag_text_centered wikitag_td_icon wikitag_remove_tag_from_list" id="{{t.tag.id}}" alt="{{t.tag.label}}" ></td></tr>
       {% endif %}
     {% endfor %}
   </table>