Commit 53ac68d8d0f3191ff2fb6be0dbfcee45e2ffb9df

Authored by Silvan Calarco
1 parent 714aba96fd
Exists in master

distroquery: milestone3 (still hardcoded) support and searchbox fix for package query

Showing 1 changed file with 22 additions and 5 deletions Side-by-side Diff

... ... @@ -81,7 +81,7 @@
81 81 static struct configTag *firstconfigtag = NULL;
82 82 char *query = "";
83 83 char *query_package;
84   -char *query_repository = "milestone2";
  84 +char *query_repository = "devel";
85 85 char *query_arch = NULL;
86 86 int query_compact = 0;
87 87 int query_limit = 10;
... ... @@ -95,7 +95,7 @@
95 95  
96 96 struct configTag *query_repositories[100];
97 97  
98   -int search_milestone1 = 0, search_milestone2 = 1, search_devel = 1;
  98 +int search_milestone1 = 0, search_milestone2 = 0, search_milestone3 = 1, search_devel = 1;
99 99 int search_sources = 0, searchbox = 0;
100 100 int search_files = 0;
101 101  
... ... @@ -318,6 +318,7 @@
318 318 // "'repository='+getElementById('repository').value"
319 319 "'query='+getElementById('query').value+"
320 320 "'&search_devel='+getElementById('search_devel').checked+"
  321 + "'&search_milestone3='+getElementById('search_milestone3').checked+"
321 322 "'&search_milestone2='+getElementById('search_milestone2').checked+"
322 323 "'&search_milestone1='+getElementById('search_milestone1').checked+"
323 324 "'&search_i586='+getElementById('search_i586').checked+"
... ... @@ -341,6 +342,10 @@
341 342 if (search_devel) printf("checked=checked ");
342 343 printf("onclick=%s>devel ", ajax_call);
343 344  
  345 + printf("<input type=checkbox id=\"search_milestone3\" ");
  346 + if (search_milestone3) printf("checked=checked ");
  347 + printf("onclick=%s>milestone3&nbsp;", ajax_call);
  348 +
344 349 printf("<input type=checkbox id=\"search_milestone2\" ");
345 350 if (search_milestone2) printf("checked=checked ");
346 351 printf("onclick=%s>milestone2&nbsp;", ajax_call);
... ... @@ -1517,6 +1522,8 @@
1517 1522 /* fields to make reusable query string for next pages */
1518 1523 if (!strcmp(vartok, "query")) {
1519 1524 query = url_decode(valuetok);
  1525 + } else if (!strcmp(vartok, "search_milestone3")) {
  1526 + search_milestone3 = strstr(valuetok, "false") != valuetok;
1520 1527 } else if (!strcmp(vartok, "search_milestone2")) {
1521 1528 search_milestone2 = strstr(valuetok, "false") != valuetok;
1522 1529 } else if (!strcmp(vartok, "search_milestone1")) {
1523 1530  
1524 1531  
1525 1532  
1526 1533  
1527 1534  
1528 1535  
... ... @@ -1548,23 +1555,33 @@
1548 1555 if (query_package) {
1549 1556 if (strstr(query_repository, "devel") == query_repository) {
1550 1557 search_devel = 1;
  1558 + search_milestone3 = 0;
1551 1559 search_milestone2 = 0;
1552 1560 search_milestone1 = 0;
1553   - searchbox = 1;
  1561 + } else if (strstr(query_repository, "milestone3") == query_repository) {
  1562 + search_devel = 0;
  1563 + search_milestone3 = 1;
  1564 + search_milestone2 = 0;
  1565 + search_milestone1 = 0;
1554 1566 } else if (strstr(query_repository, "milestone2") == query_repository) {
1555 1567 search_devel = 0;
  1568 + search_milestone3 = 0;
1556 1569 search_milestone2 = 1;
1557 1570 search_milestone1 = 0;
1558   - searchbox = 1;
1559 1571 } else if (strstr(query_repository, "milestone1") == query_repository) {
1560 1572 search_devel = 0;
  1573 + search_milestone3 = 0;
1561 1574 search_milestone2 = 0;
1562 1575 search_milestone1 = 1;
1563   - searchbox = 1;
1564 1576 }
1565 1577 }
1566 1578 while (ct) {
1567 1579 if ((strstr(ct->tag, "devel") == ct->tag) && search_devel) query_repositories[i++] = ct;
  1580 + ct = ct->next;
  1581 + }
  1582 + ct = firstconfigtag;
  1583 + while (ct) {
  1584 + if ((strstr(ct->tag, "milestone3") == ct->tag) && search_milestone3) query_repositories[i++] = ct;
1568 1585 ct = ct->next;
1569 1586 }
1570 1587 ct = firstconfigtag;