<commit_before>Os = require 'os'
Path = require 'path'
fs = require 'fs-plus'

{BufferedProcess} = require 'atom'
{$, TextEditorView, View} = require 'atom-space-pen-views'
StatusView = require './status-view'
git = require '../git'

module.exports=
class TagCreateView extends View

  @content: ->
    @div class: 'overlay from-top', =>
      @div class: 'block', =>
        @subview 'tagName', new TextEditorView(mini: true, placeholderText: 'Tag')
      @div class: 'block', =>
        @subview 'tagMessage', new TextEditorView(mini: true, placeholderText: 'Annotation message')
      @div class: 'block', =>
        @span class: 'pull-left', =>
          @button class: 'btn btn-success inline-block-tight gp-confirm-button', click: 'createTag', 'Create Tag'
        @span class: 'pull-right', =>
          @button class: 'btn btn-error inline-block-tight gp-cancel-button', click: 'destroy', 'Cancel'

  initialize: ->
    @panel ?= atom.workspace.addModalPanel(item: this)
    @panel.show()
    @tagName.focus()
    @on 'core:cancel', => @destroy()
    @on 'core:confirm', => @createTag()

  createTag: ->
    tag = name: @tagName.getModel().getText(), message: @tagMessage.getModel().getText()
    new BufferedProcess
      command: 'git'
      args: ['tag', '-a', tag.name, '-m', tag.message]
      options:
        cwd: git.dir()
      stderr: (data) ->
        new StatusView(type: 'alert', message: data.toString())
      exit: (code) ->
        new StatusView(type: 'success', message: "Tag '#{tag.name}' has been created successfully!") if code is 0
    @destroy()

  destroy: ->
    @panel.destroy()
<commit_msg>Remove overlay from tag create view<commit_after>Os = require 'os'
Path = require 'path'
fs = require 'fs-plus'

{BufferedProcess} = require 'atom'
{$, TextEditorView, View} = require 'atom-space-pen-views'
StatusView = require './status-view'
git = require '../git'

module.exports=
class TagCreateView extends View

  @content: ->
    @div =>
      @div class: 'block', =>
        @subview 'tagName', new TextEditorView(mini: true, placeholderText: 'Tag')
      @div class: 'block', =>
        @subview 'tagMessage', new TextEditorView(mini: true, placeholderText: 'Annotation message')
      @div class: 'block', =>
        @span class: 'pull-left', =>
          @button class: 'btn btn-success inline-block-tight gp-confirm-button', click: 'createTag', 'Create Tag'
        @span class: 'pull-right', =>
          @button class: 'btn btn-error inline-block-tight gp-cancel-button', click: 'destroy', 'Cancel'

  initialize: ->
    @panel ?= atom.workspace.addModalPanel(item: this)
    @panel.show()
    @tagName.focus()
    @on 'core:cancel', => @destroy()
    @on 'core:confirm', => @createTag()

  createTag: ->
    tag = name: @tagName.getModel().getText(), message: @tagMessage.getModel().getText()
    new BufferedProcess
      command: 'git'
      args: ['tag', '-a', tag.name, '-m', tag.message]
      options:
        cwd: git.dir()
      stderr: (data) ->
        new StatusView(type: 'alert', message: data.toString())
      exit: (code) ->
        new StatusView(type: 'success', message: "Tag '#{tag.name}' has been created successfully!") if code is 0
    @destroy()

  destroy: ->
    @panel.destroy()

{'fraction_non_alphanumeric': 0.16907914998460116, 'fraction_numerical': 0.0006159531875577456, 'mean_word_length': 3.1963824289405687, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7036658', 'n_tokens_mistral': 1029, 'n_tokens_neox': 1003, 'n_words': 278}