Merging in FilterPanel 2

Squashed commit of the following:

commit fe54fab5288c016baaab4a8c211f31ecf316c262
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Wed Sep 12 15:29:49 2012 +0200

    2-level Filter Panel: ignoring multiple meta_contexts for the same meta_key

commit b9a44ee15d95f5906436339b39f4949bcdbc9b53
Author: Thomas Schank <DrTom@schank.ch>
Date:   Wed Sep 12 14:12:43 2012 +0200

    Adjusted filter query (GROUP BY) for PG

commit adf9032c9d96d33319f982dc56c35a5a0c52973d
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Fri Sep 7 17:04:24 2012 +0200

    completing pending test

commit 385f7d9b60ed65a0a7162848a51176b78bc7b0d0
Merge: 668eff0 95b15e3
Author: Ramón Cahenzli <rca@psy-q.ch>
Date:   Fri Sep 7 15:57:01 2012 +0200

    Merge branch 'FS_new_filter_panel_2' of github.com:zhdk/madek into FS_new_filter_panel_2

commit 668eff05ca913c4131617d7e97a9196353806846
Author: Ramón Cahenzli <rca@psy-q.ch>
Date:   Fri Sep 7 15:56:50 2012 +0200

    Merging slow tests back into the main test run, since we are over 30 minutes anyway.

commit 95b15e3d8a3a396aa5c8d030e203921cdacb2247
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Fri Sep 7 15:07:54 2012 +0200

    fixing CI

commit d135dccf41f6ffd89d70992639d48d94d726f679
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Fri Sep 7 14:34:25 2012 +0200

    fixing tests

commit 44e5b876738461860157c45f205d7c21f4ea0a7e
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Fri Sep 7 12:03:15 2012 +0200

    force replace from next (no merge)

commit 0c288a4719961c86b6ffa18057e769bcb133fb0b
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Fri Sep 7 11:59:21 2012 +0200

    considering filter deprecated keys

commit 3b518eba71e03b9b399aff5083fd9af4362cbb1b
Merge: 190fcfc 80046e5
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Fri Sep 7 11:24:05 2012 +0200

    Merge branch 'next' into FS_new_filter_panel_2

commit 190fcfca93ccac59bed0634d6b7a0fad5b26d09c
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Mon Sep 3 18:37:11 2012 +0200

    fixing query, considering the context_name (TODO: 3 levels filter panel)

commit a3a3370e4b0e6aca257c844a85f6e5a25cc0d4e0
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Mon Sep 3 18:36:21 2012 +0200

    open filter panel on demand

commit e610404eb2a07c129d76c2149d0692c52cd56de9
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Mon Sep 3 17:16:03 2012 +0200

    updating gems

commit 673bcf6e0c2c9e8e6639cdb2f4a89f3fc5026a99
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Mon Sep 3 17:13:57 2012 +0200

    client side: updating filter panel

commit de21b0210d41c268f08092563673c6942d544426
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Mon Sep 3 16:13:17 2012 +0200

    scalability and performance optimization generating filter data: fixed 3 (plain sql) queries for the 3 meta_datum_object_types, instead of iterating for each meta_key

commit e7836b3bff14d757f9bfd9dc0cbaa530b45fb43c
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Mon Sep 3 14:27:04 2012 +0200

    request filter data on demand

commit 8952cd179916068b738b094f3f3cc423cf6ee79e
Merge: 526d5ba 0ff6632
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Mon Sep 3 14:02:13 2012 +0200

    Merge branch 'next' into FS_new_filter_panel_2

commit 526d5baf0e83e02feef34c03a22a3ef84cf42a22
Merge: 92a53e3 f869bc2
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Mon Sep 3 11:48:08 2012 +0200

    Merge branch 'next' into FS_new_filter_panel_2

commit 92a53e3e99b29a3ae682fc765db0441cb75e3611
Merge: 660254b 10b4ce0
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Fri Aug 31 23:26:42 2012 +0200

    Merge branch 'next' into FS_new_filter_panel_2

    Conflicts:
    	app/assets/javascripts/app/controllers/filter_controller.js.coffee
    	app/helpers/json/media_resource_helper.rb
    	app/models/media_resource_modules/filter.rb
    	app/models/media_resource_modules/meta_data.rb
    	app/views/media_resources/_index.html.haml
    	doc/README_FOR_API

commit 660254b8522fe3a170b914e4108bce4eeda36cc3
Merge: 4f43a03 ea02f5f
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Fri Aug 31 23:07:42 2012 +0200

    Merge branch 'next' into FS_new_filter_panel_2

    Conflicts:
    	app/models/media_resource_modules/meta_data.rb
    	db/empty_medienarchiv_instance_with_personas.mysql
    	doc/README_FOR_API

commit 4f43a03bdc86bd32aea47f0b50b13400b0bb97d7
Merge: df19b67 b8764eb
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Fri Aug 31 18:14:19 2012 +0200

    Merge branch 'FS_new_filter_panel' into FS_new_filter_panel_2

commit b8764ebf8f25605ee98b79308b9c786c694bb7b9
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Fri Aug 31 17:53:56 2012 +0200

    drop the idea of the params[:filter] namespace and just keep the filter params on top level, because:
    - we can extract the keys we need internally
    - not polluting the url generators
    - not managing both top level and namespace params
    - no backward compatibility problems
    - estetically nicer on the url bar

commit a3bf19abcb55a8cf681751bb67287c237a889761
Author: Sebastian Pape <email@sebastianpape.com>
Date:   Fri Aug 31 17:30:29 2012 +0200

    this feature is covered now by the example

commit 24f90c74784bff64fbf9328035e1ae6e66a5eebe
Author: Sebastian Pape <email@sebastianpape.com>
Date:   Fri Aug 31 17:28:52 2012 +0200

    [FIX CI] Login.Display the cover of a set

commit 85189d21d0769179a9464a69509b10ba6659d9ff
Author: Sebastian Pape <email@sebastianpape.com>
Date:   Fri Aug 31 17:10:43 2012 +0200

    finish examples

commit fd6ba67b0cd3e7572aacac85e0c18f7f514dc0f6
Author: Sebastian Pape <email@sebastianpape.com>
Date:   Fri Aug 31 17:01:43 2012 +0200

    merge filters to top level params

commit fc69e97f9446d446c14036bd182ab8e52665f00b
Author: Sebastian Pape <email@sebastianpape.com>
Date:   Fri Aug 31 14:31:27 2012 +0200

    also create new max migration when the reference dump is newer then the already existing dump in /tmp

commit 66e351e47a69849c1b490d263038be7bb76cf406
Author: Sebastian Pape <email@sebastianpape.com>
Date:   Fri Aug 31 13:50:37 2012 +0200

    fix minor things

commit df19b6783493bdc63a28cdbf21fa2b2358494a9b
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Fri Aug 31 11:59:37 2012 +0200

    context base filter panel (to optimize performance)

commit 74ae8c0a9e475c4ca231b0c7576a75a83430d4a1
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Fri Aug 31 10:32:10 2012 +0200

    separating not_by_current_user and public filters

commit aa0357c8fec09c08ce4f9280ef1cf24e5f705dea
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Thu Aug 30 17:59:53 2012 +0200

    construct groups filter over the media_resources result

commit 9db4377cb37d410a1dc796b40a394110a3f2aa7b
Merge: 0f0f3fe 2e1d175
Author: Sebastian Pape <email@sebastianpape.com>
Date:   Thu Aug 30 16:53:20 2012 +0200

    Merge branch 'FS_new_filter_panel' of github.com:zhdk/madek into FS_new_filter_panel

commit 0f0f3fe42faceb2677e999d3bd0f388a230669a2
Merge: 096390f 3709e0a
Author: Sebastian Pape <email@sebastianpape.com>
Date:   Thu Aug 30 16:52:39 2012 +0200

    finish implementation of search input field in filter

commit 2e1d175eb1a4d3e1b4d94e0bc2597b80d8df7b5c
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Thu Aug 30 16:51:12 2012 +0200

    minor changes

commit 1d397fd1d52e2b643da64aaced12bfe05928fcf0
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Thu Aug 30 15:51:26 2012 +0200

    restoring strings as original

commit 45adeffb8c7898ba2e5d65d040576b6bab32f601
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Thu Aug 30 14:19:40 2012 +0200

    always consider symbolized keys on filter params

commit 096390f9231b5b02be58ebcab0fa8aa0e9831d2d
Author: Sebastian Pape <email@sebastianpape.com>
Date:   Thu Aug 30 13:53:10 2012 +0200

    wip implementation of input search word in filter

commit 3709e0a153ab3315d968f3cf9f5ddaca2a08e2b0
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Thu Aug 30 13:38:15 2012 +0200

    [FINISH] filter params

commit 45912164884ca17c832051120c2ed0345f9669d4
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Thu Aug 30 12:20:36 2012 +0200

    also wrapping accessible_action and type to filter params

commit ae29c6a6f9e626101b3ef7b44cad75263e90f716
Merge: 8d09422 7e1d628
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Thu Aug 30 10:41:22 2012 +0200

    Merge remote-tracking branch 'origin/sp_new_filter_panel_frontend' into FS_new_filter_panel

    Conflicts:
    	app/views/media_resources/_index.html.haml
    Solved.

commit 8d0942226f405b56d6264783a4a9c74169a7e37a
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Thu Aug 30 10:30:34 2012 +0200

    extracting sort out from filter

commit bf742fadf60da3664010c9c50e392d9c6b213a71
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Thu Aug 30 01:26:04 2012 +0200

    more on filter params

commit 7e1d62822bd9ceaa0dba471eae4fa665cf99904f
Author: Sebastian Pape <email@sebastianpape.com>
Date:   Wed Aug 29 17:56:15 2012 +0200

    Implementation of new filter panel on all media resources sites + interaction things

commit c4d94fed979af86e886430b2be252a6bbda1f22e
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Wed Aug 29 17:56:03 2012 +0200

    forward params[:with] to hash_for helper

commit 122fb0526ab89baee5b60863a42ba373bad21a4a
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Wed Aug 29 17:54:01 2012 +0200

    minor changes related to previous commit

commit c7c97ca2dc8e28ff152478337fb03aa0dd55e676
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Wed Aug 29 17:50:03 2012 +0200

    - wrapping user_id and group_id to filter
    - fixing CI

commit 32b209fa463195e688f1287d1cb0631764c5da07
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Wed Aug 29 17:31:40 2012 +0200

    - more work in progress wrapping filter params
    - renaming query to search

commit 4b6d8192ec0b1d245774a186b210cd070342a578
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Wed Aug 29 16:00:48 2012 +0200

    (wip) wrap filter params to params[:filter], based on MediaResourceModules::Filter::KEYS

commit 3c319983741878b39afb984bd9b706b316693ac6
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Wed Aug 29 15:03:39 2012 +0200

    fixing syntax error (introduced in commit 7e5ebe93c626a02a5d92055b414de69a0a7503af)

commit 4165baca9679d3766b7223ccdb21e4cd00af2217
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Wed Aug 29 14:01:56 2012 +0200

    fixing CI: no need of search class on media_set show

commit 51c9bf1055b615066e5d053ec276584ea10658d3
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Wed Aug 29 13:43:58 2012 +0200

    remove filter based on :meta_key_id and :meta_term_id, merged to :meta_data

commit 987c68a7c5dbf25abf379277664aa098a213037c
Author: Sebastian Pape <email@sebastianpape.com>
Date:   Tue Aug 28 17:58:59 2012 +0200

    fix css and beautify

commit 20910ed3ce983d0b1b99f8305c1adea89b5300f7
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Tue Aug 28 16:02:29 2012 +0200

    filter controller method completely merged, filter panel as tmpl, filter js controller, etc… (wip)

commit 0215e3793ef1e5318c1bda171d7dac6dbdabea49
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Mon Aug 27 16:29:05 2012 +0200

    introducing hash_for_facets

commit 5ca3c30297a3dbea148d9b9410a28fd606cb66ea
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Fri Aug 24 17:52:02 2012 +0200

    small fix and minor changes

commit 09176c40466781936af62b9fb90d0d6583229134
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Fri Aug 24 16:24:43 2012 +0200

    removing unused javascript code

commit 4c040062dc9dfc49e51ee25220b84e40726e6666
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Fri Aug 24 16:24:27 2012 +0200

    filter queries

commit 0c2d17a158ae8b7199d804c2b7d4950590b118ba
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Fri Aug 24 14:53:15 2012 +0200

    fixing specs

commit 07a68169e96d3af9e2ef669c79a17ba9e01a3c1a
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Fri Aug 24 14:14:31 2012 +0200

    MediaResourcesController: merging filter POST to index GET request

commit d31224e73c96052239089a36dd7c758025467740
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Fri Aug 24 13:32:00 2012 +0200

    do not get media_resource_ids at all, just the count

commit 691a86bef6ab94abdbcb63499102c6b842cc0606
Merge: b6e0d25 9bc977d
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Fri Aug 24 10:53:34 2012 +0200

    Merge branch 'next' into FS_new_filter_panel

commit b6e0d25125de5ac44365824b7b1d2d4c64fbd3ca
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Fri Aug 24 10:42:51 2012 +0200

    Filter Panel: collect media_resource_ids without instanciating the media_resources (this drastically increases the perfomance!)

commit 933b847d08e8fc89f3f72d2b1f83e88c6e5cbbb4
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Thu Aug 23 18:53:42 2012 +0200

    (wip) fetching directly meta_terms without instanciate media_resources (only for keywords now) and minor changes

commit eb7997f626a462fc43e70895d16643d879b8f755
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Thu Aug 23 12:05:10 2012 +0200

    rafactoring views

commit 359eed3a1d41be28194279980a3ab1ddf5e76794
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Thu Aug 23 11:37:01 2012 +0200

    removing filter view helper

commit c0f66c29d46d39148dff2438f710597e416b97af
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Wed Aug 22 17:59:29 2012 +0200

    filter panel doesn't submit media_resource_ids anymore

commit 85ce887bc826aa3dd912ed76b9d949f2c4bd2b53
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Wed Aug 22 17:58:29 2012 +0200

    fixing spec

commit 9e9ed8eb383ed79e13475941d4379b46e97df6a0
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Wed Aug 22 17:10:07 2012 +0200

    filtering keywords, meta_terms and meta_departments (not using media_resource_ids anymore)

commit 3d64b816ae79adf3ad089e7e766fbe27423e6f7b
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Tue Aug 21 16:22:01 2012 +0200

    merge logic to MediaResource.filter

commit 1148338f1a5493065480602318cf08c0eb2d90be
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Tue Aug 21 14:55:30 2012 +0200

    reactivating old filter panel using the MediaResourceModules::Filter (wip)

commit 8a4aaf453e687fd42650466af6594ec7b548d7ea
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Tue Aug 21 14:36:50 2012 +0200

    introducing MediaResourceModules::Filter

commit 5bc5a8cf47a3f985611ad977ddc932b085932708
Author: Franco Sellitto <franco.sellitto@zhdk.ch>
Date:   Tue Aug 21 11:13:00 2012 +0200

    deactivating old filter panel