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

using classes instead of inline styles as requested by @ulferts

Jonas Jabaribbf301e9daab
diff --git a/app/views/my/access_token_partials/_api_tokens_section.html.erb b/app/views/my/access_token_partials/_api_tokens_section.html.erb
index 490cfb90b46..3b700702d9e 100644
--- a/app/views/my/access_token_partials/_api_tokens_section.html.erb
+++ b/app/views/my/access_token_partials/_api_tokens_section.html.erb
@@ -38,7 +38,7 @@ See COPYRIGHT and LICENSE files for more details.
</p>
<% if Setting.rest_api_enabled? %>
<% if api_token %>
- <div class="generic-table--container">
+ <div class="generic-table--container api-token-table">
<div class="generic-table--results-container">
<table class="generic-table">
<%= render partial: "my/access_token_partials/token_table_header",
@@ -52,14 +52,14 @@ See COPYRIGHT and LICENSE files for more details.
%>
<tbody>
<tr>
- <td style="width: 60%;" data-qa-selector="api-token-row-name"><%= t("my_account.access_tokens.api.static_token_name") %></td>
+ <td class="-w-rel-60" data-qa-selector="api-token-row-name"><%= t("my_account.access_tokens.api.static_token_name") %></td>
<td>
<span title="<%= format_time(api_token.created_at) %>">
<%= format_time(api_token.created_at.to_s) %>
</span>
</td>
<td><%= t('my_account.access_tokens.indefinite_expiration') %></td>
- <td style="text-align: right;">
+ <td class="buttons">
<%= link_to "",
{ action: 'revoke_api_key' },
method: :delete,
diff --git a/app/views/my/access_token_partials/_icalendar_tokens_section.html.erb b/app/views/my/access_token_partials/_icalendar_tokens_section.html.erb
index ecaf7b9bf75..320f6174111 100644
--- a/app/views/my/access_token_partials/_icalendar_tokens_section.html.erb
+++ b/app/views/my/access_token_partials/_icalendar_tokens_section.html.erb
@@ -56,8 +56,8 @@ See COPYRIGHT and LICENSE files for more details.
<% ical_tokens_grouped_by_query.each do |query_id, tokens| %>
<% tokens.sort_by(&:created_at).each do |token| %>
<tr>
- <td style="width: 20%;" data-qa-selector="ical-token-row-<%= token.id %>-name"><%= token.ical_token_query_assignment.name %></td>
- <td style="width: 20%;" data-qa-selector="ical-token-row-<%= token.id %>-query-name">
+ <td class="-w-rel-20 -mw-abs-200" data-qa-selector="ical-token-row-<%= token.id %>-name"><%= token.ical_token_query_assignment.name %></td>
+ <td class="-w-rel-20 -mw-abs-200" data-qa-selector="ical-token-row-<%= token.id %>-query-name">
<%= link_to token.query.name,
project_calendar_url(
id: query_id,
@@ -65,7 +65,7 @@ See COPYRIGHT and LICENSE files for more details.
)
%>
</td>
- <td style="width: 20%;" data-qa-selector="ical-token-row-<%= token.id %>-project-name">
+ <td class="-w-rel-20 -mw-abs-200" data-qa-selector="ical-token-row-<%= token.id %>-project-name">
<%= token.query.project.name %>
</td>
<td>
@@ -74,7 +74,7 @@ See COPYRIGHT and LICENSE files for more details.
</span>
</td>
<td><%= t('my_account.access_tokens.indefinite_expiration') %></td>
- <td style="text-align: right;">
+ <td class="buttons">
<%= link_to "",
{ action: 'revoke_ical_token', id: token.id },
data: { confirm: t('my_account.access_tokens.simple_revoke_confirmation'), qa_selector: "ical-token-row-#{token.id}-revoke" },
diff --git a/app/views/my/access_token_partials/_oauth_tokens_section.html.erb b/app/views/my/access_token_partials/_oauth_tokens_section.html.erb
index 23b6f04ae4f..9d45c581275 100644
--- a/app/views/my/access_token_partials/_oauth_tokens_section.html.erb
+++ b/app/views/my/access_token_partials/_oauth_tokens_section.html.erb
@@ -53,7 +53,7 @@ See COPYRIGHT and LICENSE files for more details.
<% granted_applications.each do |application, tokens| %>
<% latest = tokens.sort_by(&:created_at).last %>
<tr id="oauth-application-grant-<%= application.id %>">
- <td style="width: 60%;" data-qa-selector="oauth-token-row-<%= application.id %>-name">
+ <td class="-w-rel-60" data-qa-selector="oauth-token-row-<%= application.id %>-name">
<%= t('oauth.application.named', name: application.name) %>
&nbsp;
(<%= t('oauth.x_active_tokens', count: tokens.count) %>)
@@ -64,7 +64,7 @@ See COPYRIGHT and LICENSE files for more details.
<td>
<span><%= format_time(latest.created_at + latest.expires_in.seconds) %></span>
</td>
- <td style="text-align: right;">
+ <td class="buttons">
<%= link_to "",
revoke_my_oauth_application_path(application_id: application.id),
data: { confirm: t('oauth.revoke_my_application_confirmation',
diff --git a/app/views/my/access_token_partials/_rss_tokens_section.html.erb b/app/views/my/access_token_partials/_rss_tokens_section.html.erb
index f3f1393dc53..bec07e63334 100644
--- a/app/views/my/access_token_partials/_rss_tokens_section.html.erb
+++ b/app/views/my/access_token_partials/_rss_tokens_section.html.erb
@@ -52,14 +52,14 @@ See COPYRIGHT and LICENSE files for more details.
%>
<tbody>
<tr>
- <td style="width: 60%;" data-qa-selector="rss-token-row-name"><%= t("my_account.access_tokens.rss.static_token_name") %></td>
+ <td class="-w-rel-60" data-qa-selector="rss-token-row-name"><%= t("my_account.access_tokens.rss.static_token_name") %></td>
<td>
<span title="<%= format_time(rss_token.created_at) %>">
<%= format_time(rss_token.created_at.to_s) %>
</span>
</td>
<td><%= t('my_account.access_tokens.indefinite_expiration') %></td>
- <td style="text-align: right;">
+ <td class="buttons">
<%= link_to "",
{ action: 'revoke_rss_key' },
method: :delete,
diff --git a/frontend/src/global_styles/content/_table.sass b/frontend/src/global_styles/content/_table.sass
index 07b09c113c4..98b380e97c5 100644
--- a/frontend/src/global_styles/content/_table.sass
+++ b/frontend/src/global_styles/content/_table.sass
@@ -215,7 +215,7 @@ table.generic-table
max-width: 500px
// The avatar image is not taken into the width calculation of the table cell by the browser.
- That is why we add the space manually.
+ // That is why we add the space manually.
&.-contains-avatar
text-overflow: clip
.wp-table--cell-container
@@ -233,6 +233,31 @@ table.generic-table
&.-no-highlighting
background-color: $body-background
+ // fixed column width helpers
+ &.-w-rel-20
+ width: 20%
+
+ &.-mw-abs-200
+ max-width: 200px //override the default max-width for appropriate text ellipsis
+
+ &.-w-rel-40
+ width: 40%
+
+ &.-mw-abs-400
+ max-width: 400px //override the default max-width for appropriate text ellipsis
+
+ &.-w-rel-60
+ width: 60%
+
+ &.-mw-abs-600
+ max-width: 600px //override the default max-width for appropriate text ellipsis
+
+ &.-w-rel-80
+ width: 80%
+
+ &.-mw-abs-800
+ max-width: 800px //override the default max-width for appropriate text ellipsis
+
// Enable sticky headers
thead.-sticky th
position: sticky