Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgronlund committed Feb 4, 2016
1 parent 16b0209 commit 346ab15
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 120 deletions.
1 change: 0 additions & 1 deletion app/controllers/user/stakes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def stake_params
#:flat_rate_in_cent,
#:currency,
#:email,
#:unassigned,
#:channel_uuid,
#:asset_id,
#:asset_type
Expand Down
78 changes: 1 addition & 77 deletions app/models/recording.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,83 +165,7 @@ def set_shop_product_id_on_stakes shop_product_id
recording_ipi.set_shop_product_id_on_stakes( shop_product_id )
end
end

#def update_stakes shop_product
# #Notifyer.print( 'Recording#update_stakes' , product ) if Rails.env.development?
# self.recording_ipis.each do |recording_ipi|
# recording_ipi.update_stake( shop_product, self )
# end
#end



# move this to stake or service object
#def update_stakes recording
#
# self.get_common_work.ipis.each do |ipi|
# if stake = Stake.find_by(
# account_id: ipi.get_account_id,
# asset_id: recording.uuid,
# asset_type: recording.class.name,
# ip_uuid: ipi.uuid,
# ip_type: ipi.class.name
# )
# else
# stake = Stake.create(
# account_id: ipi.get_account_id,
# asset_id: recording.uuid,
# asset_type: recording.class.name,
# split: ipi.share * 0.5,
# flat_rate_in_cent: 0,
# currency: 'usd',
# email: ipi.user.email,
# unassigned: false,
# ip_uuid: ipi.uuid,
# ip_type: ipi.class.name
# )
# end
#
# end
#
# self.recording_ipis.each do |recording_ipi|
# if stake = Stake.find_by( account_id: recording_ipi.account_id,
# ip_uuid: recording_ipi.uuid,
# ip_type: recording_ipi.class.name,
# asset_id: recording.uuid,
# asset_type: recording.class.name
# )
#
#
# else stake = Stake.create( account_id: recording_ipi.account_id,
# ip_uuid: recording_ipi.uuid,
# ip_type: recording_ipi.class.name,
# asset_id: recording.uuid,
# asset_type: recording.class.name,
# split: recording_ipi.share * 0.5,
# flat_rate_in_cent: 0,
# currency: 'usd',
# email: recording_ipi.email,
# unassigned: false,
#
# )
#
# end
#
#
# end
#
#end

#def update_stakes
# #begin
# # if shop_products = Shop::Product.where(productable_id: self.id, productable_type: self.class.name)
# # shop_products.update_all(title: self.title)
# # end
# #rescue => e
# # post_error "Recording#update_stakes #{e.message}"
# #end
#end



def is_cleared?
#ap "get_common_work.is_cleared?: #{get_common_work.is_cleared?}"
Expand Down
6 changes: 4 additions & 2 deletions app/uploaders/document_uploader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ def store_dir
process :save_content_type_and_size_in_model

def save_content_type_and_size_in_model
model.content_type = file.content_type if file.content_type
model.file_size = file.size
begin
model.content_type = file.content_type if file.content_type
model.file_size = file.size
rescue
end


Expand Down
87 changes: 87 additions & 0 deletions app/views/catalog/common_works/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,93 @@
= link_to 'Clear', catalog_account_catalog_common_works_path(@account, @catalog), class: 'btn btn-default'



.pull-down-10
.table-responsive
table class="table table-hover"
thead
tr
th Title
th Managed by
th Recordings
th Creators
th Completeness
th
tbody
- @common_work_users.each do |common_work_user|
- if common_work = common_work_user.common_work
tr
- if common_work_user.can_manage_common_work
td
/= link_to common_work.title, user_user_common_work_info_path(@user, common_work), class: 'btn btn-default btn-xs'
td = link_to common_work.user.full_name, common_work.user, class: 'btn btn-default btn-xs'
td
/= link_to common_work.recordings.count, user_user_common_work_recording_path(@user, common_work), class: 'btn btn-default btn-xs'
td
/= link_to common_work.common_work_ipis.count, user_user_common_work_path(@user, common_work), class: 'btn btn-default btn-xs'
- else
td
/= link_to common_work.title, user_user_common_work_info_path(@user, common_work), class: 'btn btn-default btn-xs'
td = link_to common_work.user.full_name, common_work.user, class: 'btn btn-default btn-xs'
td
.btn.btn-default.btn-xs disabled='disabled'
= common_work.recordings.count
td
.btn.btn-default.btn-xs disabled='disabled'
= common_work.common_work_ipis.count


td
- if common_work.completeness < 1.0
.progress
div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: #{common_work.completeness*100}%"
span class="sr-only"


-else
.progress
div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: #{100}%"
span class="sr-only"
td
.pull-right
- if common_work_user.can_manage_common_work
= link_to edit_user_user_common_work_path(current_user, common_work)
.btn.btn-default.btn-xs
i.fa.fa-pencil
= link_to user_user_common_work_path(current_user, common_work), data: { confirm: 'Are you sure?' } ,
turboboost: true,
:method => :delete do
.btn.btn-danger.btn-xs
i.fa.fa-times
- else
.btn.btn-default.btn-xs disabled='disabled'
i.fa.fa-pencil


























.row.pull-down-8
.col-sm-12
Expand Down
38 changes: 0 additions & 38 deletions app/views/user/campaign_events/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -38,41 +38,3 @@


















/p
/ strong Campaign:
/ = @campaign_event.campaign
/p
/ strong User:
/ = @campaign_event.user
/p
/ strong Account:
/ = @campaign_event.account
/p
/ strong Title:
/ = @campaign_event.title
/p
/ strong Body:
/ = @campaign_event.body
/p
/ strong Campaign type:
/ = @campaign_event.campaign_type
/p
/ strong Status:
/ = @campaign_event.status
1 change: 0 additions & 1 deletion db/migrate/20150708075412_add_all_tables.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2957,7 +2957,6 @@ def change
# t.datetime "created_at", null: false
# t.datetime "updated_at", null: false
# t.string "email"
# t.boolean "unassigned", default: false
# t.integer "ipiable_id"
# t.string "ipiable_type"
# end
Expand Down
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20160109215921) do
ActiveRecord::Schema.define(version: 20160109214010) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down

0 comments on commit 346ab15

Please sign in to comment.