From 4b73baad1e73127d62a8100ae2af561d75a9646a Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Mon, 29 Jun 2015 15:32:57 +0500 Subject: [PATCH] fix commit comments --- app/views/projects/comments/_body.html.slim | 2 +- app/views/projects/git/commits/show.html.slim | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/views/projects/comments/_body.html.slim b/app/views/projects/comments/_body.html.slim index ec98ffe5a..da53e6762 100644 --- a/app/views/projects/comments/_body.html.slim +++ b/app/views/projects/comments/_body.html.slim @@ -3,7 +3,7 @@ tabset .offset10 - if defined?(ang_model) = f.input :body, label: false, as: :text, - input_html: { rows: 10, id: "#{id}-body", + input_html: { rows: 10, id: "#{id}-body", style: 'resize: vertical', 'ng-model' => "#{ctrl}.#{ang_model}", 'ng-value' => "#{ctrl}.#{ang_model}" } - else = f.input :body, label: false, as: :text, diff --git a/app/views/projects/git/commits/show.html.slim b/app/views/projects/git/commits/show.html.slim index 4ad53c044..02c21c13a 100644 --- a/app/views/projects/git/commits/show.html.slim +++ b/app/views/projects/git/commits/show.html.slim @@ -8,7 +8,10 @@ == render 'submenu' -.col-xs-12.col-md-10.col-md-offset-1 +- ctrl_params = "{ kind: 'commit', id: '#{@commit.id}' }" +.col-xs-12.col-md-10.col-md-offset-1[ ng-controller= 'CommentsController as commentsCtrl' + ng-init= "commentsCtrl.init('#{@project.name_with_owner}', #{ctrl_params})" ] + - GitPresenters::CommitAsMessagePresenter.present(@commit, project: @project) do |presenter| .panel.panel-default .panel-body @@ -18,11 +21,12 @@ #repo-wrapper == render 'show' - - ctrl_params = "{ kind: 'commit', id: '#{@commit.id}' }" - -comments = @comments.select {|c| c.data.blank? } # dont work @comments.where(data: nil) - div[ ng-controller = 'CommentsController as commentsCtrl' - ng-init = "commentsCtrl.init('#{@project.name_with_owner}', #{ctrl_params})" ] + - comments = @comments.select {|c| c.data.blank? } # dont work @comments.where(data: nil) + div == render "projects/comments/list", list: comments, project: @project, commentable: @commit == render "projects/comments/add", project: @project, commentable: @commit if current_user = hidden_field_tag :preview_url, project_md_preview_path(@project) + +div ng-non-bindable = true + == render 'projects/comments/new_line'