Skip to content

Commit

Permalink
make paragraphs on portfolio piece show pages more readable. add :def…
Browse files Browse the repository at this point in the history
…ault to whitelisted params and form for images. add url to portfolio_piece. remove contributors for now from portfolio piece show, and pull in primary technology. link to url from portfolio show page.
  • Loading branch information
WendyBeth committed Mar 22, 2015
1 parent 960c280 commit d161bab
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 10 deletions.
4 changes: 4 additions & 0 deletions app/assets/stylesheets/custom.css.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
p {
font-size: 1.2em;
}

.name-brand {
font-family: 'Dancing Script', cursive;
font-size: 2em;
Expand Down
4 changes: 4 additions & 0 deletions app/assets/stylesheets/portfolio_pieces.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@
.pp_close {
background-image: image-url("default-spite.png");
}

.btn-link {
color: white;
}
3 changes: 2 additions & 1 deletion app/controllers/images_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def update
private

def image_params
params.require(:image).permit(:portfolio_piece_id, :photo, :description)
params.require(:image).permit(:portfolio_piece_id, :photo,
:description, :default)
end

def set_portfolio_piece
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/portfolio_pieces_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def destroy

def portfolio_piece_params
params.require(:portfolio_piece).permit(:name, :client, :description,
:primary_technology)
:primary_technology, :url)
end

def set_piece
Expand Down
3 changes: 3 additions & 0 deletions app/views/images/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
%i.fa.fa-file-o
= f.input_field :description, as: :string, class: 'span4', placeholder: "Description", id: "prependedInput", size: "16"

%p
= f.input :default, as: :boolean, label: 'Default image?'

%p
.row
.span2
Expand Down
4 changes: 4 additions & 0 deletions app/views/portfolio_pieces/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
%span.add-on
%i.fa.fa-user-secret
= f.input_field :client, class: "span4", placeholder: "Client", id: "prependedInput", size: "16"
.input-prepend
%span.add-on
%i.fa.fa-globe
= f.input_field :url, class: "span4", placeholder: "URL", id: "prependedInput", size: "16"
= f.input_field :description, as: :text, class: "span6", placeholder: "description", rows: "10"
.row
.span2
Expand Down
12 changes: 5 additions & 7 deletions app/views/portfolio_pieces/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,14 @@
%h6 Client:
= @portfolio_piece.client
%li
%h6 Primary Technology:
Ruby on Rails
%li
%h6 Contributors
Other people on the project
%h6 Primary Technologies:
= @portfolio_piece.primary_technology
%li
%h6 Images
= link_to "All Photos", portfolio_piece_images_path(@portfolio_piece)
%button.btn.btn-inverse.pull-left{type: "button"}
Visit
- if @portfolio_piece.url
%button.btn.btn-inverse.pull-left{type: "button"}
= link_to "Visit", @portfolio_piece.url, target: "_blank", class: "btn-link"

- if user_signed_in?
= link_to edit_portfolio_piece_path(@portfolio_piece), class: "pull-right" do
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20150322171824_add_url_to_portfolio_pieces.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddUrlToPortfolioPieces < ActiveRecord::Migration
def change
add_column :portfolio_pieces, :url, :string
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20150322042717) do
ActiveRecord::Schema.define(version: 20150322171824) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -49,6 +49,7 @@
t.string "client"
t.text "description"
t.string "primary_technology"
t.string "url"
end

create_table "users", force: :cascade do |t|
Expand Down

0 comments on commit d161bab

Please sign in to comment.