Commit 5c5e424d authored by jz143's avatar jz143

default icons and icon uploads

parent 24b48865
## Setup
* Install `iPhone Distribution: Duke University` certificate and private key to `System` keychain on signing server.
- Get Info > Access Control > Allow all applications to access this item
* Install ImageMagick
......@@ -81,6 +81,6 @@ class AppsController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through.
def app_params
params.require(:app).permit(:name, :description, :bundle_identifier_suffix)
params.require(:app).permit(:name, :description, :icon, :bundle_identifier_suffix)
end
end
......@@ -6,7 +6,7 @@ class App < ActiveRecord::Base
validates :bundle_identifier_suffix, format: { with: /\A[a-zA-Z\.]+\Z/, message: "only allow dots and letters" }
has_attached_file :icon, styles: { itunes: ["512x512#", :png], ios_download: ["57x57#", :png] }, default_url: "/images/appstore-icon.png"
has_attached_file :icon, styles: { itunes: ["512x512#", :png], ios_download: ["57x57#", :png] }, default_url: lambda { |image| ActionController::Base.helpers.asset_path('appstore-icon.png') }
validates_attachment :icon, content_type: { content_type: ["image/jpeg", "image/gif", "image/png"] }
......
......@@ -10,7 +10,7 @@
<div class="col-sm-6 app-details">
<div class="row">
<div class="col-xs-3 app-icon">
<%= image_tag app.icon.url, :alt => "default app logo" %>
<%= image_tag app.icon.url, :alt => "App logo" %>
</div>
<div class="col-xs-9">
<div class="caption">
......
<div id="large_infobox" class="media">
<div class="media-left">
<%= image_tag 'appstore-icon.png', :size => "100x100", :alt => "default app logo" %>
<%= image_tag @app.icon.url, :size => "100x100", :alt => "App logo" %>
</div>
<div class="media-body">
<h4 class="media-heading">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment