-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into 555_show_agreement_letter_upload_form_only_wh…
…en_accepted
- Loading branch information
Showing
25 changed files
with
248 additions
and
74 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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module EventImageUploadHelper | ||
# @return [Array] paths to all stock photos | ||
def stock_photo_paths | ||
Dir.glob('app/assets/images/stock_photos/*').map do |image| | ||
'stock_photos/' + image.split('/').last | ||
end | ||
end | ||
|
||
# Given a path returns the string stripped from all invalid chars in an id | ||
# | ||
# @param path [String] the path to be stripped | ||
# @return [String] the id | ||
def path_to_id(path) | ||
path.gsub(/[^A-Za-z0-9._-]/, '') | ||
end | ||
end |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
<div class="form-group"> | ||
<%= form.label :image, :class => 'control-label col-lg-2' %> | ||
<div class="col-lg-10"> | ||
<div class="image-buttons" data-toggle="buttons"> | ||
|
||
<% if @event.custom_image? %> | ||
<% val = @event.custom_image_url(:list_view) %> | ||
<label class="btn <%= 'active' if val == @event.image %>" style="background-image: url(<%= image_path(@event.custom_image_url(:thumb)) %>)"> | ||
<%= form.radio_button :image, val, id: path_to_id(val), autocomplete: 'off' %> | ||
</label> | ||
<% end %> | ||
<% stock_photo_paths.each do |image| %> | ||
<label class="btn <%= 'active' if image == @event.image %>" style="background-image: url(<%= image_path(image) %>)"> | ||
<%= form.radio_button :image, image, id: path_to_id(image), autocomplete: 'off' %> | ||
</label> | ||
<% end %> | ||
|
||
</div> | ||
|
||
<div class="panel panel-default m-t-1"> | ||
<div class="panel-body"> | ||
<strong><p><%= I18n.t 'events.image_upload.upload_local_file' %></p></strong> | ||
<%= form.file_field :custom_image %> | ||
<%= form.hidden_field :custom_image_cache %> | ||
<p class="help-block"><%= t 'events.errors.image_too_small' %></p> | ||
<%= form.error_span(:custom_image) %> | ||
</div> | ||
</div> | ||
<%= form.error_span(:image) %> | ||
</div> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddCustomImageToEvents < ActiveRecord::Migration | ||
def change | ||
add_column :events, :custom_image, :string | ||
end | ||
end |
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
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
Oops, something went wrong.