Sha256: 9859d0262d9d1571d7ebde532f0a01e4b522dbd20b681aff8fd41c5834fa8b25

Contents?: true

Size: 1.84 KB

Versions: 4

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

4 entries across 4 versions & 1 rubygems

Version Path
paid_up-0.9.13 app/views/paid_up/features/_abilities_table.html.haml
paid_up-0.9.12 app/views/paid_up/features/_abilities_table.html.haml
paid_up-0.9.11 app/views/paid_up/features/_abilities_table.html.haml
paid_up-0.9.10 app/views/paid_up/features/_abilities_table.html.haml