Add permission checking to inline editor fields [SCI-3468]

This commit is contained in:
Oleksii Kriuchykhin 2019-05-15 17:47:09 +02:00
parent 039b2f3754
commit 2ef926e795
4 changed files with 6 additions and 6 deletions

View file

@ -1,9 +1,9 @@
<% provide(:head_title, t("experiments.canvas.head_title", project: h(@project.name)).html_safe) %>
<%= render partial: "shared/sidebar", locals: { current_experiment: @experiment, page: 'canvas' } %>
<%= render partial: "shared/secondary_navigation" , locals: {
<%= render partial: "shared/secondary_navigation" , locals: {
editable: {
name: 'title',
active: true,
active: can_manage_experiment?(@experiment),
width: 'calc(100% - 500px)',
params_group: 'experiment',
field_to_udpate: 'name',

View file

@ -5,7 +5,7 @@
<%= render partial: "shared/secondary_navigation", locals: {
editable: {
name: 'title',
active: true,
active: can_manage_module?(@my_module),
width: 'calc(100% - 580px)',
params_group: 'my_module',
field_to_udpate: 'name',

View file

@ -1,9 +1,9 @@
<% provide(:head_title, t("projects.show.head_title", project: h(@project.name)).html_safe) %>
<%= render partial: "shared/sidebar", locals: { current_project: @project, page: 'project' } %>
<%= render partial: "shared/secondary_navigation", locals: {
<%= render partial: "shared/secondary_navigation", locals: {
editable: {
name: 'title',
active: true,
active: can_manage_project?(@project),
width: 'calc(100% - 500px)',
params_group: 'project',
field_to_udpate: 'name',

View file

@ -152,7 +152,7 @@
<% editable = false if local_assigns[:editable].nil? %>
<h4 class="nav-name <%= (editable && editable[:active]) ? 'editable' : '' %>">
<% if editable && editable[:active] %>
<%= render partial: "shared/inline_editing", locals: {
<%= render partial: "shared/inline_editing", locals: {
initial_value: truncate(title_element.name, length: Constants::MAX_EDGE_LENGTH),
width: editable[:width] || '100%',
name: editable[:name],