Skip to content
Permalink
Browse files

Rubocop AA.

  • Loading branch information
harigopal committed Sep 17, 2015
1 parent 5ad4b5b commit be4201bee222b814339abaf830824576189bfa89
@@ -14,7 +14,7 @@
filter :email

form do |f|
f.inputs "Admin Details" do
f.inputs 'Admin Details' do
f.input :email
f.input :password
f.input :password_confirmation
@@ -24,5 +24,4 @@
end
f.actions
end

end
@@ -4,7 +4,7 @@
permit_params :user_id, :points, :activity_type, :created_at

preserve_default_filters!
filter :user_startup_id_eq, label: 'Startup from Batch 1', as: :select, collection: Proc.new { Startup.where(batch: 1) }
filter :user_startup_id_eq, label: 'Startup from Batch 1', as: :select, collection: proc { Startup.where(batch: 1) }

controller do
def scoped_collection
@@ -36,9 +36,13 @@ def scoped_collection

form do |f|
f.inputs 'Extra' do
f.input :user, collection: User.founders,
member_label: Proc.new { |u| "#{u.fullname} - #{u.title.present? ? (u.title + ', ') : ''}#{u.startup.name}" },
f.input(
:user,
collection: User.founders,
member_label: proc { |u| "#{u.fullname} - #{u.title.present? ? (u.title + ', ') : ''}#{u.startup.name}" },
input_html: { style: 'width: calc(80% - 22px);' }
)

f.input :points
f.input :activity_type
f.input :created_at, as: :datepicker

This file was deleted.

This file was deleted.

This file was deleted.

@@ -47,9 +47,8 @@ def find_resource
end

actions do |startup|
link_to "View Timeline", startup, target: "_blank"
link_to 'View Timeline', startup, target: '_blank'
end

end

csv do
@@ -82,11 +81,22 @@ def find_resource
end

action_item :view_feedback, only: :show do
link_to('View All Feedback', admin_startup_feedback_index_url("q[startup_id_eq]" => Startup.friendly.find(params[:id]).id,"commit" => "Filter"))
link_to(
'View All Feedback',
admin_startup_feedback_index_url('q[startup_id_eq]' => Startup.friendly.find(params[:id]).id, commit: 'Filter')
)
end

action_item :record_feedback, only: :show do
link_to('Record New Feedback', new_admin_startup_feedback_path(startup_feedback: { startup_id: Startup.friendly.find(params[:id]).id, reference_url: startup_url(Startup.friendly.find(params[:id])) }))
link_to(
'Record New Feedback',
new_admin_startup_feedback_path(
startup_feedback: {
startup_id: Startup.friendly.find(params[:id]).id,
reference_url: startup_url(Startup.friendly.find(params[:id]))
}
)
)
end

action_item :view_timeline, only: :show do
@@ -124,10 +134,11 @@ def find_resource
member_action :get_all_startup_feedback do
startup = Startup.friendly.find params[:id]
feedback = startup.startup_feedback.order('updated_at desc')

respond_to do |format|
format.json {
render json: {:feedback => feedback, :startup_name => startup.name}
}
format.json do
render json: { feedback: feedback, startup_name: startup.name }
end
end
end

@@ -145,23 +156,29 @@ def find_resource
div class: 'startup-status-buttons' do
unless startup.approved? || startup.unready?
span do
button_to('Approve Startup',
button_to(
'Approve Startup',
custom_update_admin_startup_path(startup: { approval_status: Startup::APPROVAL_STATUS_APPROVED }, email_to_send: :approval),
method: :put, data: { confirm: 'Are you sure you want to approve this startup?' })
method: :put, data: { confirm: 'Are you sure you want to approve this startup?' }
)
end
end
unless startup.rejected? || startup.unready?
span do
button_to('Reject Startup',
button_to(
'Reject Startup',
custom_update_admin_startup_path(startup: { approval_status: Startup::APPROVAL_STATUS_REJECTED }, email_to_send: :rejection),
{ method: :put, data: { confirm: 'Are you sure you want to reject this startup?' } })
method: :put, data: { confirm: 'Are you sure you want to reject this startup?' }
)
end
end
unless startup.dropped_out?
span do
button_to('Drop-out Startup',
button_to(
'Drop-out Startup',
custom_update_admin_startup_path(startup: { approval_status: Startup::APPROVAL_STATUS_DROPPED_OUT }, email_to_send: :dropped_out),
{ method: :put, data: { confirm: 'Are you sure you want to drop out this startup?' } })
method: :put, data: { confirm: 'Are you sure you want to drop out this startup?' }
)
end
end
if startup.unready?
@@ -241,16 +258,20 @@ def find_resource
end

panel 'Emails and Notifications' do
link_to('Reminder to complete startup profile', send_startup_profile_reminder_admin_startup_path, method: :post, data: { confirm: 'Are you sure you wish to send notification and email?' })
link_to(
'Reminder to complete startup profile',
send_startup_profile_reminder_admin_startup_path,
method: :post, data: { confirm: 'Are you sure you wish to send notification and email?' }
)
end
end

form :partial => 'admin/startups/form'
form partial: 'admin/startups/form'

permit_params :name, :website, :about, :email, :logo, :facebook_link, :twitter_link,
{ category_ids: [] }, { founder_ids: [] }, { founders_attributes: [:id, :fullname, :email, :avatar, :remote_avatar_url, :title, :linkedin_url, :twitter_url, :skip_password] },
{ category_ids: [] }, { founder_ids: [] },
{ founders_attributes: [:id, :fullname, :email, :avatar, :remote_avatar_url, :title, :linkedin_url, :twitter_url, :skip_password] },
:created_at, :updated_at, :approval_status, :approval_status, :registration_type,
:incubation_location, :agreement_sent, :agreement_first_signed_at, :agreement_last_signed_at, :agreement_duration,
:physical_incubatee, :presentation_link, :slug, :featured, :batch
end

@@ -8,7 +8,7 @@ def scoped_collection
end
end

index :title => 'Startup Feedback' do
index title: 'Startup Feedback' do
selectable_column
column :startup

@@ -28,7 +28,11 @@ def scoped_collection
if startup_feedback.send_at.present?
startup_feedback.send_at
else
link_to('Email Now!', email_feedback_admin_startup_feedback_path(startup_feedback), method: :put, data: { confirm: 'Are you sure you want to email this feedback to the founders?' })
link_to(
'Email Now!',
email_feedback_admin_startup_feedback_path(startup_feedback),
method: :put, data: { confirm: 'Are you sure you want to email this feedback to the founders?' }
)
end
end

@@ -48,7 +52,11 @@ def scoped_collection
if startup_feedback.send_at.present?
startup_feedback.send_at
else
link_to('Email Now!', email_feedback_admin_startup_feedback_path(startup_feedback), method: :put, data: { confirm: 'Are you sure you want to email this feedback to the founders?' })
link_to(
'Email Now!',
email_feedback_admin_startup_feedback_path(startup_feedback),
method: :put, data: { confirm: 'Are you sure you want to email this feedback to the founders?' }
)
end
end
end
@@ -64,8 +72,11 @@ def scoped_collection
redirect_to action: :index
end

action_item :email, only: :show do
link_to 'Email Now!', email_feedback_admin_startup_feedback_path(startup_feedback), method: :put, data: { confirm: 'Are you sure you want to email this feedback to the founders?' } unless startup_feedback.send_at.present?
action_item only: :show, if: proc { startup_feedback.send_at.blank? } do
link_to(
'Email Now!',
email_feedback_admin_startup_feedback_path(startup_feedback),
method: :put, data: { confirm: 'Are you sure you want to email this feedback to the founders?' }
)
end

end

This file was deleted.

0 comments on commit be4201b

Please sign in to comment.
You can’t perform that action at this time.