Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,37 @@
<% vendor = vendor.to_s %>
<% setting_base = "settings[repository_checkout_data][#{vendor}]" %>
<% enabled = Setting.repository_checkout_data[vendor]["enabled"].to_i > 0 %>
<fieldset class="form--fieldset -collapsible collapsed">
<legend class="form--fieldset-legend" title="<%= klass.vendor_name %>">
<a href="#"><%= klass.vendor_name %>
</a>
</legend>
<div class="form--field">
<% key = "#{setting_base}[enabled]" %>
<input type="hidden" name="<%= key %>" value="0" id="<% "#{key}_hidden" %>">
<%= setting_label key, label: :setting_repository_checkout_display %>
<div class="form--field-container">
<%= styled_check_box_tag key, 1, enabled, class: "settings-repositories--checkout-toggle" %>
<%= render Primer::OpenProject::CollapsibleSection.new(collapsed: true, display: :block, mb: 3) do |section| %>
<% section.with_title(tag: :h5) { klass.vendor_name } %>
<% section.with_collapsible_content do %>
<div class="form--field">
<% key = "#{setting_base}[enabled]" %>
<input type="hidden" name="<%= key %>" value="0" id="<% "#{key}_hidden" %>">
<%= setting_label key, label: :setting_repository_checkout_display %>
<div class="form--field-container">
<%= styled_check_box_tag key, 1, enabled, class: "settings-repositories--checkout-toggle" %>
</div>
<div class="form--field-instructions"><%= t("repositories.checkout.enable_instructions_text") %></div>
</div>
<div class="form--field-instructions"><%= t("repositories.checkout.enable_instructions_text") %></div>
</div>
<div class="form--field">
<% key = "#{setting_base}[base_url]" %>
<%= setting_label key, label: :setting_repository_checkout_base_url %>
<div class="form--field-container">
<%= styled_text_field_tag key, Setting.repository_checkout_data[vendor]["base_url"],
type: "url", required: enabled %>
<div class="form--field">
<% key = "#{setting_base}[base_url]" %>
<%= setting_label key, label: :setting_repository_checkout_base_url %>
<div class="form--field-container">
<%= styled_text_field_tag key, Setting.repository_checkout_data[vendor]["base_url"],
type: "url", required: enabled %>
</div>
<div class="form--field-instructions"><%= simple_format t("repositories.checkout.base_url_text") %></div>
</div>
<div class="form--field-instructions"><%= simple_format t("repositories.checkout.base_url_text") %></div>
</div>
<div class="form--field">
<% key = "#{setting_base}[text]" %>
<%= setting_label key, label: :setting_repository_checkout_text %>
<div class="form--field-container">
<%= styled_text_area_tag key, Setting.repository_checkout_data[vendor]["text"],
placeholder: t("repositories.checkout.default_instructions.#{vendor}") %>
<div class="form--field">
<% key = "#{setting_base}[text]" %>
<%= setting_label key, label: :setting_repository_checkout_text %>
<div class="form--field-container">
<%= styled_text_area_tag key, Setting.repository_checkout_data[vendor]["text"],
placeholder: t("repositories.checkout.default_instructions.#{vendor}") %>
</div>
<div class="form--field-instructions"><%= t("repositories.checkout.text_instructions") %></div>
</div>
<div class="form--field-instructions"><%= t("repositories.checkout.text_instructions") %></div>
</div>
</fieldset>
<% end %>
<% end %>
<% end %>
</fieldset>
36 changes: 18 additions & 18 deletions app/views/roles/_permissions.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,29 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<% permissions.each do |mod, mod_permissions| %>
<% global_prefix = show_global_role ? "fieldset--global--" : "fieldset--" %>
<% module_name = mod.blank? ? "fieldset--global--" + Project.model_name.human.downcase.tr(" ", "_") : global_prefix + l_or_humanize(mod, prefix: "project_module_").downcase.tr(" ", "_") %>
<% module_name = mod.blank? ? "fieldset--global--#{Project.model_name.human.downcase.tr(' ', '_')}" : global_prefix + l_or_humanize(mod, prefix: "project_module_").downcase.tr(" ", "_") %>
<% module_id = module_name.parameterize %>
<fieldset class="form--fieldset -collapsible" id="<%= module_id %>">
<legend class="form--fieldset-legend">

<%= render Primer::OpenProject::CollapsibleSection.new(id: module_id, display: :block, mb: 3) do |section| %>
<% section.with_title do %>
<% if show_global_role && mod.blank? %>
<%= t(:label_global) %>
<% else %>
<%= permission_header_for_project_module(mod) %>
<% end %>
</legend>
<div class="form--toolbar">
<span class="form--toolbar-item">
(<%= check_all_links module_id %>)
</span>
</div>
<% unless I18n.t("#{mod}.permission_header_explanation", default: '').empty? %>
<div class="-italic">
<p>
<%= I18n.t("#{mod}.permission_header_explanation").html_safe %>
</p>
</div>
<% end %>
<div class="-columns-2">

<% if I18n.exists?("permission_header_explanation", scope: mod) %>
<% section.with_caption do %>
<%= I18n.t("permission_header_explanation", scope: mod) %>
<% end %>
<% end %>

<% section.with_additional_information do %>
<%= check_all_links module_id %>
<% end %>

<% section.with_collapsible_content do %>
<% Array(mod_permissions).each do |permission| %>
<% next if permission.global? && !show_global_role %>
<div class="form--field">
Expand All @@ -67,7 +67,7 @@ See COPYRIGHT and LICENSE files for more details.
</div>
</div>
<% end %>
</div>
</fieldset>
<% end %>
<% end %>
<% end %>
<%= hidden_field_tag "role[permissions][]", "" %>
132 changes: 67 additions & 65 deletions app/views/roles/report.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -48,86 +48,88 @@ See COPYRIGHT and LICENSE files for more details.
<%= hidden_field_tag "permissions[0]", "", id: nil %>

<% group_permissions_by_module(@permissions).each do |mod, mod_permissions| %>
<% module_name = mod.blank? ? "form--" + I18n.t("attributes.project") : "form--" + l_or_humanize(mod, prefix: "project_module_").tr(" ", "_") %>
<% module_name = mod.blank? ? "form--#{I18n.t('attributes.project')}" : "form--#{l_or_humanize(mod, prefix: 'project_module_').tr(' ', '_')}" %>
<% escaped_name = module_name.parameterize %>
<fieldset class="form--fieldset -collapsible" id="<%= escaped_name %>">
<legend class="form--fieldset-legend">

<%= render Primer::OpenProject::CollapsibleSection.new(id: escaped_name, display: :block, mb: 3) do |section| %>
<% section.with_title do %>
<%= permission_header_for_project_module(mod) %>
</legend>
<div class="form--toolbar">
<span class="form--toolbar-item">
(<%= check_all_links escaped_name %>)
</span>
</div>

<div class="generic-table--container">
<div class="generic-table--results-container">
<table class="generic-table" data-controller="table-highlighting">
<colgroup>
<col>
<col>
<col>
<col>
<col>
<col>
</colgroup>
<thead>
<tr>
<th>
<div class="generic-table--sort-header-outer">
<div class="generic-table--sort-header">
<span>
<%= t(:label_permissions) %>
</span>
</div>
</div>
</th>
<% @roles.each do |role| %>
<% end %>

<% section.with_additional_information do %>
<%= check_all_links escaped_name %>
<% end %>

<% section.with_collapsible_content do %>
<div class="generic-table--container">
<div class="generic-table--results-container">
<table class="generic-table" data-controller="table-highlighting">
<colgroup>
<col>
<col>
<col>
<col>
<col>
<col>
</colgroup>
<thead>
<tr>
<th>
<div class="generic-table--sort-header-outer">
<div class="generic-table--sort-header">
<span>
<%= content_tag(role.builtin? ? "em" : "span", h(role.name)) %>
<%= link_to_function(
icon_wrapper("icon-context icon-checkmark", "#{t(:button_check_all)}/#{t(:button_uncheck_all)}"),
"OpenProject.helpers.toggleCheckboxesBySelector('input.role-#{role.id}')",
class: "no-decoration-on-hover",
title: "#{t(:button_check_all)}/#{t(:button_uncheck_all)}"
) %>
<%= t(:label_permissions) %>
</span>
</div>
</div>
</th>
<% end %>
</tr>
</thead>
<tbody>
<% mod_permissions.each do |permission| %>
<tr class="permission-<%= permission.name %>">
<td>
<%= link_to_function(
icon_wrapper("icon-context icon-checkmark", "#{t(:button_check_all)}/#{t(:button_uncheck_all)}"),
"OpenProject.helpers.toggleCheckboxesBySelector('.permission-#{permission.name} input')",
class: "no-decoration-on-hover",
title: "#{t(:button_check_all)}/#{t(:button_uncheck_all)}"
) %>
<%= l_or_humanize(permission.name, prefix: "permission_") %>
</td>
<% @roles.each do |role| %>
<td>
<% if setable_permissions(role).include? permission %>
<%= check_box_tag "permissions[#{role.id}][]", permission.name, (role.permissions.include? permission.name), id: nil, class: "role-#{role.id}" %>
<% end %>
</td>
<th>
<div class="generic-table--sort-header-outer">
<div class="generic-table--sort-header">
<span>
<%= content_tag(role.builtin? ? "em" : "span", h(role.name)) %>
<%= link_to_function(
icon_wrapper("icon-context icon-checkmark", "#{t(:button_check_all)}/#{t(:button_uncheck_all)}"),
"OpenProject.helpers.toggleCheckboxesBySelector('input.role-#{role.id}')",
class: "no-decoration-on-hover",
title: "#{t(:button_check_all)}/#{t(:button_uncheck_all)}"
) %>
</span>
</div>
</div>
</th>
<% end %>
</tr>
<% end %>
</tbody>
</table>
</thead>
<tbody>
<% mod_permissions.each do |permission| %>
<tr class="permission-<%= permission.name %>">
<td>
<%= link_to_function(
icon_wrapper("icon-context icon-checkmark", "#{t(:button_check_all)}/#{t(:button_uncheck_all)}"),
"OpenProject.helpers.toggleCheckboxesBySelector('.permission-#{permission.name} input')",
class: "no-decoration-on-hover",
title: "#{t(:button_check_all)}/#{t(:button_uncheck_all)}"
) %>
<%= l_or_humanize(permission.name, prefix: "permission_") %>
</td>
<% @roles.each do |role| %>
<td>
<% if setable_permissions(role).include? permission %>
<%= check_box_tag "permissions[#{role.id}][]", permission.name, (role.permissions.include? permission.name), id: nil, class: "role-#{role.id}" %>
<% end %>
</td>
<% end %>
</tr>
<% end %>
</tbody>
</table>

</div>
</div>
</div>
</fieldset>
<% end %>
<% end %>
<% end %>

<p><%= styled_button_tag t(:button_save), class: "-primary -with-icon icon-checkmark" %></p>
Expand Down
24 changes: 12 additions & 12 deletions app/views/versions/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,18 @@ See COPYRIGHT and LICENSE files for more details.
<%= render partial: "versions/overview", locals: { version: version } %>
<%= render(partial: "wiki/text", locals: { page: version.wiki_page }) if version.wiki_page %>
<% if (issues = @wps_by_version[version]) && issues.size > 0 %>
<form>
<fieldset class="form--fieldset -collapsible">
<legend class="form--fieldset-legend"><%= t(:label_related_work_packages) %></legend>
<div>
<ul>
<%- issues.each do |issue| -%>
<li><%= link_to_work_package(issue, project: (@project != issue.project)) %></li>
<%- end -%>
</ul>
</div>
</fieldset>
</form>
<%= render Primer::OpenProject::CollapsibleSection.new(display: :block, mb: 3) do |section| %>
<% section.with_title_content(t(:label_related_work_packages)) %>
<% section.with_collapsible_content do %>
<div>
<ul>
<%- issues.each do |issue| -%>
<li><%= link_to_work_package(issue, project: (@project != issue.project)) %></li>
<%- end -%>
</ul>
</div>
<% end %>
<% end %>
<% end %>
<%= call_hook :view_projects_roadmap_version_bottom, version: version %>
<% end %>
Expand Down
Loading
Loading