Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

add enterprise plan and features to the view (rails side)

Klaus Zanders9c52ee485851
diff --git a/app/models/enterprise_token.rb b/app/models/enterprise_token.rb
index 1e064f48c2c..dd43d7de04b 100644
--- a/app/models/enterprise_token.rb
+++ b/app/models/enterprise_token.rb
@@ -76,6 +76,8 @@ class EnterpriseToken < ApplicationRecord
:reprieve_days,
:reprieve_days_left,
:restrictions,
+ :plan,
+ :features,
to: :token_object
def token_object
diff --git a/app/views/enterprises/_current.html.erb b/app/views/enterprises/_current.html.erb
index c1d737fff8e..4e3aaafe6b5 100644
--- a/app/views/enterprises/_current.html.erb
+++ b/app/views/enterprises/_current.html.erb
@@ -3,10 +3,12 @@
data-email="<%= @current_token.mail %>"
data-company="<%= @current_token.try(:company) %>"
data-domain="<%= @current_token.try(:domain) %>"
+ data-plan="<%= (@current_token.respond_to?(:plan) ? I18n.t(@current_token.plan, scope: [:enterprise_plans]) : nil) %>"
data-user-count="<%= @current_token.restrictions.nil? ? t("js.admin.enterprise.upsale.unlimited") : @current_token.restrictions[:active_user_count] %>"
data-starts-at="<%= format_date @current_token.starts_at %>"
data-expires-at="<%= @current_token.will_expire? ? (format_date @current_token.expires_at) : t("js.admin.enterprise.upsale.unlimited") %>"
data-is-expired="<%= @current_token.expired?(reprieve: false) %>"
+ data-additional-features="<%= (@current_token.try(:features) || []).map { |feature| I18n.t(feature, scope: [:enterprise_features], default: feature.to_s.humanize) }.join(", ") %>"
data-reprieve-days-left="<%= @current_token.reprieve_days_left %>">
</opce-enterprise-active-saved-trial>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 61826319d7f..166834740b8 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -4577,3 +4577,32 @@ en:
plugin_openproject_auth_saml:
name: "OmniAuth SAML / Single-Sign On"
description: "Adds the OmniAuth SAML provider to OpenProject"
+
+ enterprise_plans:
+ corporate: Corporate Plan
+ enterprise: Enterprise Plan
+
+ enterprise_features:
+ baseline_comparison: Baseline Comparison
+ board_view: Board View
+ conditional_highlighting: Conditional Highlighting
+ custom_actions: Custom Actions
+ custom_field_hierarchies: Custom Field Hierarchies
+ customize_life_cycle: Customize Life Cycle
+ date_alerts: Date Alerts
+ define_custom_style: Define Custom Style
+ edit_attribute_groups: Edit Attribute Groups
+ gantt_pdf_export: Gantt PDF Export
+ grid_widget_wp_graph: Grid Widget Work Package Graph
+ ldap_groups: LDAP Groups
+ one_drive_sharepoint_file_storage: OneDrive/SharePoint File Storage
+ placeholder_users: Placeholder Users
+ project_list_sharing: Project List Sharing
+ readonly_work_packages: Readonly Work Packages
+ sso_auth_providers: SSO Auth Providers
+ team_planner_view: Team Planner View
+ two_factor_authentication: Two-Factor Authentication
+ virus_scanning: Attachment Virus Scanning
+ work_package_query_relation_columns: Work Package Query Relation Columns
+ work_package_sharing: Work Package Sharing
+ work_package_subject_generation: Work Package Subject Generation