| rev | 
   line source | 
| 
bsw/jbe@4
 | 
     1 
 | 
| 
bsw/jbe@4
 | 
     2 local initiative = param.get("initiative", "table")
 | 
| 
bsw/jbe@0
 | 
     3 local suggestions_selector = param.get("suggestions_selector", "table")
 | 
| 
bsw@454
 | 
     4 
 | 
| 
bsw@454
 | 
     5 suggestions_selector:add_order_by("plus2_unfulfilled_count + plus1_unfulfilled_count DESC, id")
 | 
| 
bsw@454
 | 
     6 
 | 
| 
bsw/jbe@19
 | 
     7 local tab_id = param.get("tab_id")
 | 
| 
bsw/jbe@19
 | 
     8 local show_name = param.get("show_name", atom.boolean)
 | 
| 
bsw/jbe@19
 | 
     9 if show_name == nil then
 | 
| 
bsw/jbe@19
 | 
    10   show_name = true
 | 
| 
bsw/jbe@19
 | 
    11 end
 | 
| 
bsw/jbe@19
 | 
    12 local show_filter = param.get("show_filter", atom.boolean)
 | 
| 
bsw/jbe@19
 | 
    13 if show_filter == nil then
 | 
| 
bsw/jbe@19
 | 
    14   show_filter = true
 | 
| 
bsw/jbe@19
 | 
    15 end
 | 
| 
bsw/jbe@0
 | 
    16 
 | 
| 
bsw/jbe@19
 | 
    17 local partial = {
 | 
| 
bsw/jbe@19
 | 
    18   routing = {
 | 
| 
bsw/jbe@19
 | 
    19     default = {
 | 
| 
bsw/jbe@19
 | 
    20       mode = "redirect",
 | 
| 
bsw/jbe@19
 | 
    21       module = "initiative",
 | 
| 
bsw/jbe@19
 | 
    22       view = "show_tab",
 | 
| 
bsw/jbe@19
 | 
    23       params = {
 | 
| 
bsw/jbe@19
 | 
    24         initiative_id = initiative.id,
 | 
| 
bsw/jbe@19
 | 
    25         tab = "suggestions",
 | 
| 
bsw/jbe@19
 | 
    26         tab_id = tab_id
 | 
| 
bsw/jbe@19
 | 
    27       },
 | 
| 
bsw/jbe@19
 | 
    28     }
 | 
| 
bsw/jbe@19
 | 
    29   }
 | 
| 
bsw/jbe@19
 | 
    30 }
 | 
| 
bsw/jbe@19
 | 
    31 
 | 
| 
bsw/jbe@19
 | 
    32 local ui_filters = ui.filters
 | 
| 
bsw@454
 | 
    33 if true or not show_filter then
 | 
| 
bsw/jbe@19
 | 
    34   ui_filters = function(args) args.content() end
 | 
| 
bsw/jbe@19
 | 
    35 end
 | 
| 
bsw/jbe@19
 | 
    36 
 | 
| 
bsw@454
 | 
    37 ui.container{ attr = { class = "box" },
 | 
| 
bsw/jbe@0
 | 
    38   content = function()
 | 
| 
bsw/jbe@4
 | 
    39     ui.paginate{
 | 
| 
bsw/jbe@4
 | 
    40       selector = suggestions_selector,
 | 
| 
bsw/jbe@4
 | 
    41       content = function()
 | 
| 
bsw/jbe@4
 | 
    42         ui.list{
 | 
| 
bsw/jbe@4
 | 
    43           attr = { style = "table-layout: fixed;" },
 | 
| 
bsw/jbe@4
 | 
    44           records = suggestions_selector:exec(),
 | 
| 
bsw/jbe@4
 | 
    45           columns = {
 | 
| 
bsw/jbe@4
 | 
    46             {
 | 
| 
bsw/jbe@19
 | 
    47               label = show_name and _"Suggestion" or nil,
 | 
| 
bsw/jbe@4
 | 
    48               content = function(record)
 | 
| 
bsw/jbe@19
 | 
    49                 if show_name then
 | 
| 
bsw/jbe@19
 | 
    50                   ui.link{
 | 
| 
bsw/jbe@19
 | 
    51                     text = record.name,
 | 
| 
bsw/jbe@19
 | 
    52                     module = "suggestion",
 | 
| 
bsw/jbe@19
 | 
    53                     view = "show",
 | 
| 
bsw/jbe@19
 | 
    54                     id = record.id
 | 
| 
bsw/jbe@19
 | 
    55                   }
 | 
| 
bsw/jbe@19
 | 
    56                 end
 | 
| 
bsw/jbe@4
 | 
    57               end
 | 
| 
bsw/jbe@4
 | 
    58             },
 | 
| 
bsw/jbe@4
 | 
    59             {
 | 
| 
bsw@95
 | 
    60               label = _"Collective opinion of supporters",
 | 
| 
bsw/jbe@4
 | 
    61               label_attr = { style = "width: 101px;" },
 | 
| 
bsw/jbe@4
 | 
    62               content = function(record)
 | 
| 
bsw/jbe@4
 | 
    63                 if record.minus2_unfulfilled_count then
 | 
| 
bsw@95
 | 
    64                   local max_value = record.initiative.supporter_count
 | 
| 
bsw/jbe@4
 | 
    65                   ui.bargraph{
 | 
| 
bsw/jbe@4
 | 
    66                     max_value = max_value,
 | 
| 
bsw@95
 | 
    67                     width = 100,
 | 
| 
bsw/jbe@4
 | 
    68                     bars = {
 | 
| 
bsw@95
 | 
    69                       { color = "#0a0", value = record.plus2_unfulfilled_count + record.plus2_fulfilled_count },
 | 
| 
bsw@95
 | 
    70                       { color = "#8f8", value = record.plus1_unfulfilled_count + record.plus1_fulfilled_count },
 | 
| 
bsw@95
 | 
    71                       { color = "#eee", value = max_value - record.minus2_unfulfilled_count - record.minus1_unfulfilled_count - record.minus2_fulfilled_count - record.minus1_fulfilled_count - record.plus1_unfulfilled_count - record.plus2_unfulfilled_count - record.plus1_fulfilled_count - record.plus2_fulfilled_count},
 | 
| 
bsw/jbe@4
 | 
    72                       { color = "#f88", value = record.minus1_unfulfilled_count + record.minus1_fulfilled_count },
 | 
| 
bsw/jbe@4
 | 
    73                       { color = "#a00", value = record.minus2_unfulfilled_count + record.minus2_fulfilled_count },
 | 
| 
bsw/jbe@4
 | 
    74                     }
 | 
| 
bsw/jbe@4
 | 
    75                   }
 | 
| 
bsw/jbe@4
 | 
    76                 end
 | 
| 
bsw/jbe@4
 | 
    77               end
 | 
| 
bsw/jbe@4
 | 
    78             },
 | 
| 
bsw/jbe@4
 | 
    79             {
 | 
| 
bsw/jbe@4
 | 
    80               label = _"My opinion",
 | 
| 
bsw@95
 | 
    81               label_attr = { style = "width: 130px; font-style: italic;" },
 | 
| 
bsw/jbe@4
 | 
    82               content = function(record)
 | 
| 
bsw/jbe@4
 | 
    83                 local degree
 | 
| 
bsw@51
 | 
    84                 local opinion
 | 
| 
bsw@51
 | 
    85                 if app.session.member_id then
 | 
| 
bsw@51
 | 
    86                   opinion = Opinion:by_pk(app.session.member.id, record.id)
 | 
| 
bsw@51
 | 
    87                 end
 | 
| 
bsw/jbe@4
 | 
    88                 if opinion then
 | 
| 
bsw/jbe@4
 | 
    89                   degree = opinion.degree
 | 
| 
bsw@3
 | 
    90                 end
 | 
| 
bsw/jbe@5
 | 
    91                 ui.container{
 | 
| 
bsw/jbe@5
 | 
    92                   attr = { class = "suggestion_my_opinion" },
 | 
| 
bsw/jbe@5
 | 
    93                   content = function()
 | 
| 
bsw@285
 | 
    94                     local has_voting_right = app.session.member and app.session.member:has_voting_right_for_unit_id(initiative.issue.area.unit_id)
 | 
| 
bsw@281
 | 
    95                     if app.session.member_id and has_voting_right then
 | 
| 
bsw@51
 | 
    96                       if initiative.issue.state == "voting" or initiative.issue.state == "closed" then
 | 
| 
bsw@95
 | 
    97                         if degree == -2 then
 | 
| 
bsw@95
 | 
    98                           ui.tag{
 | 
| 
bsw@95
 | 
    99                             tag = "span",
 | 
| 
bsw@95
 | 
   100                             attr = {
 | 
| 
bsw@95
 | 
   101                               class = "action" .. (degree == -2 and " active_red2" or "")
 | 
| 
bsw@95
 | 
   102                             },
 | 
| 
bsw@95
 | 
   103                             content = _"must not"
 | 
| 
bsw@95
 | 
   104                           }
 | 
| 
bsw@95
 | 
   105                         end
 | 
| 
bsw@95
 | 
   106                         if degree == -1 then
 | 
| 
bsw@95
 | 
   107                           ui.tag{
 | 
| 
bsw@95
 | 
   108                             tag = "span",
 | 
| 
bsw@95
 | 
   109                             attr = { class = "action" .. (degree == -1 and " active_red1" or "") },
 | 
| 
bsw@95
 | 
   110                             content = _"should not"
 | 
| 
bsw@95
 | 
   111                           }
 | 
| 
bsw@95
 | 
   112                         end
 | 
| 
bsw@95
 | 
   113                         if degree == nil then
 | 
| 
bsw@95
 | 
   114                           ui.tag{
 | 
| 
bsw@95
 | 
   115                             tag = "span",
 | 
| 
bsw@95
 | 
   116                             attr = { class = "action" .. (degree == nil and " active" or "") },
 | 
| 
bsw@95
 | 
   117                             content = _"neutral"
 | 
| 
bsw@95
 | 
   118                           }
 | 
| 
bsw@95
 | 
   119                         end
 | 
| 
bsw@95
 | 
   120                         if degree == 1 then
 | 
| 
bsw@95
 | 
   121                           ui.tag{
 | 
| 
bsw@95
 | 
   122                             tag = "span",
 | 
| 
bsw@95
 | 
   123                             attr = { class = "action" .. (degree == 1 and " active_green1" or "") },
 | 
| 
bsw@95
 | 
   124                             content = _"should"
 | 
| 
bsw@95
 | 
   125                           }
 | 
| 
bsw@95
 | 
   126                         end
 | 
| 
bsw@95
 | 
   127                         if degree == 2 then
 | 
| 
bsw@95
 | 
   128                           ui.tag{
 | 
| 
bsw@95
 | 
   129                             tag = "span",
 | 
| 
bsw@95
 | 
   130                             attr = { class = "action" .. (degree == 2 and " active_green2" or "") },
 | 
| 
bsw@95
 | 
   131                             content = _"must"
 | 
| 
bsw@95
 | 
   132                           }
 | 
| 
bsw@95
 | 
   133                         end
 | 
| 
bsw@51
 | 
   134                       else
 | 
| 
poelzi@142
 | 
   135                         -- we need to put initiative_id into the parameters to have a redirect target in case the suggestion is gone after the action
 | 
| 
poelzi@142
 | 
   136                         params = param.get_all_cgi()
 | 
| 
poelzi@142
 | 
   137                         params['initiative_id'] = initiative.id
 | 
| 
poelzi@142
 | 
   138 
 | 
| 
bsw@51
 | 
   139                         ui.link{
 | 
| 
bsw@95
 | 
   140                           attr = { class = "action" .. (degree == 2 and " active_green2" or "") },
 | 
| 
bsw@95
 | 
   141                           text = _"must",
 | 
| 
bsw@51
 | 
   142                           module = "opinion",
 | 
| 
bsw@51
 | 
   143                           action = "update",
 | 
| 
poelzi@142
 | 
   144                           routing = { default = { mode = "redirect", module = request.get_module(), view = request.get_view(), id = param.get_id_cgi(), params = params } },
 | 
| 
bsw@51
 | 
   145                           params = {
 | 
| 
bsw@51
 | 
   146                             suggestion_id = record.id,
 | 
| 
bsw@95
 | 
   147                             degree = 2
 | 
| 
bsw@51
 | 
   148                           },
 | 
| 
bsw@51
 | 
   149                           partial = partial
 | 
| 
bsw@51
 | 
   150                         }
 | 
| 
bsw@51
 | 
   151                         slot.put(" ")
 | 
| 
bsw@51
 | 
   152                         ui.link{
 | 
| 
bsw@51
 | 
   153                           attr = { class = "action" .. (degree == 1 and " active_green1" or "") },
 | 
| 
bsw@51
 | 
   154                           text = _"should",
 | 
| 
bsw@51
 | 
   155                           module = "opinion",
 | 
| 
bsw@51
 | 
   156                           action = "update",
 | 
| 
poelzi@142
 | 
   157                           routing = { default = { mode = "redirect", module = request.get_module(), view = request.get_view(), id = param.get_id_cgi(), params = params} },
 | 
| 
bsw@51
 | 
   158                           params = {
 | 
| 
bsw@51
 | 
   159                             suggestion_id = record.id,
 | 
| 
bsw@51
 | 
   160                             degree = 1
 | 
| 
bsw@51
 | 
   161                           },
 | 
| 
bsw@51
 | 
   162                           partial = partial
 | 
| 
bsw@51
 | 
   163                         }
 | 
| 
bsw@51
 | 
   164                         slot.put(" ")
 | 
| 
bsw@51
 | 
   165                         ui.link{
 | 
| 
bsw@95
 | 
   166                           attr = { class = "action" .. (degree == nil and " active" or "") },
 | 
| 
bsw@95
 | 
   167                           text = _"neutral",
 | 
| 
bsw@51
 | 
   168                           module = "opinion",
 | 
| 
bsw@51
 | 
   169                           action = "update",
 | 
| 
poelzi@142
 | 
   170                           routing = { default = { mode = "redirect", module = request.get_module(), view = request.get_view(), id = param.get_id_cgi(), params = params } },
 | 
| 
bsw@51
 | 
   171                           params = {
 | 
| 
bsw@51
 | 
   172                             suggestion_id = record.id,
 | 
| 
bsw@95
 | 
   173                             delete = true
 | 
| 
bsw@95
 | 
   174                           },
 | 
| 
bsw@95
 | 
   175                           partial = partial
 | 
| 
bsw@95
 | 
   176                         }
 | 
| 
bsw@95
 | 
   177                         slot.put(" ")
 | 
| 
bsw@95
 | 
   178                         ui.link{
 | 
| 
bsw@95
 | 
   179                           attr = { class = "action" .. (degree == -1 and " active_red1" or "") },
 | 
| 
bsw@95
 | 
   180                           text = _"should not",
 | 
| 
bsw@95
 | 
   181                           module = "opinion",
 | 
| 
bsw@95
 | 
   182                           action = "update",
 | 
| 
poelzi@142
 | 
   183                           routing = { default = { mode = "redirect", module = request.get_module(), view = request.get_view(), id = param.get_id_cgi(), params = params } },
 | 
| 
bsw@95
 | 
   184                           params = {
 | 
| 
bsw@95
 | 
   185                             suggestion_id = record.id,
 | 
| 
bsw@95
 | 
   186                             degree = -1
 | 
| 
bsw@95
 | 
   187                           },
 | 
| 
bsw@95
 | 
   188                           partial = partial
 | 
| 
bsw@95
 | 
   189                         }
 | 
| 
bsw@95
 | 
   190                         slot.put(" ")
 | 
| 
bsw@95
 | 
   191                         ui.link{
 | 
| 
bsw@95
 | 
   192                           attr = { class = "action" .. (degree == -2 and " active_red2" or "") },
 | 
| 
bsw@95
 | 
   193                           text = _"must not",
 | 
| 
bsw@95
 | 
   194                           module = "opinion",
 | 
| 
bsw@95
 | 
   195                           action = "update",
 | 
| 
poelzi@142
 | 
   196                           routing = { default = { mode = "redirect", module = request.get_module(), view = request.get_view(), id = param.get_id_cgi(), params = params } },
 | 
| 
bsw@95
 | 
   197                           params = {
 | 
| 
bsw@95
 | 
   198                             suggestion_id = record.id,
 | 
| 
bsw@95
 | 
   199                             degree = -2
 | 
| 
bsw@51
 | 
   200                           },
 | 
| 
bsw@51
 | 
   201                           partial = partial
 | 
| 
bsw@51
 | 
   202                         }
 | 
| 
bsw@51
 | 
   203                       end
 | 
| 
bsw@281
 | 
   204                     elseif app.session.member_id then
 | 
| 
bsw@281
 | 
   205                       ui.field.text{ value = _"[No voting privilege]" }
 | 
| 
bsw/jbe@19
 | 
   206                     else
 | 
| 
bsw@51
 | 
   207                       ui.field.text{ value = _"[Registered members only]" }
 | 
| 
bsw/jbe@19
 | 
   208                     end
 | 
| 
bsw/jbe@5
 | 
   209                   end
 | 
| 
bsw/jbe@0
 | 
   210                 }
 | 
| 
bsw/jbe@0
 | 
   211               end
 | 
| 
bsw/jbe@4
 | 
   212             },
 | 
| 
bsw/jbe@4
 | 
   213             {
 | 
| 
bsw/jbe@4
 | 
   214               label = _"Suggestion currently not implemented",
 | 
| 
bsw/jbe@4
 | 
   215               label_attr = { style = "width: 101px;" },
 | 
| 
bsw/jbe@4
 | 
   216               content = function(record)
 | 
| 
bsw/jbe@4
 | 
   217                 if record.minus2_unfulfilled_count then
 | 
| 
bsw@95
 | 
   218                   local max_value = record.initiative.supporter_count
 | 
| 
bsw/jbe@4
 | 
   219                   ui.bargraph{
 | 
| 
bsw/jbe@4
 | 
   220                     max_value = max_value,
 | 
| 
bsw@95
 | 
   221                     width = 100,
 | 
| 
bsw/jbe@4
 | 
   222                     bars = {
 | 
| 
bsw/jbe@4
 | 
   223                       { color = "#0a0", value = record.plus2_unfulfilled_count },
 | 
| 
bsw/jbe@4
 | 
   224                       { color = "#8f8", value = record.plus1_unfulfilled_count },
 | 
| 
bsw@95
 | 
   225                       { color = "#eee", value = max_value - record.minus2_unfulfilled_count - record.minus1_unfulfilled_count - record.plus1_unfulfilled_count - record.plus2_unfulfilled_count },
 | 
| 
bsw@95
 | 
   226                       { color = "#f88", value = record.minus1_unfulfilled_count },
 | 
| 
bsw@95
 | 
   227                       { color = "#a00", value = record.minus2_unfulfilled_count },
 | 
| 
bsw/jbe@4
 | 
   228                     }
 | 
| 
bsw/jbe@4
 | 
   229                   }
 | 
| 
bsw/jbe@4
 | 
   230                 end
 | 
| 
bsw/jbe@4
 | 
   231               end
 | 
| 
bsw/jbe@4
 | 
   232             },
 | 
| 
bsw/jbe@4
 | 
   233             {
 | 
| 
bsw/jbe@4
 | 
   234               label = _"Suggestion currently implemented",
 | 
| 
bsw/jbe@4
 | 
   235               label_attr = { style = "width: 101px;" },
 | 
| 
bsw/jbe@4
 | 
   236               content = function(record)
 | 
| 
bsw/jbe@4
 | 
   237                 if record.minus2_fulfilled_count then
 | 
| 
bsw@95
 | 
   238                   local max_value = record.initiative.supporter_count
 | 
| 
bsw/jbe@4
 | 
   239                   ui.bargraph{
 | 
| 
bsw/jbe@4
 | 
   240                     max_value = max_value,
 | 
| 
bsw@95
 | 
   241                     width = 100,
 | 
| 
bsw/jbe@4
 | 
   242                     bars = {
 | 
| 
bsw@95
 | 
   243                       { color = "#0a0", value = record.plus2_fulfilled_count },
 | 
| 
bsw@95
 | 
   244                       { color = "#8f8", value = record.plus1_fulfilled_count },
 | 
| 
bsw@95
 | 
   245                       { color = "#eee", value = max_value - record.minus2_fulfilled_count - record.minus1_fulfilled_count - record.plus1_fulfilled_count - record.plus2_fulfilled_count},
 | 
| 
bsw/jbe@4
 | 
   246                       { color = "#f88", value = record.minus1_fulfilled_count },
 | 
| 
bsw/jbe@4
 | 
   247                       { color = "#a00", value = record.minus2_fulfilled_count },
 | 
| 
bsw/jbe@4
 | 
   248                     }
 | 
| 
bsw/jbe@4
 | 
   249                   }
 | 
| 
bsw/jbe@4
 | 
   250                 end
 | 
| 
bsw@3
 | 
   251               end
 | 
| 
bsw/jbe@4
 | 
   252             },
 | 
| 
bsw/jbe@4
 | 
   253             {
 | 
| 
bsw@95
 | 
   254               label = app.session.member_id and _"I consider suggestion as" or nil,
 | 
| 
bsw@95
 | 
   255               label_attr = { style = "width: 100px; font-style: italic;" },
 | 
| 
bsw/jbe@4
 | 
   256               content = function(record)
 | 
| 
bsw/jbe@4
 | 
   257                 local degree
 | 
| 
bsw@51
 | 
   258                 local opinion
 | 
| 
bsw@51
 | 
   259                 if app.session.member_id then
 | 
| 
bsw@51
 | 
   260                   opinion = Opinion:by_pk(app.session.member.id, record.id)
 | 
| 
bsw@51
 | 
   261                 end
 | 
| 
bsw/jbe@4
 | 
   262                 if opinion then
 | 
| 
bsw/jbe@4
 | 
   263                   degree = opinion.degree
 | 
| 
bsw/jbe@4
 | 
   264                 end
 | 
| 
bsw/jbe@4
 | 
   265                 if opinion then
 | 
| 
bsw@95
 | 
   266 
 | 
| 
bsw@95
 | 
   267                   ui.link{
 | 
| 
bsw@95
 | 
   268                     attr = { class = opinion.fulfilled and "action active" or "action" },
 | 
| 
bsw@95
 | 
   269                     text = _"implemented",
 | 
| 
bsw@95
 | 
   270                     module = "opinion",
 | 
| 
bsw@95
 | 
   271                     action = "update",
 | 
| 
bsw@95
 | 
   272                     routing = { default = { mode = "redirect", module = request.get_module(), view = request.get_view(), id = param.get_id_cgi(), params = param.get_all_cgi() } },
 | 
| 
bsw@95
 | 
   273                     params = {
 | 
| 
bsw@95
 | 
   274                       suggestion_id = record.id,
 | 
| 
bsw@95
 | 
   275                       fulfilled = true
 | 
| 
bsw@95
 | 
   276                     },
 | 
| 
bsw@95
 | 
   277                     partial = partial
 | 
| 
bsw@95
 | 
   278                   }
 | 
| 
bsw@95
 | 
   279                   slot.put("<br />")
 | 
| 
bsw@95
 | 
   280                   ui.link{
 | 
| 
bsw@95
 | 
   281                     attr = { class = not opinion.fulfilled and "action active" or "action" },
 | 
| 
bsw@95
 | 
   282                     text = _"not implemented",
 | 
| 
bsw@95
 | 
   283                     module = "opinion",
 | 
| 
bsw@95
 | 
   284                     action = "update",
 | 
| 
bsw@95
 | 
   285                     routing = { default = { mode = "redirect", module = request.get_module(), view = request.get_view(), id = param.get_id_cgi(), params = param.get_all_cgi() } },
 | 
| 
bsw@95
 | 
   286                     params = {
 | 
| 
bsw@95
 | 
   287                       suggestion_id = record.id,
 | 
| 
bsw@95
 | 
   288                       fulfilled = false
 | 
| 
bsw@95
 | 
   289                     },
 | 
| 
bsw@95
 | 
   290                     partial = partial
 | 
| 
bsw@95
 | 
   291                   }
 | 
| 
bsw@95
 | 
   292 
 | 
| 
bsw/jbe@4
 | 
   293                 end
 | 
| 
bsw/jbe@4
 | 
   294               end
 | 
| 
bsw/jbe@4
 | 
   295             },
 | 
| 
bsw/jbe@4
 | 
   296             {
 | 
| 
bsw@95
 | 
   297               label = app.session.member_id and _"So I'm" or nil,
 | 
| 
bsw/jbe@4
 | 
   298               content = function(record)
 | 
| 
bsw@51
 | 
   299                 local opinion
 | 
| 
bsw@51
 | 
   300                 if app.session.member_id then
 | 
| 
bsw@51
 | 
   301                   opinion = Opinion:by_pk(app.session.member.id, record.id)
 | 
| 
bsw@51
 | 
   302                 end
 | 
| 
bsw/jbe@4
 | 
   303                 if opinion then
 | 
| 
bsw/jbe@4
 | 
   304                   if (opinion.fulfilled and opinion.degree > 0) or (not opinion.fulfilled and opinion.degree < 0) then
 | 
| 
bsw@95
 | 
   305                     local title = _"satisfied"
 | 
| 
bsw@95
 | 
   306                     ui.image{ attr = { alt = title, title = title }, static = "icons/emoticon_happy.png" }
 | 
| 
bsw@95
 | 
   307                   elseif opinion.degree == 1 or opinion.degree == -1 then
 | 
| 
bsw@95
 | 
   308                     local title = _"a bit unsatisfied"
 | 
| 
bsw@95
 | 
   309                     ui.image{ attr = { alt = title, title = title }, static = "icons/emoticon_unhappy.png" }
 | 
| 
bsw/jbe@4
 | 
   310                   else
 | 
| 
bsw@95
 | 
   311                     local title = _"more unsatisfied"
 | 
| 
bsw@95
 | 
   312                     ui.image{ attr = { alt = title, title = title }, static = "icons/emoticon_unhappy_red.png" }
 | 
| 
bsw/jbe@4
 | 
   313                   end
 | 
| 
bsw/jbe@4
 | 
   314                 end
 | 
| 
bsw/jbe@4
 | 
   315               end
 | 
| 
bsw/jbe@4
 | 
   316             },
 | 
| 
bsw/jbe@4
 | 
   317           }
 | 
| 
bsw/jbe@4
 | 
   318         }
 | 
| 
bsw/jbe@4
 | 
   319       end
 | 
| 
bsw/jbe@0
 | 
   320     }
 | 
| 
bsw/jbe@0
 | 
   321   end
 | 
| 
bsw/jbe@0
 | 
   322 }
 |