team4alfanous team mailing list archive
-
team4alfanous team
-
Mailing list archive
-
Message #00054
[Branch ~team4alfanous/alfanous/alfanous-git] Rev 242: show different vocalizations of each word in the web interface
------------------------------------------------------------
revno: 242
git commit: 698a9411edc6e071074861932b5d69de5f66cc80
committer: Assem Chelli <assem.ch@xxxxxxxxx>
timestamp: Fri 2012-06-08 12:24:33 +0100
message:
show different vocalizations of each word in the web interface
modified:
interfaces/web/wui/css/screen.css
interfaces/web/wui/index.html
src/alfanous-cgi/alfanous_json.py
--
lp:~team4alfanous/alfanous/alfanous-git
https://code.launchpad.net/~team4alfanous/alfanous/alfanous-git
Your team Alfanous team is subscribed to branch lp:~team4alfanous/alfanous/alfanous-git.
To unsubscribe from this branch go to https://code.launchpad.net/~team4alfanous/alfanous/alfanous-git/+edit-subscription
=== modified file 'interfaces/web/wui/css/screen.css'
--- interfaces/web/wui/css/screen.css 2012-06-08 09:44:16 +0000
+++ interfaces/web/wui/css/screen.css 2012-06-08 11:24:33 +0000
@@ -373,10 +373,21 @@
}
.word_stat1 {
+ background-color: #555;
+ color: #FFF;
+}
+
+.word_vocalization_nb {
background-color: #90A;
color: #FFF;
}
+.word_vocalization {
+ background-color: #FFF;
+ color: #90A;
+ font-family: KacstBook, KacstQurn, ArabeyesQr, "KFGQPC Uthman Taha Naskh", Scheherazade, Arial;
+ font-size:125%;
+}
.item_number {
background-color: #FFF;
@@ -496,17 +507,15 @@
}
.clickable {
-
- color: #FFF;
font-weight: bold;
border-style:solid;
- border-color:#00F;
- border-width:1px;
+ border-color:#A0C;
+ border-width:2px;
}
.filter {
- border-color:#F00;
+ border-color:#000;
}
=== modified file 'interfaces/web/wui/index.html'
--- interfaces/web/wui/index.html 2012-06-08 09:44:16 +0000
+++ interfaces/web/wui/index.html 2012-06-08 11:24:33 +0000
@@ -191,6 +191,12 @@
results += build_search_link(param, json.words[i].word, false) + "<div class='details_label word_info0 clickable'> كلمة | "+ json.words[i].word+ "</div></a>";
results += "<div class='details_label word_stat0'> المرات | "+ json.words[i].nb_matches+ "</div>";
results += "<div class='details_label word_stat1'> الآيات | "+ json.words[i].nb_ayas+ "</div>";
+ results += "<div class='details_label word_vocalization_nb'> التشكيلات | "+ json.words[i].nb_vocalizations+ "</div>";
+ for( j = 0; j < json.words[i].nb_vocalizations; j++)
+ {
+ results += build_search_link(param, "آية_:"+ json.words[i].vocalizations[j] + "", false ) + "<div class='details_label word_vocalization clickable'>"+ json.words[i].vocalizations[j]+ "</div></a>";
+ }
+
results += "</div></p>";
}
results += "</div> ";
@@ -246,7 +252,7 @@
results += build_search_link(param,"ج_آ:" + json.ayas[i].stat.godnames, false) + "<div class='details_label aya_stat2 clickable'> ألفاظ الجلالة | "+ json.ayas[i].stat.godnames+ "</div></a> ";
results += build_search_link(param, "منزل:" + json.ayas[i].position.manzil, true) + "<div class='details_label aya_pos0 clickable filter'> المنزل | "+ json.ayas[i].position.manzil+ "</div></a>";
results += build_search_link(param, "حزب:" + json.ayas[i].position.hizb, true) +"<div class='details_label aya_pos1 clickable filter'> الحزب | "+ json.ayas[i].position.hizb+ "</div></a>";
- results += "<div class='details_label aya_pos2'> الربع | "+ json.ayas[i].position.rubu+ "</div>";
+ results += "<div class='details_label aya_pos2'> الربع | "+ (json.ayas[i].position.rubu + 1 )+ "</div>";
results += build_search_link(param, "صفحة:" + json.ayas[i].position.page, true) + "<div class='details_label aya_pos3 clickable filter'> الصفحة | "+ json.ayas[i].position.page+ "</div></a>";
=== modified file 'src/alfanous-cgi/alfanous_json.py'
--- src/alfanous-cgi/alfanous_json.py 2012-06-08 02:26:25 +0000
+++ src/alfanous-cgi/alfanous_json.py 2012-06-08 11:24:33 +0000
@@ -52,7 +52,7 @@
from alfanous.main import *
from alfanous.dynamic_ressources.arabicnames_dyn import ara2eng_names as Fields
-
+from vocalizations_dyn import vocalization_dict
import gettext;
@@ -148,7 +148,8 @@
if term[2]:
matches+=term[2]
docs+=term[3]
- words_output[str(cpt)]={"word":term[1],"nb_matches":term[2],"nb_ayas":term[3]}
+ vocalizations = vocalization_dict[term[1]]
+ words_output[str( cpt )] = {"word":term[1], "nb_matches":term[2], "nb_ayas":term[3], "nb_vocalizations":len( vocalizations ), "vocalizations": vocalizations }
cpt+=1
words_output["global"]={"nb_words":cpt-1,"nb_matches":matches}
@@ -206,7 +207,7 @@
{
"manzil":r["manzil"],
"hizb":r["hizb"],
- "rubu":r["rub"]%4,
+ "rubu": r["rub"] % 4,
"page":r["page"]
},