Skip to content

Commit

Permalink
Revert "#280 - 新增上傳收據等照片功能"
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsehau Chao authored Aug 16, 2019
1 parent 2023475 commit b09c6f1
Show file tree
Hide file tree
Showing 21 changed files with 4 additions and 95 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
/.byebug_history
/vendor/bundle/*
/public/assets
/public/uploads

/config/database.yml
/config/secrets.yml
Expand Down
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ gem 'act-fluent-logger-rails'
gem 'lograge'
gem 'logstash-event'
gem 'capybara'
gem 'carrierwave', '~> 1.2', '>= 1.2.3'

group :development, :test do
gem 'awesome_print'
Expand Down
8 changes: 0 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ GEM
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
carrierwave (1.2.3)
activemodel (>= 4.0.0)
activesupport (>= 4.0.0)
mime-types (>= 1.16)
chronic (0.10.2)
clavius (1.0.2)
cocoon (1.2.10)
Expand Down Expand Up @@ -219,9 +215,6 @@ GEM
mail (2.7.0)
mini_mime (>= 0.1.1)
method_source (0.8.2)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_mime (1.0.0)
mini_portile2 (2.3.0)
minitest (5.11.3)
Expand Down Expand Up @@ -411,7 +404,6 @@ DEPENDENCIES
capistrano-rails (~> 1.1)
capistrano-upload-config
capybara
carrierwave (~> 1.2, >= 1.2.3)
cocoon
codeclimate-test-reporter (~> 1.0.0)
coffee-rails (~> 4.1.0)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/leave_applications_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def set_query_object

def resource_params
params.require(:leave_application).permit(
:leave_type, :start_time, :end_time, :description, :attachment
:leave_type, :start_time, :end_time, :description
)
end

Expand Down
5 changes: 0 additions & 5 deletions app/helpers/leave_applications_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,4 @@ def leave_type_dropdown_menu(action_name, user)
LeaveApplication.enum_attributes_for_select(:leave_types)
end
end

def link_to_attachment(attachment)
link_to t('.exam_attachment'), current_object.attachment.url, target: :_blank if attachment
end

end
2 changes: 0 additions & 2 deletions app/models/leave_application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ class LeaveApplication < ApplicationRecord
include AASM
include SignatureConcern

mount_uploader :attachment, AttachmentUploader

delegate :name, to: :user, prefix: true

enum status: Settings.leave_applications.statuses
Expand Down
52 changes: 0 additions & 52 deletions app/uploaders/attachment_uploader.rb

This file was deleted.

4 changes: 0 additions & 4 deletions app/views/backend/leave_applications/verify.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@
%th= t_attribute(:updated_at, current_object)
%td= l current_object.updated_at, format: :long

%tr
%th= t_attribute(:attachment, current_object)
%td= link_to_attachment(current_object.attachment.url)

.panel.panel-info
.panel-heading
%h4.panel-title= t_attribute(:leave_time_usages, current_object)
Expand Down
1 change: 0 additions & 1 deletion app/views/leave_applications/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@
= f.input :end_time, as: :string, required: true, input_html: { data: { input: 'datetimepicker', format: 'Y/m/d H:i' } }
= f.error :hours, error: sanitize(f.object.errors[:hours].join('<br />'), tags: %w(br))
= f.input :description, required: true
= f.input :attachment, label: t('activerecord.attributes.leave_application.attachment') + (current_object.attachment.url ? ': ' + File.basename(current_object.attachment.url) : '')
= f.button :submit, class: "submit"
4 changes: 0 additions & 4 deletions app/views/leave_applications/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@
%th= t_attribute(:updated_at, current_object)
%td= l current_object.updated_at, format: :long

%tr
%th= t_attribute(:attachment, current_object)
%td= link_to_attachment(current_object.attachment.url)

- unless current_user.contractor?
.panel.panel-info
.panel-heading
Expand Down
2 changes: 1 addition & 1 deletion config/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@


# Default value for linked_dirs is []
set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system', 'public/uploads')
set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system')


# Default value for default_env is {}
Expand Down
2 changes: 1 addition & 1 deletion config/environment.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Load the Rails application.
require_relative 'application'
require 'carrierwave/orm/activerecord'

# Initialize the Rails application.
Rails.application.initialize!
1 change: 0 additions & 1 deletion config/locales/meta_data.zh_TW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ zh-TW:
comment: "主管備註"
created_at: "建立時間"
updated_at: "更新時間"
attachment: "附件"
errors:
models:
user:
Expand Down
5 changes: 0 additions & 5 deletions config/locales/pages.zh_TW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ zh-TW:
plz_select_leave_type: 請選擇要篩選的請假類別
plz_select_user: 請選擇要篩選的使用者
plz_select_status: 請選擇要篩選的假單狀態
leave_applications:
verify:
exam_attachment: 檢視附件
users:
index:
plz_select_role: 請選擇要篩選的員工身份
Expand All @@ -40,6 +37,4 @@ zh-TW:

leave_applications:
<<: *leave_applications_filter_prompt
show:
exam_attachment: 檢視附件

1 change: 0 additions & 1 deletion config/locales/zh_TW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ zh-TW:
one: 字數錯誤 (必須是一個字)
other: 字數錯誤 (必須是 %{count} 個字)
other_than: 不可以是 %{count} 個字
max_size_error: 檔案最大16mb
template:
body: 以下欄位發生問題:
header:
Expand Down

This file was deleted.

3 changes: 1 addition & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20180713072337) do
ActiveRecord::Schema.define(version: 20171229103357) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -50,7 +50,6 @@
t.integer "manager_id"
t.text "comment"
t.integer "leave_time_id"
t.string "attachment"
t.index ["manager_id"], name: "index_leave_applications_on_manager_id", using: :btree
end

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit b09c6f1

Please sign in to comment.