From bf75b918666473b488bc84bf278024321114be4d Mon Sep 17 00:00:00 2001 From: Charles Nepote Date: Sun, 22 Sep 2024 21:01:35 +0200 Subject: [PATCH] Small fixes + improvements --- html/js/folksonomy.js | 60 +++++++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/html/js/folksonomy.js b/html/js/folksonomy.js index 851466bcd4d8c..7ca77b1f5805f 100644 --- a/html/js/folksonomy.js +++ b/html/js/folksonomy.js @@ -149,9 +149,10 @@ function folskonomy_engine_init() { function displayFolksonomyPropertyValues() { //$(".details").before( $("div#main-product").append( - String('' + + String('' + + '
' + '
' + - '
' + + '
' + '

Personalized properties (beta)

' + '

' + "

These properties are created and filed by users for any kind of usages. Feel free to add your own. " + @@ -165,7 +166,7 @@ function displayFolksonomyPropertyValues() { '' + '' + '' + - '' + + '' + '' + '' + '') + @@ -173,6 +174,7 @@ function displayFolksonomyPropertyValues() { '' + '' + '' + + '' + '' + '' + + '' + '' + '' + '' + @@ -358,12 +362,12 @@ function displayProductsWithProperty(_property, _value) { */ //$("#main_column p").remove(); // remove

Invalid address.

$("#main_column").append('' + - '

Property: '+ _property + (_value ? ": "+ _value : '') + '

' + - '

You should find a dedicated documentation' + - ' about this property on Open Food Facts wiki

' + - '

List of products using this property:

' + - '
Tip: you can also find the list of all properties.
' + - '
    '); + '

    Folksonomy property: '+ _property + (_value ? ": "+ _value : '') + '

    ' + + '

    You should find a dedicated documentation' + + ' about this property on Open Food Facts wiki

    ' + + '

    List of products using this property:

    ' + + '
    Tip: you can also find the list of all properties.
    ' + + '
      '); //$("#main_column h1").remove(); // remove

      Error

      console.log("FEUS - displayProductsWithProperty(_property) - GET " + feAPI + "/products?k=" + _property + (_value ? "&v="+ _value : '')); @@ -376,8 +380,8 @@ function displayProductsWithProperty(_property, _value) { content += '
      Property 🔗Property 🛈Value
      ' + '' + 'Example: color' + @@ -188,6 +190,7 @@ function displayFolksonomyPropertyValues() { '' + '' + '' + + '' + ''); @@ -324,10 +327,11 @@ function displayFolksonomyPropertyValues() { while (index--) { content += ('
      🛈' + d[index].k + '' + d[index].v + ''+ - ' '+ + ' '+ 'Edit '+ 'Delete'+ '
      ' + '' + - '' + - '' + + '' + + '' + '' + ''; while (index--) { @@ -407,20 +411,26 @@ function displayAllProperties() { */ // TODO: add owner filter? //$("#main_column p").remove(); // remove

      Invalid address.

      + + // Display empty table $("#main_column").append(String('

      Properties

      ' + - '

      List of all properties.

      ' + - '
      CodeValuesProduct barcodeCorresponding value
      ' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '') + - '' + - '
      PropertyCountValuesDocumentation
      '); + "

      Open Food Facts allows anyone to reuse contributed properties or create new ones " + + "(see the Folksonomy Engine project). " + + "Here's the list of all contributed properties.

      " + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '') + + '' + + '
      PropertyDocumentationCountValues
      '); //$("#main_column h1").remove(); // remove

      Error

      + + // Populate table console.log("FEUS - displayAllProperties(_owner) - GET " + feAPI + "/keys"); $.getJSON(feAPI + "/keys", function(data) { console.log("FEUS - displayAllProperties() - " + JSON.stringify(data)); @@ -432,9 +442,9 @@ function displayAllProperties() { content += ('' + ' ' + '' + d[index].k + '' + + '🛈' + '' + d[index].count + '' + '' + d[index].values + '' + - '🔗' + ''); } $("#properties_list").append(content);