liquid_feedback_frontend
view model/vote.lua @ 127:4fb486bce608
add pageinator to issue view.
this "paginator" shows links to the prev/area/next issues that have the same
state then the current one. This helps a lot when inspecting new issues or voting.
The voting filter works a little bit different, as he also activtes the not_voted subfilter
because it is most likely only not voted issues are interessting to the user
this "paginator" shows links to the prev/area/next issues that have the same
state then the current one. This helps a lot when inspecting new issues or voting.
The voting filter works a little bit different, as he also activtes the not_voted subfilter
because it is most likely only not voted issues are interessting to the user
| author | Daniel Poelzleithner <poelzi@poelzi.org> | 
|---|---|
| date | Tue Oct 05 04:44:06 2010 +0200 (2010-10-05) | 
| parents | afd9f769c7ae | 
| children | 
 line source
     1 Vote = mondelefant.new_class()
     2 Vote.table = 'vote'
     3 Vote.primary_key = { "initiative_id", "member_id" }
     5 Vote:add_reference{
     6   mode          = 'm1',
     7   to            = "Issue",
     8   this_key      = 'issue_id',
     9   that_key      = 'id',
    10   ref           = 'issue',
    11 }
    13 Vote:add_reference{
    14   mode          = 'm1',
    15   to            = "Initiative",
    16   this_key      = 'initiative_id',
    17   that_key      = 'id',
    18   ref           = 'initiative',
    19 }
    21 Vote:add_reference{
    22   mode          = 'm1',
    23   to            = "Member",
    24   this_key      = 'author_id',
    25   that_key      = 'id',
    26   ref           = 'author',
    27 }
    29 function Vote:by_pk(initiative_id, member_id)
    30   return self:new_selector()
    31     :add_where{ "initiative_id = ? AND member_id = ?", initiative_id, member_id }
    32     :optional_object_mode()
    33     :exec()
    34 end
