-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix(Promotion Admin): Improve promotion activation form
This makes use of the previously defined methods to make the promotion activation form more user-friendly and add some features: - Activation is now a bootstrap menu - Only one option can ever be edited - Reintroduces feature where a promotion code batch is created with the promotion
- Loading branch information
Showing
4 changed files
with
82 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
...s/lib/views/backend/solidus_promotions/admin/promotion_code_batches/_form_fields.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
<div class="form-group"> | ||
<%= batch.label :base_code, class: "required" %> | ||
<%= batch.text_field :base_code, class: "fullwidth", required: true %> | ||
<%= batch.text_field :base_code, class: "fullwidth #{'enable' if promotion.can_change_codes?}", required: true, disabled: disabled %> | ||
</div> | ||
<div class="form-group"> | ||
<%= batch.label :number_of_codes, class: "required" %> | ||
<%= batch.number_field :number_of_codes, class: "fullwidth", min: 1, required: true %> | ||
<%= batch.number_field :number_of_codes, class: "fullwidth #{'enable' if promotion.can_change_codes?}", min: 1, required: true, disabled: disabled %> | ||
</div> | ||
<div class="form-group"> | ||
<%= batch.label :join_characters %> | ||
<%= batch.text_field :join_characters, class: "fullwidth" %> | ||
<%= batch.text_field :join_characters, class: "fullwidth #{'enable' if promotion.can_change_codes?}", disabled: disabled %> | ||
</div> | ||
<% unless promotion_id %> | ||
<div class="form-group"> | ||
<%= f.label :per_code_usage_limit %> | ||
<%= f.text_field :per_code_usage_limit, class: "fullwidth" %> | ||
<%= f.text_field :per_code_usage_limit, class: "fullwidth #{'enable' if promotion.can_change_codes?}", disabled: disabled %> | ||
</div> | ||
<% end %> | ||
<div class="form-group"> | ||
<%= batch.label :email %> | ||
<%= batch.text_field :email, class: "fullwidth" %> | ||
<%= batch.text_field :email, class: "fullwidth #{'enable' if promotion.can_change_codes?}", disabled: disabled %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters