Sha256: 197681ff92a043d84d31a666db0ac03ae8bd319e86ebc4944f2e4b6b7106165d

Contents?: true

Size: 774 Bytes

Versions: 2

Compression:

Stored size: 774 Bytes

Contents

module Oxen
  module AccountsHelper
    def invited_user? user
      # "blue-grey lighten-2"
      user.invitation_token.nil? ? "" : "invited_user"
    end

    def build_link_from_array arr
      link_to arr[0], arr[1]
    end

    def show_printservers account
      links = account.printservers.collect do |printserver|
        port = printserver.port.to_i+40000
        printgateway = "https://printserver.dk"
        link_to "#{printgateway}:#{port}", data_action: "new_get_window", target: "_blank", alt: "#{printserver.lokation}" do
          content_tag :i, 'print', class: 'material-icons small pink-text lighten-4', title: "#{printserver.lokation}", alt: "#{printserver.lokation}"
        end
      end.join( " ").html_safe
    rescue
      " "
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
oxen_account-0.4.14 app/helpers/oxen/accounts_helper.rb
oxen_account-0.4.13 app/helpers/oxen/accounts_helper.rb