Use transfers :new template only
Now there's no point on using one for user/member and another one for organization.
This commit is contained in:
@ -19,7 +19,7 @@ class TransfersController < ApplicationController
|
||||
transfer = build_transfer(offer, source)
|
||||
|
||||
render(
|
||||
template,
|
||||
:new,
|
||||
locals: {
|
||||
accountable: accountable,
|
||||
transfer: transfer,
|
||||
@ -40,14 +40,6 @@ class TransfersController < ApplicationController
|
||||
|
||||
private
|
||||
|
||||
def template
|
||||
if for_organization?
|
||||
:new_organization
|
||||
else
|
||||
:new
|
||||
end
|
||||
end
|
||||
|
||||
# Returns a new instance of Transfer with the data provided in the request
|
||||
#
|
||||
# @return [Transfer]
|
||||
|
||||
@ -1,49 +0,0 @@
|
||||
<h1>
|
||||
<small><%= t ".give_time" %></small>
|
||||
<%= link_to accountable.display_name_with_uid, accountable_path(accountable) %>
|
||||
</h1>
|
||||
<% if offer %>
|
||||
<h3><%= offer %></h3>
|
||||
<% end %>
|
||||
<%= simple_form_for transfer do |f| %>
|
||||
<div class="form-inputs">
|
||||
<%= f.input :hours,
|
||||
as: :integer,
|
||||
input_html: {
|
||||
min: 0,
|
||||
max: 20,
|
||||
"data-rule-either-hours-minutes-informed" => "true",
|
||||
"data-rule-range" => "[0,20]"
|
||||
} %>
|
||||
<%= f.input :minutes,
|
||||
as: :integer,
|
||||
input_html: {
|
||||
min: 0,
|
||||
max: 59,
|
||||
step: 15,
|
||||
"data-rule-either-hours-minutes-informed" => "true",
|
||||
"data-rule-range" => "[0,59]"
|
||||
} %>
|
||||
<%= f.input :amount, as: :hidden %>
|
||||
<%= f.input :reason %>
|
||||
<%= f.input :destination, as: :hidden %>
|
||||
|
||||
<% if admin? %>
|
||||
<%= render partial: 'sources', locals: { form: f, sources: sources, accountable: accountable } %>
|
||||
<% end %>
|
||||
|
||||
<%= render partial: "#{accountable.model_name.singular}_offer", locals: { form: f, offer: offer, accountable: accountable } %>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit, class: "btn btn-default", style: "margin-bottom: 20px;" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<script type="text/javascript">
|
||||
$("#select2-time").select2({
|
||||
formatNoMatches: function() {
|
||||
return "<%= j t('application.tips.user_not_found') %>";
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@ -24,10 +24,6 @@ describe TransfersController do
|
||||
}
|
||||
end
|
||||
|
||||
it 'renders the :new template' do
|
||||
expect(get :new, params).to render_template(:new)
|
||||
end
|
||||
|
||||
it 'finds the accountable' do
|
||||
get :new, params
|
||||
expect(response.body)
|
||||
@ -94,10 +90,6 @@ describe TransfersController do
|
||||
}
|
||||
end
|
||||
|
||||
it 'renders the :new template' do
|
||||
expect(get :new, params).to render_template(:new_organization)
|
||||
end
|
||||
|
||||
it 'finds the accountable' do
|
||||
get :new, params
|
||||
expect(response.body)
|
||||
|
||||
Reference in New Issue
Block a user