Ticket #178 (closed enhancement: fixed)

Opened 2 years ago

Last modified 2 months ago

random word widget

Reported by: cata Owned by: cata
Priority: high Component: Backend
Version: Severity: minor
Keywords: newbie Cc:
Estimated Number of Hours: 5.0 Add Hours to Ticket: 0
Billable?: yes Total Hours:

Description (last modified by cata) (diff)

We need a random word widget

Attachments

patch_razvanb Download (5.7 KB) - added by profiles.google.com/110327245888974165324 15 months ago.
razvanb_patch Download (5.5 KB) - added by profiles.google.com/110327245888974165324 15 months ago.

Change History

comment:1 Changed 21 months ago by cata

  • Priority changed from normal to high
  • Severity changed from normal to minor
  • Add Hours to Ticket set to 0
  • Billable? set
  • Estimated Number of Hours set to 10.0
  • Type changed from defect to enhancement

This still sounds like a fun addition. I'll bump this up so that it's visible to potential volunteer programmers.

comment:2 Changed 21 months ago by cata

  • Keywords newbie added

Changed 15 months ago by profiles.google.com/110327245888974165324

comment:3 Changed 15 months ago by profiles.google.com/110327245888974165324

Implemented Random Word functionality.

comment:4 Changed 15 months ago by cata

  • Status changed from new to accepted

Interesting! Thanks Răzvan, I'll look over it on Monday.

comment:5 Changed 15 months ago by profiles.google.com/110327245888974165324

Although there's a minor bug with the current patch (sometimes no definitions are found, the reason for this is not yet known by me), I have a solution for it and will re-attach another diff file before Monday.

comment:6 Changed 15 months ago by profiles.google.com/110327245888974165324

Sorry for the inconvenience, I have fixed the minor bug. I'll attach the new patch.

Changed 15 months ago by profiles.google.com/110327245888974165324

comment:7 Changed 15 months ago by cata

Răspund în română, parcă e cam aiurea să vorbim în engleză. :-)

În general arată mișto. Am câteva observații mărunte, dar am și una cam de esență -- scuze în avans că nu mi-a dat prin cap să facem un pic de design înainte să începi codarea.

Aș prefera să văd funcția asta implementată ca o afișare de pagină, nu prin ajax. Avantajele ar fi că (1) poți reutiliza codul de afișare, căci este important să ai permalink, sursa, autorul definiției, linkurile de editare pentru administratori, posibilitatea de a face click pe cuvânt etc. Și (2) aș vrea ca o definiție în plus să fie contorizată ca atare, or dacă folosim ajax nu se generează un apel pe server și ar trebui să implementăm propria contorizare. Ok, și (3) o pagină nouă generează un banner nou, ceea ce poate fi util, mai ales dacă utilizatorul e pus pe pierdut vremea la noi pe site. :-)

Deci aș vedea implementarea ca pe un link către wwwbase/random.php, care alege un lexem și redirectează către  http://dexonline.ro/lexem/<forma>/<id>

Vizual, aș folosi un link mai degrabă decât un buton. Este mai mic și principial aș zice că e mai corect, pentru că nu se face propriu-zis un submit (toate câmpurile sunt ignorate). Nu știu încă dacă ar sta mai bine pe bara de sus sau în formular; ne mai gândim.

Fiind prin excelență un site despre limba română, ar fi mai bine să folosim ceva gen „cuvânt aleator” decât „I'm feeling lucky”. :-)

În templates/common/bits/css.ihtml și respectiv js.ihtml trebuie incrementate versiunile în dreptul fișierelor pe care le modifici (zepu.css, dex.js etc.). Facem aceasta pentru a forța browserul să reîncarce fișierele CSS/JS.

Ca stil de codare, pune te rog acolade și în jurul blocurilor cu un singur enunț (cum ar fi bucla foreach în db_getArrayAssoc(). Este redundant, dar nu riști să dai peste buguri dacă pe viitor adaugi enunțuri noi.

Probabil nu mai contează, dacă renunțăm la Ajax, dar decât <body onload="$('.random_word').hide()">, nu se poate ascunde div-ul prin CSS? Ca să nu adăugăm o dependență în plus în pagina principală.

Ce rost are bucla foreach din db_getArrayAssoc()? Pare să renumeroteze doar indicii vectorului; este nevoie de asta?

comment:8 Changed 7 months ago by cata

  • Status changed from accepted to assigned

comment:9 Changed 7 months ago by cata

  • Status changed from assigned to accepted

comment:10 Changed 7 months ago by cata

  • Status changed from accepted to assigned

Blah, stupid Trac workflow. I'd like to mark this ticket as new, but Trac offers no way to unassign a ticket.

comment:11 Changed 7 months ago by cata

  • Status changed from assigned to accepted

comment:12 Changed 3 months ago by cata

  • Estimated Number of Hours changed from 10.0 to 5.0
  • Description modified (diff)
  • Summary changed from random word to random word widget

Radu a implementat funcția de alegere a unor cuvinte aleatoare, disponibilă la  http://dexonline.ro/cuvinte-aleatoare . Ne-ar mai trebui un widget pe pagina principală: o cutie gri asemănătoare cu cea pentru cuvântul zilei. De remarcat:

  • Linkul trebuie să fie generat prin Ajax, căci pagina principală este cacheuită timp de o oră.
  • Aspectul trebuie testat sumar și pe celelalte skin-uri.

Modific corespunzător descrierea tichetului.

comment:13 Changed 2 months ago by cata

  • Status changed from accepted to testing
  • Resolution set to fixed

comment:14 Changed 2 months ago by cata

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.