Commit 2f40244640d1732f97571f9a7112fda94de0a4e2
1 parent
befe1ee4
Exists in
sisp_simple_version
Add sisp catalog
Signed-off-by: Marcos Ronaldo <marcos.rpj2@gmail.com> Signed-off-by: Gustavo Coelho <gust.rod.coelho@gmail.com> Signed-off-by: Luciano Prestes <lucianopcbr@gmail.com>
Showing
8 changed files
with
582 additions
and
10 deletions
Show diff stats
src/noosfero-spb/noosfero-spb-theme/css/software-catalog-page.css
| ... | ... | @@ -455,3 +455,463 @@ |
| 455 | 455 | } |
| 456 | 456 | |
| 457 | 457 | |
| 458 | +.action-search-sisp #content { | |
| 459 | + margin-top: 10px; | |
| 460 | + padding: 0px; | |
| 461 | +} | |
| 462 | + | |
| 463 | +.action-search-sisp .main-content { | |
| 464 | + border: none; | |
| 465 | + box-shadow: none; | |
| 466 | +} | |
| 467 | + | |
| 468 | +.action-search-sisp #content .main-content h2{ | |
| 469 | + color: #FF0366; | |
| 470 | + font-size: 16px; | |
| 471 | + font-family: "open_sansregular",Arial, Helvetica,sans-serif; | |
| 472 | + font-weight: 300; | |
| 473 | + text-transform: uppercase; | |
| 474 | +} | |
| 475 | + | |
| 476 | +.action-search-sisp #content .main-content h1{ | |
| 477 | + padding: 5px 0 10px 0; | |
| 478 | + border-bottom: 1px solid #D3D6DE; | |
| 479 | + font-family: Arial, Helvetica, sans-serif; | |
| 480 | + font-size: 35px; | |
| 481 | + font-variant: normal; | |
| 482 | +} | |
| 483 | + | |
| 484 | +/*** end of title and subtitle ***/ | |
| 485 | + | |
| 486 | +/*** Search Box ***/ | |
| 487 | +.action-search-sisp .search-form { | |
| 488 | + margin-top:28px; | |
| 489 | + padding: 0; | |
| 490 | + background: #ecedf1; | |
| 491 | + border-radius: 4px; | |
| 492 | + border: 1px solid #D3D6DE; | |
| 493 | + background-image:url("catalogo.png"); | |
| 494 | +} | |
| 495 | + | |
| 496 | +.action-search-sisp #software-search-container .search-form h3{ | |
| 497 | + margin: 0px 0px 3px 0px; | |
| 498 | + padding: 16px 0 20px 14px; | |
| 499 | + color: #2C4B6B; | |
| 500 | + font-family:"open_sansregular", Arial, Helvetica, sans-serif; | |
| 501 | + color: #2B51A8; | |
| 502 | + font-weight: bold; | |
| 503 | + font-size: 15px; | |
| 504 | + text-transform: uppercase; | |
| 505 | +} | |
| 506 | + | |
| 507 | +/*.action-search-sisp #content .search-form .project-software { | |
| 508 | + margin: 0 0 0 15px; | |
| 509 | +} | |
| 510 | + | |
| 511 | + It's TEMPORARY | |
| 512 | +.action-search-sisp #content .search-form .doubts-catalog-software { | |
| 513 | + display: none; | |
| 514 | +}*/ | |
| 515 | + | |
| 516 | +/**Radio Buttons***/ | |
| 517 | +.action-search-sisp .radio-buttons { | |
| 518 | + display: none; | |
| 519 | +} | |
| 520 | + | |
| 521 | +.action-search-sisp #public_software_radio_button, | |
| 522 | +.action-search-sisp #all_radio_button { | |
| 523 | + margin:5px 4px 15px 15px; | |
| 524 | + line-height: 20px; | |
| 525 | + position:absolute; | |
| 526 | +} | |
| 527 | + | |
| 528 | +.action-search-sisp .search-form label, | |
| 529 | +.action-search-sisp .search-form label{ | |
| 530 | + margin:0px 3px 4px 32px; | |
| 531 | + line-height: 22px; | |
| 532 | + font-size: 15px; | |
| 533 | + font-family: Arial; | |
| 534 | +} | |
| 535 | + | |
| 536 | +.action-search-sisp #software-search-container .search-form .doubts-catalog-software{ | |
| 537 | + padding-top: 2px; | |
| 538 | + background-color: #3867b7; | |
| 539 | + color: #ffffff; | |
| 540 | + font-weight: bold; | |
| 541 | + cursor: pointer; | |
| 542 | + height: 15px; | |
| 543 | + font-family: arial; | |
| 544 | + width: 17px; | |
| 545 | + display: inline-block; | |
| 546 | + text-align: center; | |
| 547 | + border-radius: 50%; | |
| 548 | +} | |
| 549 | + | |
| 550 | +/******/ | |
| 551 | + | |
| 552 | +.action-search-sisp #content .search-form .search-field .formfield { | |
| 553 | + width: 100%; | |
| 554 | + margin: 0; | |
| 555 | + padding: 0; | |
| 556 | +} | |
| 557 | + | |
| 558 | +.action-search-sisp #content .search-form .search-field #search-input { | |
| 559 | + width: 95%; | |
| 560 | + margin: 13px 0px 4px 13px; | |
| 561 | + padding: 7px; | |
| 562 | + background: #FFF; | |
| 563 | + border-radius: 4px; | |
| 564 | + border: 1px solid #D3D6DE; | |
| 565 | + font-size: 14px; | |
| 566 | +} | |
| 567 | + | |
| 568 | + | |
| 569 | +.action-search-sisp #content .search-form .search-field input.button{ | |
| 570 | + padding: 0px; | |
| 571 | + background-color: #3E67B1; | |
| 572 | + color: #FFF; | |
| 573 | + border: 1px solid #3E67B1; | |
| 574 | + font-family: "open_sansbold",Arial,sans-serif; | |
| 575 | + border-radius: 4px; | |
| 576 | +} | |
| 577 | + | |
| 578 | +.action-search-sisp #content .search-form .search-field input.button.submit { | |
| 579 | + width: auto; | |
| 580 | + height: 30px; | |
| 581 | + max-height: 30px; | |
| 582 | + margin: 14px; | |
| 583 | + padding: 0 14px 0 14px; | |
| 584 | + background: #3E67B1; | |
| 585 | + line-height: 14px; | |
| 586 | + border-radius: 4px; | |
| 587 | + color: #ffffff; | |
| 588 | + text-transform: uppercase; | |
| 589 | + font-family: "open_sansbold",Arial,sans-serif; | |
| 590 | + font-size: 14px; | |
| 591 | +} | |
| 592 | + | |
| 593 | +/* Filter options */ | |
| 594 | + | |
| 595 | +.action-search-sisp #filter-catalog-software { | |
| 596 | + background-color: #D3D6DE; | |
| 597 | +} | |
| 598 | + | |
| 599 | +.action-search-sisp #filter-option-catalog-software { | |
| 600 | + cursor: pointer; | |
| 601 | + padding: 14px; | |
| 602 | + background-color: #D3D6DE; | |
| 603 | + border: none; | |
| 604 | + border-bottom-left-radius: 4px; | |
| 605 | + border-bottom-right-radius: 4px; | |
| 606 | + font-size: 11px; | |
| 607 | + text-align: right; | |
| 608 | + text-transform: uppercase; | |
| 609 | +} | |
| 610 | + | |
| 611 | +.action-search-sisp #filter-option-catalog-close { | |
| 612 | + padding: 7px 7px 17px 10px; | |
| 613 | + display: none; | |
| 614 | +} | |
| 615 | +.action-search-sisp #filter-option-catalog-software:hover { | |
| 616 | + background-color: #c7c7c7; | |
| 617 | +} | |
| 618 | + | |
| 619 | +.action-search-sisp #filter-option-catalog-software:after { | |
| 620 | + content: ""; | |
| 621 | + margin-left: 5px; | |
| 622 | + padding: 3px 10.5px; | |
| 623 | + background: url("../images/bottom-arrow.png") no-repeat center; | |
| 624 | + background-color: #3E67B1; | |
| 625 | + border-radius: 4px; | |
| 626 | +} | |
| 627 | + | |
| 628 | +.action-search-sisp #filter-catalog-software #filter-categories-option { | |
| 629 | + border: none; | |
| 630 | + height: 0; | |
| 631 | + max-height: 620px; | |
| 632 | + position: relative; | |
| 633 | + overflow: hidden; | |
| 634 | + padding: 0 15px; | |
| 635 | +} | |
| 636 | + | |
| 637 | +.action-search-sisp #filter-catalog-software #filter-categories-catalog h4 { | |
| 638 | + margin: 20px 0 10px 5px; | |
| 639 | + background: transparent; | |
| 640 | + color: black; | |
| 641 | +} | |
| 642 | + | |
| 643 | +.action-search-sisp #filter-catalog-software input[type="checkbox"]{ | |
| 644 | + vertical-align: middle; | |
| 645 | + margin: 0 3px 2px 8px; | |
| 646 | +} | |
| 647 | + | |
| 648 | +.action-search-sisp #group-categories ul { | |
| 649 | + font-family: Arial; | |
| 650 | + font-size: 14px; | |
| 651 | + line-height: 31px; | |
| 652 | + columns: 2; | |
| 653 | + -webkit-columns: 2; | |
| 654 | + -moz-columns: 2; | |
| 655 | +} | |
| 656 | + | |
| 657 | +.action-search-sisp #group-categories li span { | |
| 658 | + font-family: Arial; | |
| 659 | + font-size: 14px; | |
| 660 | +} | |
| 661 | + | |
| 662 | +.action-search-sisp #filter-catalog-software .project-software{ | |
| 663 | + margin: 20px 0 30px; | |
| 664 | + border-top: 1px dotted; | |
| 665 | + border-bottom: 1px dotted; | |
| 666 | + font-weight: bold; | |
| 667 | + font-size: 15px; | |
| 668 | + font-family: Arial; | |
| 669 | + padding: 10px; | |
| 670 | +} | |
| 671 | + | |
| 672 | +.action-search-sisp #filter-catalog-software .project-software label { | |
| 673 | + font-weight: normal; | |
| 674 | +} | |
| 675 | + | |
| 676 | +.action-search-sisp #filter-catalog-software .project-software span { | |
| 677 | + padding: 2px 6px; | |
| 678 | + background: #FFF; | |
| 679 | + color: #3E67B1; | |
| 680 | + border-radius: 50%; | |
| 681 | + font-size: 16px; | |
| 682 | +} | |
| 683 | + | |
| 684 | +.action-search-sisp button#cleanup-filter-catalg { | |
| 685 | + cursor: pointer; | |
| 686 | + background-color: #3E67B1; | |
| 687 | + font-size: 14px; | |
| 688 | + font-family: Arial; | |
| 689 | + color: #ffffff; | |
| 690 | + border: 1px solid #2B65CD; | |
| 691 | + border-radius: 4px; | |
| 692 | + margin: 5px 0 0 5px; | |
| 693 | + padding: 5px 10px; | |
| 694 | +} | |
| 695 | + | |
| 696 | +.action-search-sisp button#close-filter-catalog { | |
| 697 | + cursor:pointer; | |
| 698 | + float: right; | |
| 699 | + border: none; | |
| 700 | + background: none; | |
| 701 | + font-size: 12px; | |
| 702 | + margin-top: 5px; | |
| 703 | + color: #000; | |
| 704 | + text-transform: uppercase; | |
| 705 | + padding: 5px; | |
| 706 | +} | |
| 707 | + | |
| 708 | +.action-search-sisp button#close-filter-catalog:after { | |
| 709 | + content: ""; | |
| 710 | + margin-left: 5px; | |
| 711 | + padding: 2.5px 10.5px; | |
| 712 | + background: url("../images/top-arrow.png") no-repeat center; | |
| 713 | + background-color: #3E67B1; | |
| 714 | + border-radius: 4px; | |
| 715 | +} | |
| 716 | + | |
| 717 | +/*** end of search box ***/ | |
| 718 | + | |
| 719 | +/*** Catalog Options ***/ | |
| 720 | + | |
| 721 | +.action-search-sisp #catalog-display-options { | |
| 722 | + font-size: 14px; | |
| 723 | + font-family: Arial; | |
| 724 | +} | |
| 725 | + | |
| 726 | +.action-search-sisp #catalog-display-options #catalog-display-options-count{ | |
| 727 | + padding: 45px 0 4px 0; | |
| 728 | + float: left; | |
| 729 | + width: 50%; | |
| 730 | +} | |
| 731 | + | |
| 732 | +.action-search-sisp #catalog-display-options #catalog-display-options-show-and-sort{ | |
| 733 | + padding: 38px 0 5px 0; | |
| 734 | + font-weight: bold; | |
| 735 | + float: left; | |
| 736 | + width: 50%; | |
| 737 | +} | |
| 738 | +.action-search-sisp #catalog-display-options #catalog-display-options-sort, | |
| 739 | +.action-search-sisp #catalog-display-options #catalog-display-options-show{ | |
| 740 | + position: relative; | |
| 741 | + float: left; | |
| 742 | + width: 50%; | |
| 743 | + text-align: right; | |
| 744 | +} | |
| 745 | + | |
| 746 | +/*** Search Results ***/ | |
| 747 | +.action-search-sisp #search-results { | |
| 748 | + border-top: 1px solid #d7d7d7; | |
| 749 | + margin-top: 66px; | |
| 750 | +} | |
| 751 | + | |
| 752 | +.action-search-sisp #search-results.only-one-result-box .search-software-item { | |
| 753 | + padding: 29px 0 31px 0; | |
| 754 | + background: #ffffff; | |
| 755 | + border-bottom: 1px solid #d7d7d7; | |
| 756 | +} | |
| 757 | + | |
| 758 | +.action-search-sisp #search-results #search-results-empty{ | |
| 759 | + padding: 30px 0 15px 0; | |
| 760 | + color: #172738; | |
| 761 | + font-size: 16px; | |
| 762 | + text-align: left; | |
| 763 | +} | |
| 764 | + | |
| 765 | + | |
| 766 | +.action-search-sisp #search-results .search-results-innerbox { | |
| 767 | + background: #ffffff; | |
| 768 | + border: none; | |
| 769 | +} | |
| 770 | + | |
| 771 | +/* Column left */ | |
| 772 | + | |
| 773 | +.action-search-sisp #search-results .search-software-item-column-left { | |
| 774 | + width: 140px; | |
| 775 | + height: 140px; | |
| 776 | + float: left; | |
| 777 | + border-right: 1px dotted #ccc; | |
| 778 | +} | |
| 779 | + | |
| 780 | +.action-search-sisp #search-results .search-software-item-column-left .vcard { | |
| 781 | + display: table; | |
| 782 | + margin: 0; | |
| 783 | + border: none; | |
| 784 | +} | |
| 785 | + | |
| 786 | +.action-search-sisp #search-results .search-software-item-column-left .vcard:hover { | |
| 787 | + border: none; | |
| 788 | + background: none; | |
| 789 | +} | |
| 790 | + | |
| 791 | +.action-search-sisp #search-results .search-software-item-column-left .vcard a:hover{ | |
| 792 | + color: #3E67B1; | |
| 793 | +} | |
| 794 | + | |
| 795 | +.action-search-sisp #search-results .search-software-item-column-left .vcard a.profile_link{ | |
| 796 | + float:left; | |
| 797 | +} | |
| 798 | + | |
| 799 | +.action-search-sisp #search-results .search-software-item-column-left .vcard:hover .menu-submenu-trigger { | |
| 800 | + display:none; | |
| 801 | +} | |
| 802 | + | |
| 803 | +.action-search-sisp #search-results .search-software-item-column-left .profile-image{ | |
| 804 | + width: 130px; | |
| 805 | + height: 130px; | |
| 806 | + margin-left: 130px; | |
| 807 | + margin-top: 35px; | |
| 808 | +} | |
| 809 | + | |
| 810 | +.action-search-sisp #search-results .search-software-item-column-left .vcard img { | |
| 811 | + max-width: 90px; | |
| 812 | + max-height: 130px; | |
| 813 | + height: auto; | |
| 814 | + margin-left:170px; | |
| 815 | +} | |
| 816 | + | |
| 817 | +.action-search-sisp #search-results .search-software-item-column-left .org { | |
| 818 | + display: none; | |
| 819 | +} | |
| 820 | + | |
| 821 | +.action-search-sisp #search-results .search-software-item-column-left .extra_info { | |
| 822 | + width: 140px; | |
| 823 | + padding-right: 20px; | |
| 824 | + top: 0px; | |
| 825 | + position: absolute; | |
| 826 | + color: #172738; | |
| 827 | + font-size: 13px; | |
| 828 | + font-family: Arial; | |
| 829 | + text-align: left; | |
| 830 | + opacity: inherit; | |
| 831 | +} | |
| 832 | + | |
| 833 | +.action-search-sisp #search-results .search-software-item-column-left .software-date { | |
| 834 | + margin-top: 20px; | |
| 835 | + width: 130px; | |
| 836 | +} | |
| 837 | + | |
| 838 | +.action-search-sisp #search-results .search-software-item-column-left .software-date::before{ | |
| 839 | + content: url("../images/ic-calendar.png"); | |
| 840 | + margin: 0px 7px 20px 0; | |
| 841 | + float: left; | |
| 842 | +} | |
| 843 | + | |
| 844 | +.action-search-sisp #search-results .search-software-item-column-left .star-container.catalog_rating_block { | |
| 845 | + width: 140px; | |
| 846 | + margin-left: 0px; | |
| 847 | +} | |
| 848 | + | |
| 849 | +.action-search-sisp #search-results .search-software-item-column-left .software-date-value { | |
| 850 | + margin-left: 23px; | |
| 851 | +} | |
| 852 | + | |
| 853 | +/* Column Right */ | |
| 854 | + | |
| 855 | +.action-search-sisp #search-results .search-software-item-column-right { | |
| 856 | + width: 65%; | |
| 857 | + float: left; | |
| 858 | + margin-left: 140px; | |
| 859 | + padding: 0 0 0 8px; | |
| 860 | + font-size: 15px; | |
| 861 | + font-family: Arial; | |
| 862 | +} | |
| 863 | + | |
| 864 | +.action-search-sisp #search-results .search-software-item-column-right .search-software-content-block h4{ | |
| 865 | + margin-top: 0; | |
| 866 | +} | |
| 867 | + | |
| 868 | +.action-search-sisp #search-results .search-software-item-column-right .search-software-content-block h4 a { | |
| 869 | + color: #172738; | |
| 870 | + font-size: 19px; | |
| 871 | +} | |
| 872 | + | |
| 873 | +.action-search-sisp #search-results .search-software-item-column-right .search-software-content-block:last-child { | |
| 874 | + margin-top: 30px; | |
| 875 | +} | |
| 876 | + | |
| 877 | +.action-search-sisp #search-results .search-software-item-column-right span{ | |
| 878 | + width: 100%; | |
| 879 | +} | |
| 880 | + | |
| 881 | +.action-search-sisp #search-results .search-software-item-column-right span b{ | |
| 882 | + font-weight: normal; | |
| 883 | + font-size: 13px; | |
| 884 | +} | |
| 885 | + | |
| 886 | +.action-search-sisp #search-results .search-software-item-column-right .search-software-content-block:last-child span{ | |
| 887 | + width: auto; | |
| 888 | + float: left; | |
| 889 | +} | |
| 890 | + | |
| 891 | +.action-search-sisp #search-results .search-software-content-block #categories-list li { | |
| 892 | + width: auto !important; /* force overwritting from base */ | |
| 893 | + margin-left: 7px !important; /* force overwritting from base */ | |
| 894 | + float: left; | |
| 895 | + color: #3E67B1; | |
| 896 | + font-size: 13px; | |
| 897 | + line-height: 18px; | |
| 898 | + text-decoration: underline; | |
| 899 | +} | |
| 900 | + | |
| 901 | +.action-search-sisp #search-results .search-software-content-block #categories-list li a { | |
| 902 | + color: #3E67B1; | |
| 903 | +} | |
| 904 | + | |
| 905 | +.action-search-sisp #search-results #individually-category br { | |
| 906 | + display: none; | |
| 907 | +} | |
| 908 | + | |
| 909 | +.action-search-sisp #search-results #individually-category a { | |
| 910 | + margin-right: 10px; | |
| 911 | + float: left; | |
| 912 | + color: #3E67B1; | |
| 913 | + font-size: 13px; | |
| 914 | + text-decoration: underline; | |
| 915 | +} | |
| 916 | + | |
| 917 | + | ... | ... |
src/noosfero-spb/software_communities/db/migrate/20151125175514_change_software_info_structure.rb
0 → 100644
| ... | ... | @@ -0,0 +1,39 @@ |
| 1 | +class ChangeSoftwareInfoStructure < ActiveRecord::Migration | |
| 2 | + def up | |
| 3 | + change_table :software_infos do |t| | |
| 4 | + t.text :agency_identification | |
| 5 | + t.text :softawre_requirements | |
| 6 | + t.text :hardware_requirements | |
| 7 | + t.text :documentation | |
| 8 | + t.text :system_applications | |
| 9 | + t.text :active_versions | |
| 10 | + t.text :estimated_cost | |
| 11 | + t.text :responsible | |
| 12 | + t.text :responsible_for_acquirement | |
| 13 | + t.text :system_info | |
| 14 | + t.text :development_info | |
| 15 | + t.text :maintenance | |
| 16 | + t.text :standards_adherence | |
| 17 | + t.text :plataform | |
| 18 | + t.text :sisp_type | |
| 19 | + end | |
| 20 | + end | |
| 21 | + | |
| 22 | + def down | |
| 23 | + remove_column :agency_identification | |
| 24 | + remove_column :softawre_requirements | |
| 25 | + remove_column :hardware_requirements | |
| 26 | + remove_column :documentation | |
| 27 | + remove_column :system_applications | |
| 28 | + remove_column :active_versions | |
| 29 | + remove_column :estimated_cost | |
| 30 | + remove_column :responsible | |
| 31 | + remove_column :responsible_for_acquirement | |
| 32 | + remove_column :system_info | |
| 33 | + remove_column :development_info | |
| 34 | + remove_column :maintenance | |
| 35 | + remove_column :standards_adherence | |
| 36 | + remove_column :plataform | |
| 37 | + remove_column :sisp_type | |
| 38 | + end | |
| 39 | +end | ... | ... |
src/noosfero-spb/software_communities/lib/ext/search_controller.rb
| ... | ... | @@ -24,6 +24,17 @@ class SearchController |
| 24 | 24 | render :layout=>false if request.xhr? |
| 25 | 25 | end |
| 26 | 26 | |
| 27 | + def sisp | |
| 28 | + prepare_sisp_page | |
| 29 | + results = filter_sisp_list | |
| 30 | + @software_count = results.count | |
| 31 | + results = results.paginate(:per_page => @per_page, :page => params[:page]) | |
| 32 | + @searches[@asset] = {:results => results} | |
| 33 | + @search = results | |
| 34 | + | |
| 35 | + render :layout=>false if request.xhr? | |
| 36 | + end | |
| 37 | + | |
| 27 | 38 | protected |
| 28 | 39 | |
| 29 | 40 | def filter_communities_list |
| ... | ... | @@ -51,6 +62,12 @@ class SearchController |
| 51 | 62 | sort_communities_list filtered_community_list |
| 52 | 63 | end |
| 53 | 64 | |
| 65 | + def filter_sisp_list | |
| 66 | + filtered_software_list = get_filtered_software_list | |
| 67 | + filtered_community_list = get_communities_sisp_list(filtered_software_list) | |
| 68 | + sort_communities_list filtered_community_list | |
| 69 | + end | |
| 70 | + | |
| 54 | 71 | def get_filter_category_ids |
| 55 | 72 | category_ids = [] |
| 56 | 73 | unless params[:selected_categories_id].blank? |
| ... | ... | @@ -91,13 +108,22 @@ class SearchController |
| 91 | 108 | def get_communities_list software_list |
| 92 | 109 | filtered_community_list = [] |
| 93 | 110 | software_list.each do |software| |
| 94 | - if !@public_software_selected || software.public_software? | |
| 111 | + if (!@public_software_selected || software.public_software?) && (!software.sisp) | |
| 95 | 112 | filtered_community_list << software.community unless software.community.nil? |
| 96 | 113 | end |
| 97 | 114 | end |
| 98 | 115 | filtered_community_list |
| 99 | 116 | end |
| 100 | 117 | |
| 118 | + def get_communities_sisp_list software_list | |
| 119 | + filtered_community_list = [] | |
| 120 | + software_list.each do |software| | |
| 121 | + if software.sisp | |
| 122 | + filtered_community_list << software.community unless software.community.nil? | |
| 123 | + end | |
| 124 | + end | |
| 125 | + filtered_community_list | |
| 126 | + end | |
| 101 | 127 | def sort_communities_list communities_list |
| 102 | 128 | communities_list.sort! {|a, b| a.name.downcase <=> b.name.downcase} |
| 103 | 129 | |
| ... | ... | @@ -117,7 +143,12 @@ class SearchController |
| 117 | 143 | prepare_software_infos_category_groups |
| 118 | 144 | prepare_software_infos_category_enable |
| 119 | 145 | end |
| 120 | - | |
| 146 | + def prepare_sisp_page | |
| 147 | + prepare_sisp_params | |
| 148 | + prepare_software_infos_message | |
| 149 | + prepare_software_infos_category_groups | |
| 150 | + prepare_software_infos_category_enable | |
| 151 | + end | |
| 121 | 152 | def prepare_software_infos_params |
| 122 | 153 | @titles[:software_infos] = _("Result Search") |
| 123 | 154 | @selected_categories_id = params[:selected_categories_id] |
| ... | ... | @@ -128,6 +159,16 @@ class SearchController |
| 128 | 159 | @per_page = prepare_per_page |
| 129 | 160 | end |
| 130 | 161 | |
| 162 | + def prepare_sisp_params | |
| 163 | + @titles[:sisp] = _("Result Search") | |
| 164 | + @selected_categories_id = params[:selected_categories_id] | |
| 165 | + @selected_categories_id ||= [] | |
| 166 | + @selected_categories_id = @selected_categories_id.map(&:to_i) | |
| 167 | + @all_selected = params[:software_type] == "all" | |
| 168 | + @public_software_selected = !@all_selected | |
| 169 | + @per_page = prepare_per_page | |
| 170 | + end | |
| 171 | + | |
| 131 | 172 | def prepare_per_page |
| 132 | 173 | return 15 if params[:software_display].nil? |
| 133 | 174 | ... | ... |
src/noosfero-spb/software_communities/lib/software_info.rb
src/noosfero-spb/software_communities/public/views/search-software-catalog.js
| ... | ... | @@ -3,19 +3,26 @@ modulejs.define('SearchSoftwareCatalog', ['jquery', 'NoosferoRoot', 'SoftwareCat |
| 3 | 3 | |
| 4 | 4 | var AJAX_URL = { |
| 5 | 5 | software_infos: |
| 6 | - NoosferoRoot.urlWithSubDirectory("/search/software_infos") | |
| 6 | + NoosferoRoot.urlWithSubDirectory("/search/software_infos"), | |
| 7 | + sisp: | |
| 8 | + NoosferoRoot.urlWithSubDirectory("/search/sisp"), | |
| 7 | 9 | }; |
| 8 | 10 | |
| 9 | 11 | |
| 10 | 12 | function dispatch_search_ajax(enable_load) { |
| 11 | 13 | var search_params = get_search_params(); |
| 14 | + var full_url = window.location.href; | |
| 15 | + var url = AJAX_URL.software_infos; | |
| 16 | + if(full_url.indexOf("search/sisp") > -1){ | |
| 17 | + url = AJAX_URL.sisp; | |
| 18 | + } | |
| 12 | 19 | |
| 13 | 20 | if(enable_load) { |
| 14 | 21 | open_loading("Loading"); |
| 15 | 22 | } |
| 16 | 23 | |
| 17 | 24 | $.ajax({ |
| 18 | - url: AJAX_URL.software_infos, | |
| 25 | + url: url, | |
| 19 | 26 | type: "GET", |
| 20 | 27 | data: search_params, |
| 21 | 28 | success: update_search_page_on_ajax, | ... | ... |
src/noosfero-spb/software_communities/views/search/_catalog_result_list.html.erb
| ... | ... | @@ -13,6 +13,7 @@ |
| 13 | 13 | <% end %> |
| 14 | 14 | <% end %> |
| 15 | 15 | |
| 16 | + <%name="software_infos"#TODO remove this %> | |
| 16 | 17 | <% display = display_filter(name, params[:display]) %> |
| 17 | 18 | |
| 18 | 19 | <div class="search-results-innerbox <%= 'common-profile-list-block' if SearchHelper::COMMON_PROFILE_LIST_BLOCK.include?(name) %>"> | ... | ... |
src/noosfero-spb/software_communities/views/search/_software_search_form.html.erb
| ... | ... | @@ -11,13 +11,15 @@ |
| 11 | 11 | <%= hidden_field_tag :display, params[:display] %> |
| 12 | 12 | <%= hidden_field_tag :filter, params[:filter] %> |
| 13 | 13 | |
| 14 | - <%= labelled_radio_button _('Public Software'), :software_type, 'public_software', @public_software_selected, :id => "public_software_radio_button", :class => "project-software" %> | |
| 15 | - <span class="doubts-catalog-software" title="<%= _('Projects that have passed by the Avalia SPB process according to the requirements of IN 01/2011.') %>">?</span> | |
| 16 | - <!-- Projetos que passaram pelo processo do Avalia SPB de acordo com os requisitos da IN 01/2011. --> | |
| 14 | + <div class="radio-buttons"> | |
| 15 | + <%= labelled_radio_button _('Public Software'), :software_type, 'public_software', @public_software_selected, :id => "public_software_radio_button", :class => "project-software" %> | |
| 16 | + <span class="doubts-catalog-software" title="<%= _('Projects that have passed by the Avalia SPB process according to the requirements of IN 01/2011.') %>">?</span> | |
| 17 | + <!-- Projetos que passaram pelo processo do Avalia SPB de acordo com os requisitos da IN 01/2011. --> | |
| 17 | 18 | |
| 18 | - <%= labelled_radio_button _('All'), :software_type, 'all', @all_selected, :id => "all_radio_button", :class => "project-software" %> | |
| 19 | - <span class="doubts-catalog-software" title="<%= _('Projects included in the portal as cases provided by the IN 01/2011.') %>">?</span> | |
| 20 | - <!-- Projetos incluídos no portal, conforme casos previstos na IN 01/2011. --> | |
| 19 | + <%= labelled_radio_button _('All'), :software_type, 'all', @all_selected, :id => "all_radio_button", :class => "project-software" %> | |
| 20 | + <span class="doubts-catalog-software" title="<%= _('Projects included in the portal as cases provided by the IN 01/2011.') %>">?</span> | |
| 21 | + <!-- Projetos incluídos no portal, conforme casos previstos na IN 01/2011. --> | |
| 22 | + </div> | |
| 21 | 23 | |
| 22 | 24 | <div class="search-field"> |
| 23 | 25 | <span class="formfield"> | ... | ... |
src/noosfero-spb/software_communities/views/search/sisp.html.erb
0 → 100644
| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | +<h2>Catálogo de Softwares do SISP</h2> | |
| 2 | + | |
| 3 | +<div id="software-search-container"> | |
| 4 | + <%= search_page_title( @titles[@asset], @category ) %> | |
| 5 | + | |
| 6 | + <%= render :partial => 'software_search_form', :locals => { :hint => _("Type words about the %s you're looking for") % @asset.to_s.singularize } %> | |
| 7 | + | |
| 8 | + <% if @asset == :product %> | |
| 9 | + <%= javascript_tag do %> | |
| 10 | + jQuery('.search-product-price-details').altBeautify(); | |
| 11 | + <% end %> | |
| 12 | + <% end %> | |
| 13 | +</div> | |
| 14 | + | |
| 15 | +<%= render partial:"catalog_result_list" %> | |
| 16 | + | |
| 17 | +<div id="software-pagination"> | |
| 18 | + <% if params[:display] != 'map' %> | |
| 19 | + <%= pagination_links @searches[@asset][:results] %> | |
| 20 | + <% end %> | |
| 21 | +</div> | ... | ... |