Noosfero/noosfero

View on GitHub
app/models/control_panel/enable_enterprise.rb

Summary

Maintainability
A
0 mins
Test Coverage
class ControlPanel::EnableEnterprise < ControlPanel::Entry
  class << self
    def name
      _("Enable")
    end

    def section
      "enterprise"
    end

    def icon
      "check-square"
    end

    def priority
      10
    end

    def custom_keywords
      [_("enterprise")]
    end

    def url(profile)
      { controller: "profile_editor", action: "enable" }
    end

    def display?(user, profile, context = {})
      profile.enterprise? && !profile.enabled?
    end
  end
end