diff --git a/app/controllers/albums_controller.rb b/app/controllers/albums_controller.rb index 7455d6e..2b8d58c 100644 --- a/app/controllers/albums_controller.rb +++ b/app/controllers/albums_controller.rb @@ -3,6 +3,11 @@ class AlbumsController < ApplicationController skip_before_filter :authenticate_user!, :only => [:index, :show] def index + add_breadcrumb t('activerecord.models.album.popular'), collections_path, :title => t('activerecord.models.album.popular') + add_breadcrumb t('activerecord.actions.create', :model => I18n.t('activerecord.models.album.single')), new_album_path, + :title => t('activerecord.actions.create', :model => I18n.t('activerecord.models.album.single')), + :li_icon => 'icon-plus-sign' + if params[:tag_id] @albums = Album.where(:conditions => [ "id IN ( SELECT DISTINCT photos.album_id FROM photos WHERE photos.id IN ( SELECT photo_id FROM photo_tags WHERE photo_tags.tag_id = :q) )", { :q => Tag.find( params[:tag_id] ).id } ]).order('title') elsif params[:q] diff --git a/app/controllers/collections_controller.rb b/app/controllers/collections_controller.rb index 18f3a58..6a9ff64 100644 --- a/app/controllers/collections_controller.rb +++ b/app/controllers/collections_controller.rb @@ -36,8 +36,10 @@ class CollectionsController < ApplicationController def new @collection = Collection.new - add_breadcrumb t('activerecord.models.collection.other').mb_chars.capitalize.to_s, collections_path, :title => t('activerecord.models.collection.other') - add_breadcrumb t('activerecord.actions.new', :model => I18n.t('activerecord.models.collection.one')), new_collection_path, :title => t('activerecord.actions.new') + add_breadcrumb t('activerecord.models.collection.other').mb_chars.capitalize.to_s, collections_path, + :title => t('activerecord.models.collection.other') + add_breadcrumb t('activerecord.actions.new', :model => I18n.t('activerecord.models.collection.one')), new_collection_path, + :title => t('activerecord.actions.new', :model => I18n.t('activerecord.models.collection.one')) end def create diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 863380d..0b7a433 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -37,9 +37,9 @@ class PhotosController < ApplicationController def untouched if params[:album_id] @album = Album.find( params[:album_id]) - @photos = @album.photos.untouched + @photos = @album.photos.untouched.page(@page).per(@per_page) else - @photos = Photo.untouched() + @photos = Photo.untouched().page(@page).per(@per_page) end respond_to do |format| format.html diff --git a/app/views/albums/_form.html.erb b/app/views/albums/_form.html.erb index 66a9827..9c06a43 100644 --- a/app/views/albums/_form.html.erb +++ b/app/views/albums/_form.html.erb @@ -5,26 +5,59 @@
-<%= hidden_field_tag :all_tags, "'#{Tag.find(:all).map { |tag| tag.title }.join('\',\'')}'" %> -<%= hidden_field_tag :collection_id, params[:collection_id] %> -<%= form.hidden_field :id %> -<%= form.hidden_field :latitude %> -<%= form.hidden_field :longitude %> +
+ <%= hidden_field_tag :all_tags, "'#{Tag.all.map { |tag| tag.title }.join('\',\'')}'" %> + <%= hidden_field_tag :collection_id, params[:collection_id] %> + <%= form.hidden_field :id %> + <%= form.hidden_field :latitude %> + <%= form.hidden_field :longitude %> -<%= form.label :title, :Title, {:class => 'big'} %>
-<%= form.text_field :title, {:class => 'big'} %>
+
+ <%= form.label :title, t('activerecord.models.album.attributes.title'), {:class => 'control-label'} %> +
+ <%= form.text_field :title, {:class => 'input-xlarge'} %> +
+
-<%= form.label :description %>
-<%= form.text_area :description %>
+
+ <%= form.label :description, t('activerecord.models.album.attributes.description'), {:class => 'control-label'} %> +
+ <%= form.text_area :description, {:class => 'input-xlarge', :rows => 5} %> +
+
-<%= form.label :address %>
-<%= form.text_area :address, { :rows => 3} %>
+
+ <%= form.label :public, t('activerecord.models.album.attributes.visible'), {:class => 'control-label'} %> +
+ +
+
-<%= form.label :note %>
-<%= form.text_area :note %>
+
+ <%= form.label :address, t('activerecord.models.album.attributes.address'), {:class => 'control-label'} %> +
+ <%= form.text_area :address, {:class => 'input-xlarge', :rows => 5} %> +
+
-<%= form.label :tags %>
-<%= form.text_field :tags, { :autocomplete => "off", :class => 'tag_list', :value => (@album.tags.map{|tag|tag.title}.join(" ") unless @album.tags.nil?) } %>
+
+ <%= form.label :note, t('activerecord.models.album.attributes.note'), {:class => 'control-label'} %> +
+ <%= form.text_area :note, {:class => 'input-xlarge', :rows => 5} %> +
+
-
-Contains: <%= @album.photos.count %> photos
\ No newline at end of file + +
+ <%= form.label :tags, t('activerecord.models.album.attributes.tags'), {:class => 'control-label'} %> +
+ <%= form.text_field :tags, {:class => 'input-xlarge', :autocomplete => "off", :class => 'tag_list', :value => (@album.tags.map{|tag|tag.title}.join(" ") unless @album.tags.nil?) } %> +
+
+ + +
+ Contains: <%= @album.photos.count %> photos
+
\ No newline at end of file diff --git a/app/views/albums/new.html.erb b/app/views/albums/new.html.erb index 34d14cd..23561fe 100644 --- a/app/views/albums/new.html.erb +++ b/app/views/albums/new.html.erb @@ -1,8 +1,9 @@ -

New Album

- -<%= form_for @album do |f| %> - <%= f.error_messages %> - <%= render :partial => "form", :object => f %> - <%= f.submit "Create" %> +<%= form_for @album, :html => {:class => 'form-horizontal'} do |f| %> + <%= t('activerecord.actions.new', :model => I18n.t('activerecord.models.album.one')) %> + <%= f.error_messages %> + <%= render :partial => "form", :object => f %> +
+ <%= f.button "Create", :class => 'btn btn-primary btn-large' %> +
<% end %> \ No newline at end of file diff --git a/app/views/collections/_form.html.erb b/app/views/collections/_form.html.erb index f1eaeb1..3080ef4 100644 --- a/app/views/collections/_form.html.erb +++ b/app/views/collections/_form.html.erb @@ -13,6 +13,15 @@ +
+ <%= form.label :public, t('activerecord.models.collection.attributes.visible'), {:class => 'control-label'} %> +
+ +
+
+ <% unless @collection.albums.empty? %> <%= form.label :albums %> <% @collection.albums.each do |album| %> diff --git a/config/locales/ru.yml b/config/locales/ru.yml index b264299..4652e02 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -1,5 +1,6 @@ ru: home_page: "Главная" + make_visible_for_all: "Сделать видимым для всех" views: pagination: first: "« первая" @@ -9,6 +10,11 @@ ru: truncate: "..." activerecord: + actions: + new: "Новый(ая) %{model}" + create: "Создать %{model}" + update: "Обновить %{model}" + destroy: "Удалить %{model}" models: user: Пользователь collection: @@ -17,15 +23,28 @@ ru: many: "коллекций" other: "коллекции" single: "коллекцию" - popular: Полулярные коллекции - album: Альбом - photo: Фотография - photo_tag: Тег - actions: - new: "Новая %{model}" - create: "Создать %{model}" - update: "Обновить %{model}" - destroy: "Удалить %{model}" + popular: "Полулярные коллекции" + attributes: + title: "Заголовок" + description: "Описание" + visible: "Видимость" + album: + one: "альбом" + few: "альбомов" + many: "альбомов" + other: "альбомы" + single: "альбом" + popular: "Полулярные альбомы" + attributes: + title: "Заголовок" + description: "Описание" + visible: "Видимость" + address: "Адрес" + note: "Примечание" + tags: "Теги" + + photo: "Фотография" + photo_tag: "Тег" albums_counter: one: "Содержит %{count} альбом"