Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/campaigns_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def log_errors(campaign)
end

def campaign_params
params.require(:campaign).permit(:repository_id, :receiving_wallet_id, :title, :description, :contribution_cadence).tap do |whitelisted|
params.require(:campaign).permit(:repository_id, :receiving_wallet_id, :title, :description).tap do |whitelisted|
whitelisted[:accepted_currencies] = params[:campaign][:accepted_currencies].is_a?(String) ? params[:campaign][:accepted_currencies].split(',') : params[:campaign][:accepted_currencies]
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/contributions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ def create
private

def contributions_params
params.require(:contribution).permit(:contribution_cadence, :repo_identifier, :receiving_wallet_id, accepted_currencies: [])
params.require(:contribution).permit(:repo_identifier, :receiving_wallet_id, accepted_currencies: [])
end
end
6 changes: 0 additions & 6 deletions app/views/campaigns/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,6 @@
</div>
<% end %>
</div>
<div class="mt-4">
<div class="mt-4">
<%= form.label :contribution_cadence, 'Contribution Cadence', class: "block text-gray-700 text-sm font-bold mb-2" %>
<%= form.select :contribution_cadence, ['both', 'recurring', 'one-time'], {}, {class: "shadow border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"} %>
</div>
</div>
<%= form.submit (@campaign.new_record? ? 'Create Campaign' : 'Update Campaign'), class: "bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline" %>
<% end %>
</div>
2 changes: 0 additions & 2 deletions app/views/campaigns/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<th class="pb-4 pt-6 px-2 bg-gray-100">Tier</th>
<th class="pb-4 pt-6 px-2 bg-gray-100">Amount</th>
<th class="pb-4 pt-6 px-2 bg-gray-100">Curency</th>
<th class="pb-4 pt-6 px-2 bg-gray-100">Cadence</th>
<th class="pb-4 pt-6 px-2 bg-gray-100">Actions</th>
</tr>
</thead>
Expand All @@ -26,7 +25,6 @@
<td class="px-2 py-5 border-b border-gray-200 bg-white text-sm"><%= campaign.tier_name %></td>
<td class="px-2 py-5 border-b border-gray-200 bg-white text-sm"><%= number_to_currency(campaign.tier_amount) %></td>
<td class="px-2 py-5 border-b border-gray-200 bg-white text-sm"><%= campaign.accepted_currencies %></td>
<td class="px-2 py-5 border-b border-gray-200 bg-white text-sm"><%= campaign.contribution_cadence %></td>
<td class="px-2 py-5 border-b border-gray-200 bg-white text-sm">
<%= link_to 'Show', user_campaign_path(campaign.user, campaign), class: "text-blue-600 hover:text-blue-900" %>
<% if campaign.user == current_user %>
Expand Down
9 changes: 1 addition & 8 deletions app/views/contributions/_new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,9 @@
<div class="mb-4">
<strong>Support Campaign:</strong>
</div>
<div class="mb-4">
<select class="block w-full p-2 border rounded" data-contribution-target="cadence">
<option>One-Time</option>
<option>Monthly</option>
<option>Yearly</option>
</select>
</div>
<div class="modal hidden" data-contribution-target="customAmountModal">
<div class="modal-content">
<input type="number" min="0" step="1" placeholder="Enter amount" data-contribution-target="customAmountInput">
<input autocomplete="off" type="number" min="0" step="1" placeholder="Enter amount" data-contribution-target="customAmountInput">
<button data-action="click->contribution#confirmCustomAmount">OK</button>
<button data-action="click->contribution#cancelCustomAmount">Cancel</button>
</div>
Expand Down