fixes delete column action

This commit is contained in:
zmagod 2018-04-05 09:56:09 +02:00
parent afc2a35557
commit 515c95061c
3 changed files with 7 additions and 5 deletions

View file

@ -94,7 +94,7 @@ class RepositoryColumnsController < ApplicationController
format.json do format.json do
render json: { render json: {
html: render_to_string( html: render_to_string(
partial: 'repositories/delete_column_modal_body.html.erb', partial: 'repository_columns/delete_column_modal_body.html.erb',
locals: { column_index: params[:column_index] } locals: { column_index: params[:column_index] }
) )
} }
@ -104,6 +104,7 @@ class RepositoryColumnsController < ApplicationController
def destroy def destroy
@del_repository_column = @repository_column.dup @del_repository_column = @repository_column.dup
column_id = @repository_column.id
respond_to do |format| respond_to do |format|
format.json do format.json do
if @repository_column.destroy if @repository_column.destroy

View file

@ -32,11 +32,11 @@
checked: checked?(@repository_column, 'RepositoryTextValue'.freeze), checked: checked?(@repository_column, 'RepositoryTextValue'.freeze),
disabled: disabled?(@repository_column, 'RepositoryTextValue'.freeze) %> disabled: disabled?(@repository_column, 'RepositoryTextValue'.freeze) %>
<%= f.radio_button :data_type, <%= f.radio_button :data_type,
'RepositoryFileValue'.freeze, 'RepositoryAssetValue'.freeze,
label: t('libraries.manange_modal_column.labels.file'), label: t('libraries.manange_modal_column.labels.file'),
inline: true, inline: true,
checked: checked?(@repository_column, 'RepositoryFileValue'.freeze), checked: checked?(@repository_column, 'RepositoryAssetValue'.freeze),
disabled: disabled?(@repository_column, 'RepositoryFileValue'.freeze) %> disabled: disabled?(@repository_column, 'RepositoryAssetValue'.freeze) %>
<%= f.radio_button :data_type, <%= f.radio_button :data_type,
'RepositoryListValue'.freeze, 'RepositoryListValue'.freeze,
label: t('libraries.manange_modal_column.labels.dropdown'), label: t('libraries.manange_modal_column.labels.dropdown'),

View file

@ -3,7 +3,8 @@
<div class="repository-columns-header container"> <div class="repository-columns-header container">
<div class="row"> <div class="row">
<%= link_to t('libraries.repository_columns.index.back_to_repository_html', repository: @repository.name), <%= link_to t('libraries.repository_columns.index.back_to_repository_html', repository: @repository.name),
repository_path(@repository) %> repository_path(@repository),
data: { turbolinks: false } %>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-6 text-left page-title"> <div class="col-md-6 text-left page-title">