Skip to content

Commit

Permalink
edit on flickr
Browse files Browse the repository at this point in the history
  • Loading branch information
stereosupersonic committed Apr 2, 2015
1 parent 401423f commit 6ea19f5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/controllers/admin/albums_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ def set_album

# Only allow a trusted parameter "white list" through.
def album_params
params.require(:album).permit(:flickr_id, :flickr_description, :flickr_title, :visible, :created_at)
params.require(:album).permit(:flickr_description, :flickr_title, :visible, :created_at)
end
end
11 changes: 8 additions & 3 deletions app/views/admin/albums/_form.html.haml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
= info_button "https://www.flickr.com/photos/organize/?start_tab=one_set#{@album.flickr_id}", "edit on Flickr"
= button_with_icon 'Neu von Flickr laden', reload_from_flickr_admin_album_path(@album), 'repeat', :method => :put

%br
%h3= "flickr_id: #{@album.flickr_id}"
= simple_form_for([:admin, @album]) do |f|
= f.error_notification

- (Album.attribute_names - ['id','visible', 'created_at', 'updated_at', 'slug']).each do |attr_name|
= f.input attr_name
= f.input :flickr_title
= f.input :flickr_description
= f.input :visible, :as => :boolean, :wrapper => :inline_checkbox
= f.input :created_at, :as => :bootstrap_datepicker
%br.clear
= save_button
= cancel_button :back
= button_with_icon 'Neu von Flickr laden', reload_from_flickr_admin_album_path(@album), 'repeat', :method => :put

2 changes: 2 additions & 0 deletions app/views/admin/albums/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
%table.table.table-bordered.table-striped.table-hover
%tr
%th Name
%th Beschreibung
%th Sichtbar
%th Anzahl Bilder
%th Datum
Expand All @@ -16,6 +17,7 @@
- @albums.each do |album|
%tr
%td= link_to album.flickr_title, [:admin, album]
%td= truncate album.flickr_description
%td= boolean_value album.visible
%td= album.photos.count
%td= I18n.l album.created_at, :format => "%B %Y"
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/albums/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
%li= link_to 'Administration', admin_root_path
%li= link_to 'Albums', admin_albums_path
%li.strong= @album.flickr_title

= show_button seo_album_path(@album.collection, @album), "Bilder"
- Album.attribute_names.each do |attr_name|
%p
%b= attr_name
Expand Down
2 changes: 1 addition & 1 deletion app/views/albums/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
%i.fa.fa-edit
%br
%br.clear

%h4= @album.flickr_description if @album.flickr_description.present?
- cache([@album,current_role]) do
= render 'photos/photos', :photos => @album.photos

0 comments on commit 6ea19f5

Please sign in to comment.