[cpif] r307 - in trunk/frontend-web: . skins/default

svn at argo.es svn at argo.es
Mon Jul 30 18:44:28 CEST 2007


Author: alvaro
Date: Mon Jul 30 18:44:27 2007
New Revision: 307

Log:
Monitorizamos los hilos...


Modified:
   trunk/frontend-web/skins.py
   trunk/frontend-web/skins/default/body_show_thread.html
   trunk/frontend-web/skins/default/body_show_thread_mon.html
   trunk/frontend-web/skins/default/body_show_thread_unmon.html
   trunk/frontend-web/skins/default/body_threadlist_thread.html
   trunk/frontend-web/skins/default/body_threadlist_thread_unread.html
   trunk/frontend-web/skins/default/js.js

Modified: trunk/frontend-web/skins.py
==============================================================================
--- trunk/frontend-web/skins.py	(original)
+++ trunk/frontend-web/skins.py	Mon Jul 30 18:44:27 2007
@@ -179,7 +179,8 @@
     if first_post + thread_len * 2 <= num_msgs:
       aux.append(available_skins[self._skin]['thread_last'] % {'link': '/hilo/%d/%d' % (thread_num, 1 + (num_msgs/thread_len) * thread_len)})
     self._dict["nav"]="".join(aux)
-    self._dict["mon"] = available_skins[self._skin]['thread_unmon'] if self._dict["monitor"] else available_skins[self._skin]['thread_mon']
+    aux = available_skins[self._skin]['thread_unmon'] if self._dict["monitor"] else available_skins[self._skin]['thread_mon']
+    self._dict["mon"] = aux % self._dict
 
   
   def list_metatags(self):
@@ -212,14 +213,16 @@
               "t_date": hourdate(ts,self._tz),
               "format": format,
               "not_read":nr_point,
-              "t_replies":n_msgs
+              "t_replies":n_msgs,
+              "mon": available_skins[self._skin]['thread_unmon'] if self._dict["monitor"] else available_skins[self._skin]['thread_mon'] % { "thread_num": thread }
               }
         else:
           aux = available_skins[self._skin]['thread'] % {"title":title,
               "link": "/hilo/%d" %thread,
               "t_date":hourdate(ts,self._tz),
               "format": format,
-              "t_replies":n_msgs
+              "t_replies":n_msgs,
+              "mon": available_skins[self._skin]['thread_unmon'] if self._dict["monitor"] else available_skins[self._skin]['thread_mon'] % { "thread_num": thread }
               }
         self.set_text(aux)
 

Modified: trunk/frontend-web/skins/default/body_show_thread.html
==============================================================================
--- trunk/frontend-web/skins/default/body_show_thread.html	(original)
+++ trunk/frontend-web/skins/default/body_show_thread.html	Mon Jul 30 18:44:27 2007
@@ -2,7 +2,6 @@
     <h4>Subforo: %(metatag_title)s</h4>
     <h2>T&iacute;tulo: %(thread_title)s</h2>
     <h3>Iniciado por %(thread_author)s</h3>
-    %(mon)s
     <ul class="nav">
       %(nav)s
     </ul>
@@ -13,7 +12,8 @@
       %(nav)s
     </ul>
     <div>
-      <a href="javascript:responder('hilos');">Escribir respuesta</a>
+      <p class="right">%(mon)s</a></p>
+      <p><a href="javascript:responder('hilos');">Escribir respuesta</a></p>
     </div>
     <div id="form">
       <form id="fNewpost" action="%(link_form_new_post)s" method="post" enctype="multipart/form-data">

Modified: trunk/frontend-web/skins/default/body_show_thread_mon.html
==============================================================================
--- trunk/frontend-web/skins/default/body_show_thread_mon.html	(original)
+++ trunk/frontend-web/skins/default/body_show_thread_mon.html	Mon Jul 30 18:44:27 2007
@@ -1 +1 @@
-<p class="right"><a href="#">Monitorizar</a></p>
+<a href="javascript:toggle_thread_mon(%(thread_num)s);" id="linkmon">Monitorizar</a>

Modified: trunk/frontend-web/skins/default/body_show_thread_unmon.html
==============================================================================
--- trunk/frontend-web/skins/default/body_show_thread_unmon.html	(original)
+++ trunk/frontend-web/skins/default/body_show_thread_unmon.html	Mon Jul 30 18:44:27 2007
@@ -1 +1 @@
-<p class="right"><a href="#">Dejar de monitorizar</a></p>
+<a href="javascript:toggle_thread_mon(%(thread_num)s);" id="linkmon">Dejar de monitorizar</a>

Modified: trunk/frontend-web/skins/default/body_threadlist_thread.html
==============================================================================
--- trunk/frontend-web/skins/default/body_threadlist_thread.html	(original)
+++ trunk/frontend-web/skins/default/body_threadlist_thread.html	Mon Jul 30 18:44:27 2007
@@ -1,3 +1,3 @@
 <div class="alt %(format)s">
-  <a href="%(link)s">%(title)s</a> (%(t_date)s) - Respuestas: %(t_replies)s
+  <a href="%(link)s">%(title)s</a> (%(t_date)s) - Respuestas: %(t_replies)s - %(mon)s
 </div>

Modified: trunk/frontend-web/skins/default/body_threadlist_thread_unread.html
==============================================================================
--- trunk/frontend-web/skins/default/body_threadlist_thread_unread.html	(original)
+++ trunk/frontend-web/skins/default/body_threadlist_thread_unread.html	Mon Jul 30 18:44:27 2007
@@ -1,3 +1,3 @@
 <div class="alt %(format)s">
-  <a href="%(link)s">%(title)s</a> (%(t_date)s) - <a href="%(link_notread)s">No le&iacute;do</a>  - Respuestas: %(t_replies)s
+  <a href="%(link)s">%(title)s</a> (%(t_date)s) - <a href="%(link_notread)s">No le&iacute;do</a>  - Respuestas: %(t_replies)s - %(mon)s
 </div>

Modified: trunk/frontend-web/skins/default/js.js
==============================================================================
--- trunk/frontend-web/skins/default/js.js	(original)
+++ trunk/frontend-web/skins/default/js.js	Mon Jul 30 18:44:27 2007
@@ -24,6 +24,25 @@
   }
 }
 
+function toggle_thread_mon(id) {
+  var req = false;
+  try {
+    req = new XMLHttpRequest();
+  }
+  catch(e) {
+    req = false;
+  }
+  if(req) {
+    req.open("GET","/toggle_monitor_AJAX/thread/"+id,false);
+    req.send("");
+    var xml = req.responseXML;
+    var txt = xml.getElementsByTagName("msg")[0].textContent;
+    var link = document.getElementById("linkmon");
+    link.innerHTML = txt;
+  }
+
+}
+
 var used_ids = new Array();
 
 function responder(id) {



More information about the cpif mailing list