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

2.3 KB
Raw Blame
<% entries = @texts_by_type[tab[:name]] || [] %>
<% if entries.any? %>
  <div class="generic-table--container">
    <div class="generic-table--results-container">
      <table class="generic-table" data-controller="table-highlighting">
        <colgroup>
          <col>
          <col>
          <col>
          <col data-highlight="false">
        </colgroup>
        <thead>
        <tr>
          <th>
            <div class="generic-table--sort-header-outer">
              <div class="generic-table--sort-header">
                  <span>
                    <%= AttributeHelpText.human_attribute_name(:attribute_name) %>
                  </span>
              </div>
            </div>
          </th>
          <th>
            <div class="generic-table--sort-header-outer">
              <div class="generic-table--sort-header">
                  <span>
                    <%= AttributeHelpText.human_attribute_name(:help_text) %>
                  </span>
              </div>
            </div>
          </th>
          <th>
            <div class="generic-table--empty-header"></div>
          </th>
        </tr>
        </thead>
        <tbody>
        <% entries.each do |attribute_help_text| -%>
          <tr class="attribute-help-text--entry">
            <td>
              <%= link_to h(attribute_help_text.attribute_caption),
                          edit_attribute_help_text_path(attribute_help_text) %>
            </td>
            <td>
              <%=
                render OpenProject::Common::AttributeHelpTextComponent.new(help_text: attribute_help_text) do |help_text|
                  help_text.with_additional_label_content(t(:"attribute_help_texts.show_preview"))
                end
              %>
            </td>
            <td class="buttons">
              <%= link_to(
                    op_icon("icon icon-delete"),
                    attribute_help_text_path(attribute_help_text),
                    data: {
                      turbo_method: :delete,
                      turbo_confirm: I18n.t(:text_are_you_sure)
                    },
                    title: t(:button_delete)
                  ) %>
            </td>
          </tr>
        <% end %>
        </tbody>
      </table>
    </div>
  </div>
<% else %>
  <%= no_results_box %>
<% end %>