Sha256: d6aa17cef3f6c48e698d108c1c7192a87ec6c2786c4ce939852643e3e22f176c

Contents?: true

Size: 1.84 KB

Versions: 16

Compression:

Stored size: 1.84 KB

Contents

%table.abilities.table.table-bordered{ html_options }
  - for feature in features
    %tr{ id: feature.slug + '_ability'}
      %th= feature.title
      %td
        - case feature.setting_type
          - when 'boolean'
            - if can? :use, feature.slug.to_sym
              = icon 'ok'
              = :allowed.l
            - else
              = icon 'remove'
              = :not_allowed.l
          - when 'table_rows'
            - if can? :own, feature.feature_model
              = icon 'ok'
            - else
              = icon 'remove'
            - if current_user.table_rows_unlimited?(feature.slug)
              = :unlimited.l
            - else
              - remaining = current_user.table_rows_remaining(feature.slug)
              - allowed = current_user.table_rows_allowed(feature.slug)
              - used = current_user.table_rows(feature.slug)
              - if remaining < 0
                = :x_used_y_allowed.l x: used, y: allowed
              - elsif allowed == 0
                = :not_allowed.l
              - else
                = :x_of_y_remaining.l x: remaining, y: allowed
          - when 'rolify_rows'
            - if can? :own, feature.feature_model
              = icon 'ok'
            - else
              = icon 'remove'
            - if current_user.rolify_rows_unlimited?(feature.slug)
              = :unlimited.l
            - else
              - remaining = current_user.rolify_rows_remaining(feature.slug)
              - allowed = current_user.rolify_rows_allowed(feature.slug)
              - used = current_user.rolify_rows(feature.slug)
              - if remaining < 0
                = :x_used_y_allowed.l x: used, y: allowed
              - elsif allowed == 0
                = :not_allowed.l
              - else
                = :x_of_y_remaining.l x: remaining, y: allowed
          - else
            = :error.l

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
paid_up-0.11.7 app/views/paid_up/features/_abilities_table.html.haml
paid_up-0.11.6 app/views/paid_up/features/_abilities_table.html.haml
paid_up-0.11.5 app/views/paid_up/features/_abilities_table.html.haml
paid_up-0.11.4 app/views/paid_up/features/_abilities_table.html.haml
paid_up-0.11.3 app/views/paid_up/features/_abilities_table.html.haml
paid_up-0.11.2 app/views/paid_up/features/_abilities_table.html.haml
paid_up-0.11.1 app/views/paid_up/features/_abilities_table.html.haml
paid_up-0.11.0 app/views/paid_up/features/_abilities_table.html.haml
paid_up-0.10.4 app/views/paid_up/features/_abilities_table.html.haml
paid_up-0.10.3 app/views/paid_up/features/_abilities_table.html.haml
paid_up-0.10.2 app/views/paid_up/features/_abilities_table.html.haml
paid_up-0.10.1 app/views/paid_up/features/_abilities_table.html.haml
paid_up-0.10.0 app/views/paid_up/features/_abilities_table.html.haml
paid_up-0.9.16 app/views/paid_up/features/_abilities_table.html.haml
paid_up-0.9.15 app/views/paid_up/features/_abilities_table.html.haml
paid_up-0.9.14 app/views/paid_up/features/_abilities_table.html.haml