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

for empty state move add button to the content

Klaus Zanders8a2c594362f6
diff --git a/app/views/enterprise_tokens/_info.html.erb b/app/views/enterprise_tokens/_info.html.erb
index 77fcffcd39c..dd4ea6dd857 100644
--- a/app/views/enterprise_tokens/_info.html.erb
+++ b/app/views/enterprise_tokens/_info.html.erb
@@ -36,8 +36,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= angular_component_tag(
"opce-enterprise-base",
inputs: enterprise_angular_trial_inputs
- )
- %>
+ ) %>
</div>
<div class='upsell-actions'>
@@ -52,12 +51,34 @@ See COPYRIGHT and LICENSE files for more details.
<%= link_to t(quote_link[:label]),
quote_link[:href],
target: "_blank",
- class: "button -highlight-inverted" %>
+ class: "button -highlight-inverted", rel: "noopener" %>
</div>
<%= static_link_to :contact %>
</div>
+<%# temporary add button %>
+<%- button_title = t("admin.enterprise.create_dialog.title") %>
+<%= render(
+ Primer::Beta::Button.new(
+ tag: :a,
+ scheme: :primary,
+ mobile_label: button_title,
+ mobile_icon: :plus,
+ size: :medium,
+ href: new_enterprise_token_path,
+ aria: { label: button_title },
+ role: "button",
+ data: {
+ turbo_stream: true
+ },
+ title: button_title
+ )
+ ) do |button|
+ button.with_leading_visual_icon(icon: :plus)
+ button_title
+ end %>
+
<div class="info-boxes upsell-benefits">
<h3 class="info-boxes--title -no-border"><%= t("js.admin.enterprise.upsell.benefits.description") %></h3>
diff --git a/app/views/enterprise_tokens/index.html.erb b/app/views/enterprise_tokens/index.html.erb
index 4fa6b4ef7d2..3cd9d0358fa 100644
--- a/app/views/enterprise_tokens/index.html.erb
+++ b/app/views/enterprise_tokens/index.html.erb
@@ -8,23 +8,25 @@
t(:label_enterprise_edition)]
)
- button_title = t("admin.enterprise.create_dialog.title")
- header.with_action_button(
- tag: :a,
- scheme: :primary,
- mobile_label: button_title,
- mobile_icon: :plus,
- size: :medium,
- href: new_enterprise_token_path,
- aria: { label: button_title },
- role: "button",
- data: {
- turbo_stream: true
- },
- title: button_title
- ) do |button|
- button.with_leading_visual_icon(icon: :plus)
- button_title
+ if EnterpriseToken.all_tokens.any?
+ button_title = t("admin.enterprise.create_dialog.title")
+ header.with_action_button(
+ tag: :a,
+ scheme: :primary,
+ mobile_label: button_title,
+ mobile_icon: :plus,
+ size: :medium,
+ href: new_enterprise_token_path,
+ aria: { label: button_title },
+ role: "button",
+ data: {
+ turbo_stream: true
+ },
+ title: button_title
+ ) do |button|
+ button.with_leading_visual_icon(icon: :plus)
+ button_title
+ end
end
end
%>