commit 0037553141938d69dfd95e282af42c7821144f03
Author: Kushnir Andrei
Date: Sat Sep 6 23:23:38 2008 +0300
new feature: Meetings
diff --git a/app/controllers/application.rb b/app/controllers/application.rb
index c6fc766..a0cea38 100644
--- a/app/controllers/application.rb
+++ b/app/controllers/application.rb
@@ -96,6 +96,10 @@ protected
def is_editor?
logged_in? && current_user.user_status >= User::STATUS::EDITOR
end
+
+ def is_obj_owner? obj
+ logged_in? && (obj.user_id == current_user.id)
+ end
def msg_private_network_on?
current_user.char.msg_private_network_only == true
diff --git a/app/controllers/meetings_controller.rb b/app/controllers/meetings_controller.rb
new file mode 100644
index 0000000..a033fba
--- /dev/null
+++ b/app/controllers/meetings_controller.rb
@@ -0,0 +1,241 @@
+class MeetingsController < ApplicationController
+ before_filter :login_required, :except => [:index]
+ helper :calendar
+ # GET /meetings
+ # GET /meetings.xml
+ def index
+ @title = "Встречи - Все записи"
+ @pages, @meetings = paginate :meetings,
+ :order => 'start_at desc', :per_page => 10
+
+ @right_part = :meetings_calendar
+ prepare_comment_count(@meetings, Comment::WHERE::MEETING)
+
+ respond_to do |format|
+ format.html # index.html.erb
+ format.xml { render :xml => @meetings }
+ end
+ end
+
+ def my_meetings
+ @right_part = :meetings_calendar
+ @title = "Мои Встречи"
+ @pages, @meetings = paginate :meetings,
+ :conditions => 'user_id=' + current_user.id.to_s,
+ :order => 'start_at desc', :per_page => 10
+ prepare_comment_count(@meetings, Comment::WHERE::MEETING)
+ end
+
+ # GET /meetings/1
+ # GET /meetings/1.xml
+ def show
+ @right_part = :meetings_calendar
+ @meeting = Meeting.find(params[:id])
+ @current_participant = Participant.find :first, :conditions => ['user_id = ? and meeting_id = ?', current_user.id, @meeting.id]
+ @participants = @meeting.participants.find :all, :order => 'created_at asc'
+ #@participants = Participant.find(:all, :conditions => 'meeting_id=' + @meeting.id.to_s, :order => 'start_at asc')
+ paginate_comments @meeting, Comment::WHERE::MEETING
+ respond_to do |format|
+ format.html # show.html.erb
+ format.xml { render :xml => @meeting }
+ end
+ end
+
+ def journal
+ redirect_to meetings_path
+ end
+
+ # GET /meetings/new
+ # GET /meetings/new.xml
+ def new
+ @meeting = Meeting.new
+ @meeting_page == "event_info"
+ @title = "Новая встреча"
+ respond_to do |format|
+ format.html # new.html.erb
+ format.xml { render :xml => @meeting }
+ end
+ end
+
+ # GET /meetings/1/edit
+ def edit
+ @meeting = Meeting.find(params[:id])
+ @title = "Редактировать мероприятие: "+ @meeting.name.to_s
+ @meeting_page = "edit_info"
+ end
+
+ # POST /meetings
+ # POST /meetings.xml
+ def create
+ @meeting = Meeting.new(params[:meeting])
+ @meeting.user_id = current_user.id
+ respond_to do |format|
+ if @meeting.save
+ @participant = Participant.new( :user_id => current_user.id)
+ @participant.status = Participant::PLAN::YES
+ @participant.join_meeting @meeting
+ flash[:notice] = 'Информация о Вашей встрече была сохранена.'
+ format.html { redirect_to(meeting_path(:id => @meeting)) }
+ format.xml { render :xml => @meeting, :status => :created, :location => @meeting }
+ else
+ format.html { render :action => "new" }
+ format.xml { render :xml => @meeting.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # PUT /meetings/1
+ # PUT /meetings/1.xml
+ def update
+ @meeting = Meeting.find(params[:id])
+# @meeting.user_id == current_user.id || is_moderator?
+ if is_obj_owner? @meeting
+ respond_to do |format|
+ if @meeting.update_attributes(params[:meeting])
+ @meeting_page = "edit_info"
+ flash[:notice] = 'Информация о Вашей встрече была обновлена.'
+ format.html { render :action => "edit" }
+ format.xml { head :ok }
+ else
+ @meeting_page = "edit_info"
+ format.html { render :action => "edit" }
+ format.xml { render :xml => @meeting.errors, :status => :unprocessable_entity }
+ end
+ end
+ else
+ render :text => 'no'
+ end
+ end
+
+ def add_comment
+ @meeting = Meeting.find(params[:id])
+ add_obj_comment @meeting, Comment::WHERE::MEETING
+ redirect_to :action => "show", :id => @meeting.id
+ end
+
+ def change_participant_status
+ @meeting = Meeting.find(params[:id])
+ @participant = Participant.find :first,
+ :conditions => ['meeting_id = ? and user_id = ?', @meeting.id, current_user.id]
+ if @participant
+ @participant.status = params[:current_participant][:status]
+ @participant.save
+ redirect_to :action => "show", :id => @meeting.id
+ else
+ @meeting = Meeting.find(params[:id])
+ @participant = Participant.new( :user_id => current_user.id)
+ @participant.status = params[:current_participant][:status]
+ @participant.join_meeting @meeting
+ redirect_to :action => "show", :id => @meeting.id
+ end
+ end
+
+ def edit_settings
+ @title = "Настроить параметры встречи"
+ @meeting = Meeting.find(params[:id])
+ @meeting_page = "edit_settings"
+ render :action => 'edit'
+ end
+
+
+ def add_guests
+ @title = "Пригласить гостей "
+ @meeting = Meeting.find(params[:id])
+ @my_friends = MyFriend.find :all, :conditions => ['user_id = ?', current_user.id]
+
+ @meeting_page = "edit_guests"
+ render :action => 'edit'
+ end
+
+ def add_photos
+ @photo_album = PhotoAlbum.new
+ @meeting = Meeting.find(params[:id])
+ @participant = Participant.find_by_user_id(current_user.id)
+ if request.post?
+ @photo_album.attributes = params[:photo_album]
+ @photo_album.user_id = current_user.id
+# category_id = 8 for "Встречи"
+ @photo_album.category_id = 8
+ @photo_album.location = @meeting.location
+ if @photo_album.save
+ save_photos
+ @participant.update_participants_photo_album(@photo_album, @meeting)
+ flash[:notice] = 'Альбом был успешно сохранен.'._
+ redirect_to photo_album_url(:id => @photo_album)
+ else
+ render :action => 'add_photos'
+ end
+ end
+ end
+
+
+ def show_photos
+ @title = "Фото"._
+ cond = ['1 = 1']
+ @title1 = ''
+ @category_id = 8
+
+ if UserPhoto::CATEGORIES.has_key?(@category_id) && @category_id > 0
+ cond[0] += ' AND photo_albums.category_id = ?'
+ cond << @category_id
+ end
+
+ PhotoAlbum.public_scope do
+ @pages, @photos = paginate :photo_albums,
+ :conditions => cond,
+ :include => [:user, :cover_photo],
+ :order => 'photo_albums.taken_at desc', :per_page => 24
+ end
+ render :template => 'meetings/photos'
+ end
+
+
+ # DELETE /meetings/1
+ # DELETE /meetings/1.xml
+ def delete_meeting
+ @meeting = Meeting.find(params[:id])
+ @participants = Participant.find(:all, :conditions => 'meeting_id=' + @meeting.id.to_s)
+ if is_obj_owner?(@meeting) || is_moderator?
+ @meeting.destroy
+ for participant in @participants
+ participant.destroy
+ end
+ respond_to do |format|
+ format.html { redirect_to :action => :my_meetings }
+ format.xml { head :ok }
+ end
+ else
+ render :text => 'no'
+ end
+ end
+
+private
+
+ def save_photos
+ 1.upto(5) do |i|
+ if !params["photo#{i}"].blank?
+ @photo = UserPhoto.new params["photo#{i}"]
+ @photo.user_id = current_user.id
+ @photo.category_id = 0
+ @photo.photo_album = @photo_album
+ @photo.moderate_status = UserPhoto::MODERATE_STATUS::AUTO_ACCEPTED if special_photo_user(current_user)
+
+ if @photo.save
+ flash[:notice] = "Фотографии добавлены"._
+ else
+ logger.debug "c-type:#{@photo.content_type}"
+ end
+ end
+ end
+ end
+
+ def send_checked_guests_notification(guest_id_array)
+ checked_guests = []
+ checked_params = params[:guest_list] || []
+ for check_box_id in checked_params
+ guest = User.find(check_box_id)
+ end
+ return checked_guests
+ end
+
+end
diff --git a/app/helpers/meetings_helper.rb b/app/helpers/meetings_helper.rb
new file mode 100644
index 0000000..de8cd78
--- /dev/null
+++ b/app/helpers/meetings_helper.rb
@@ -0,0 +1,11 @@
+module MeetingsHelper
+
+ def is_active_tab? current_action
+ if current_page?(:action => current_action)
+ "activetab"
+ else
+ "inactivetab"
+ end
+ end
+
+end
diff --git a/app/models/comment.rb b/app/models/comment.rb
index d6d9357..6a2f3c3 100644
--- a/app/models/comment.rb
+++ b/app/models/comment.rb
@@ -43,6 +43,7 @@ class Comment < ActiveRecord::Base
VIDEO_LINK, PAID_NEWS = 5, 6
SURVEY = 7
HATE_CASE = 8
+ MEETING= 9
end
def relations
@@ -54,7 +55,8 @@ class Comment < ActiveRecord::Base
WHERE::VIDEO_LINK => [Event::OBJ_TYPE::VIDEO_LINK, VideoLink],
WHERE::PAID_NEWS => [Event::OBJ_TYPE::PAID_NEWS, PaidNews],
WHERE::SURVEY => [Event::OBJ_TYPE::SURVEY, Survey],
- WHERE::HATE_CASE => [Event::OBJ_TYPE::HATE_CASE, HateCase]
+ WHERE::HATE_CASE => [Event::OBJ_TYPE::HATE_CASE, HateCase],
+ WHERE::MEETING => [Event::OBJ_TYPE::MEETING, Meeting]
}
end
end
diff --git a/app/models/event.rb b/app/models/event.rb
index 467449b..68bb84e 100644
--- a/app/models/event.rb
+++ b/app/models/event.rb
@@ -12,6 +12,7 @@ class Event < ActiveRecord::Base
PAID_NEWS = 100
BIRTHDAY = 110
HATE_CASE = 120
+ MEETING = 130
end
OBJ_TYPE_H = { OBJ_TYPE::GROUP => "Клану",
@@ -20,7 +21,8 @@ class Event < ActiveRecord::Base
OBJ_TYPE::NEWS => "Новости",
OBJ_TYPE::SURVEY => "Опросу",
OBJ_TYPE::HATE_CASE => "Заявка",
- OBJ_TYPE::NOTE => "Дневнику"
+ OBJ_TYPE::NOTE => "Дневнику",
+ OBJ_TYPE::MEETING => "Встрече"
}
class TYPE
diff --git a/app/models/meeting.rb b/app/models/meeting.rb
new file mode 100644
index 0000000..cc64bd5
--- /dev/null
+++ b/app/models/meeting.rb
@@ -0,0 +1,13 @@
+class Meeting < ActiveRecord::Base
+ has_many :comments, :foreign_key => '_for', :conditions => '_where = ' + Comment::WHERE::MEETING.to_s,
+ :dependent => :delete_all, :order => 'created_at'
+
+ belongs_to :user
+ has_many :participants
+ validates_presence_of :name, :location, :city, :description, :start_at
+
+ def has_participant? user
+ Participant.find :first, :conditions => ['meeting_id=? and user_id=?', self.id, user.id]
+ end
+
+end
diff --git a/app/models/participant.rb b/app/models/participant.rb
new file mode 100644
index 0000000..c749d6c
--- /dev/null
+++ b/app/models/participant.rb
@@ -0,0 +1,49 @@
+class Participant < ActiveRecord::Base
+ has_many :meetings
+ has_many :photo_albums
+ belongs_to :user
+ validates_presence_of :user_id, :meeting_id
+# validates_uniqueness_of :user_id, :scope => [:photo_album_id]
+
+ def join_meeting meeting
+ self.meeting_id = meeting.id
+ self.save
+ end
+
+ def is_participant? meeting
+ if Participant.find_by_id(current_user.id, :conditions => 'meeting_id=' + meeting.id.to_s)
+ true
+ else
+ false
+ end
+ end
+
+ def update_participants_photo_album(album, meeting)
+ p = Participant.find_by_user_id(self.user_id,:conditions => "photo_album_id is null")
+ if !p.nil?
+ self.photo_album_id = album.id
+ self.save
+ elsif p.nil?
+ Participant.new(:user_id => self.user_id, :photo_album_id => album.id, :meeting_id => meeting.id)
+ self.save
+ end
+ end
+
+ class PLAN
+ NO = 0
+ YES = 1
+ MAYBE = 2
+ PENDING = 3
+ end
+
+ PLAN_A = [
+ ["пойду", PLAN::YES],
+ ["не пойду", PLAN::NO],
+ ["возможно пойду", PLAN::MAYBE],
+ ["еще не ответил", PLAN::PENDING]
+ ]
+
+ PLAN_H = PLAN_A.to_hash2
+
+end
+
diff --git a/app/models/user.rb b/app/models/user.rb
index 746cc2d..7708379 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -70,6 +70,7 @@ class User < ActiveRecord::Base
has_many :surveys, :dependent => :delete_all
has_many :notifications, :dependent => :delete_all
has_many :sent_notifications, :class_name => 'Notification', :foreign_key => 'sender_id', :dependent => :delete_all
+ has_many :meetings
def is_seller?
user_caracter.is_seller? == true
diff --git a/app/models/user_photo.rb b/app/models/user_photo.rb
index 870b3bd..761febd 100644
--- a/app/models/user_photo.rb
+++ b/app/models/user_photo.rb
@@ -136,6 +136,7 @@ class UserPhoto < ActiveRecord::Base
["Май Фамили", 5],
["Отдыхаем", 6],
["Афтор Жжжооот", 7],
+ ["Встречи", 8]
]
CATEGORIES = to_hash(CATEGORIES_A)
diff --git a/app/views/layouts/_top_menu.rhtml b/app/views/layouts/_top_menu.rhtml
index 71e1eeb..e1c591c 100644
--- a/app/views/layouts/_top_menu.rhtml
+++ b/app/views/layouts/_top_menu.rhtml
@@ -9,6 +9,7 @@
<%= link_to "Фотки"._, all_photos_path %>
<%= link_to "Видео"._, videos_path %>
<%= link_to "Кланы"._, search_groups_path %>
+ <%= link_to "Встречи"._, meetings_path %>
<%= link_to "Маркет"._, market_path %>
<%= link_to "Поиск"._, search_what_path %>
diff --git a/app/views/layouts/_user_panel.rhtml b/app/views/layouts/_user_panel.rhtml
index de38e3f..2d0e83b 100644
--- a/app/views/layouts/_user_panel.rhtml
+++ b/app/views/layouts/_user_panel.rhtml
@@ -35,6 +35,12 @@
<%=link_to 'Видео'._, {:controller => "/my_videos"}, :class => 'user_links' %>
+
+
<%= my_panel_icon('klan.gif') %>
diff --git a/app/views/layouts/application.rhtml b/app/views/layouts/application.rhtml
index 79794c4..538005a 100644
--- a/app/views/layouts/application.rhtml
+++ b/app/views/layouts/application.rhtml
@@ -114,6 +114,8 @@ if flash.has_key?(:error) %>
<% if @right_part == :calendar %>
<%= render :partial => 'users/journal_calendar' %>
+ <% elsif @right_part == :meetings_calendar %>
+ <%= render :partial => 'meetings/meeting_calendar' %>
<% elsif @right_part == :photos %>
<%= render :partial => 'users/photos_calendar' %>
<% elsif @right_part == :album %>
diff --git a/app/views/meetings/_edit_guests.html.erb b/app/views/meetings/_edit_guests.html.erb
new file mode 100644
index 0000000..cdcf899
--- /dev/null
+++ b/app/views/meetings/_edit_guests.html.erb
@@ -0,0 +1,30 @@
+<%= error_messages_for :meeting %>
+<% form_for(:meeting, :url => meeting_path(:id => @meeting),
+ :html => { :method => :put }) do |f| %>
+
+
+
+
+ Пригласить друзей :
+ <%= text_field :name, :class => "inputtext"%>
+
+
+
+
+ <% for my_friend in @my_friends %>
+ <%= check_box_tag('guest_list[]', my_friend.friend_id,
+ @my_friends.collect {|obj| obj.id}.include?(my_friend.friend_id), :class => "inputcheckbox")%>
+ <%= link_to_profile(my_friend.friend) %>
+ <% end %>
+
+
+
+
+ <%= f.submit "Отправить приглашения", :class => "inputbutton" %>
+ <%= submit_tag "Вернутся к событию", :class => "inputbutton ", :id => @meeting.id %>
+
+
+
+
+
+<% end %>
diff --git a/app/views/meetings/_edit_info.html.erb b/app/views/meetings/_edit_info.html.erb
new file mode 100644
index 0000000..b25b4f6
--- /dev/null
+++ b/app/views/meetings/_edit_info.html.erb
@@ -0,0 +1,43 @@
+<%= error_messages_for :meeting %>
+<% form_for(:meeting, :url => meeting_path(:id => @meeting),
+ :html => { :method => :put }) do |f| %>
+
+
+
+ Название мероприятия:(обязательно)
+ <%= f.text_field :name, :class => "inputtext" %>
+
+
+
+
+ Описание:
+ <%= f.text_area :description %>
+
+ Время начала:
+ <%= f.datetime_select :start_at %>
+
+ Время завершения:
+ <%= f.datetime_select :end_at %>
+
+
+
+ Место проведения:(обязательно)
+ <%= f.text_field :location, :class => "inputtext" %>
+
+ Город:(обязательно)
+ <%= f.text_field :city, :class => "inputtext" %>
+
+
+
+ E-mail:
+ <%= f.text_field :email, :class => "inputtext" %>
+
+
+ <%= f.submit "Сохранить изменения", :class => "inputbutton" %>
+ <%= submit_tag "Вернутся к событию", :class => "inputbutton ", :id => @meeting.id %>
+
+
+
+
+
+<% end %>
\ No newline at end of file
diff --git a/app/views/meetings/_edit_settings.html.erb b/app/views/meetings/_edit_settings.html.erb
new file mode 100644
index 0000000..a496487
--- /dev/null
+++ b/app/views/meetings/_edit_settings.html.erb
@@ -0,0 +1,6 @@
+<%#
+# To change this template, choose Tools | Templates
+# and open the template in the editor.
+%>
+
+<%= "_customize.html" %>
diff --git a/app/views/meetings/_form.html.erb b/app/views/meetings/_form.html.erb
new file mode 100644
index 0000000..59a9de8
--- /dev/null
+++ b/app/views/meetings/_form.html.erb
@@ -0,0 +1,43 @@
+<%= error_messages_for :meeting %>
+
+<% form_for(@meeting) do |f| %>
+
+
+
+ Название мероприятия:(обязательно)
+ <%= f.text_field :name, :class => "inputtext" %>
+
+
+
+
+ Описание:
+ <%= f.text_area :description %>
+
+ Время начала:
+ <%= f.datetime_select :start_at %>
+
+ Время завершения:
+ <%= f.datetime_select :end_at %>
+
+
+
+ Место проведения:(обязательно)
+ <%= f.text_field :location, :class => "inputtext" %>
+
+ Город:(обязательно)
+ <%= f.text_field :city, :class => "inputtext" %>
+
+
+
+ E-mail:
+ <%= f.text_field :email, :class => "inputtext" %>
+
+
+ <%= f.submit "Сохранить изменения", :class => "inputbutton" %>
+ <%= submit_tag "Отмена", :class => "inputbutton ", :id => @meeting.id %>
+
+
+
+
+<%= link_to 'Back', meetings_path %>
+<% end %>
diff --git a/app/views/meetings/_meeting_calendar.rhtml b/app/views/meetings/_meeting_calendar.rhtml
new file mode 100644
index 0000000..ccc46ea
--- /dev/null
+++ b/app/views/meetings/_meeting_calendar.rhtml
@@ -0,0 +1,24 @@
+<%= box_header %>
+
+ <% year = Time.now.year
+ month = Time.now.month
+ if !params[:month].nil?
+ a = params[:month].split(/\_/)
+ if a.size > 0
+ year = a[0].to_i
+ month = a[1].to_i
+ end
+ end %>
+ <%= calendar(:year => year, :month => month) do |date|
+ attr = {:valign => 'middle'}
+ attr[:class] = 'chosen_date' if date == @chosen_date
+ [link_to_if(date <= Time.now.to_date, date.day, {:action => 'journal', :month => "#{year}_#{month}", :date => date}), attr]
+ end %>
+ <% if year < Time.now.year || (year == Time.now.year && month < Time.now.month)%>
+ <%= link_to CalendarHelper::MONTHNAMES[month == 12 ? 1:month+1], :action => 'journal', :controller => '/meetings', :month => "#{month == 12 ? year+1:year}_#{month == 12 ? 1:month+1}" %>
+ <% end %>
+ <%= link_to CalendarHelper::MONTHNAMES[month == 1 ? 12:month-1], :action => 'journal', :controller => '/meetings', :month => "#{month == 1 ? year-1:year}_#{month == 1 ? 12:month-1}" %>
+
+<%= box_footer %>
+
+
diff --git a/app/views/meetings/_meetings.html.erb b/app/views/meetings/_meetings.html.erb
new file mode 100644
index 0000000..7a80ff4
--- /dev/null
+++ b/app/views/meetings/_meetings.html.erb
@@ -0,0 +1,49 @@
+» <%= @title %>
+
+<% for meeting in @meetings %>
+
+
<%= meeting.start_at.to_s(:long) %>
+
+
+
+
+
+
+
+
+
+ <%= link_to truncate(format_message(meeting.description),60) , :action => "show", :id => meeting %>
+ Организатор:
+ <%=link_to_profile meeting.user %>
+
+ Категория:
+ Поездки -
+ Поездка на природу
+
+ Где:
+ <%= link_to meeting.location , :action => "show", :id => meeting %>
+
+ Когда:
+ <%= meeting.start_at.to_s(:long) %> по <%= meeting.end_at.to_s(:long) %>
+
+
+
+
+
+ <% if meeting.user_id == current_user.id || is_moderator? %>
+ <%= link_to 'Редактировать событие', edit_meeting_path(:id => meeting) %>
+ <%=link_to "Отменить встречу", :action => "delete_meeting", :id => meeting.id, :confirm => 'Really?' %>
+ <% end %>
+
+
+
+
+
+
+
+ <% end %>
+<%= pagination_div(@pages, params) %>
\ No newline at end of file
diff --git a/app/views/meetings/_participants.html.erb b/app/views/meetings/_participants.html.erb
new file mode 100644
index 0000000..415c146
--- /dev/null
+++ b/app/views/meetings/_participants.html.erb
@@ -0,0 +1,8 @@
+ Участники
+<% for participant in @participants %>
+<%= link_to_profile participant.user%>
+<% end %>
+
+<% if @participants.blank? %>
+Пока что нет участников
+<% end %>
diff --git a/app/views/meetings/_photos_form.html.erb b/app/views/meetings/_photos_form.html.erb
new file mode 100644
index 0000000..42b6ad6
--- /dev/null
+++ b/app/views/meetings/_photos_form.html.erb
@@ -0,0 +1,19 @@
+<%= error_messages_for 'photo_album' %>
+
+
+<%='Заголовок'._%>:*
+<%= text_field 'photo_album', 'title', :size => 70 %>
+
+<%='Дата'._%>:
+<%= date_select 'photo_album', 'taken_at', :start_year => current_user.age.year, :end_year => Time.now.year %>
+
+<%='Описание'._%>:
+<%= text_area 'photo_album', 'description', :size => "60x4" %>
+
+<%= hidden_field 'photo_album', 'location', :value => "some value" %>
+<%= hidden_field 'photo_album', 'category_id', :value => "some value" %>
+
+<%='Виден'._%>:
+ <%= select 'photo_album', 'privacy', PhotoAlbum::PRIVACY_A, {}, :style => 'width:200px;' %>
+
+
diff --git a/app/views/meetings/add_photos.html.erb b/app/views/meetings/add_photos.html.erb
new file mode 100644
index 0000000..6556890
--- /dev/null
+++ b/app/views/meetings/add_photos.html.erb
@@ -0,0 +1,13 @@
+<%= site_title "Добавить фотографии для встречи"._ %>
+
+<% form_tag({:action => 'add_photos'}, :multipart => true) do %>
+ <%= render :partial => 'photos_form' %>
+
+ <%= render :partial => 'photo_albums/upload_form' %>
+
+ <%= submit_tag "Создать"._, :onclick => "
+ if ($('photo_album_title').value.length == 0) {
+ $('photo_album_title').focus();
+ return false;}
+ " %> <%= link_to 'Отмена'._, meetings_url %>
+<% end %>
diff --git a/app/views/meetings/edit.html.erb b/app/views/meetings/edit.html.erb
new file mode 100644
index 0000000..ce1e979
--- /dev/null
+++ b/app/views/meetings/edit.html.erb
@@ -0,0 +1,23 @@
+
+
+
+
+
+
<%= link_to 'Информация о событии', edit_meeting_path(:id => @meeting.id)%>
+
<%= link_to 'Настройки', :action => :edit_settings, :id => @meeting.id%>
+
<%= link_to 'Список гостей', :action => :add_guests, :id => @meeting.id%>
+
+
+
+
+ <% if @meeting_page == "edit_info" %>
+ <%= render :partial => 'edit_info' %>
+ <% elsif @meeting_page == "edit_settings" %>
+ <%= render :partial => 'edit_settings' %>
+ <% elsif @meeting_page == "edit_guests" %>
+ <%= render :partial => 'edit_guests' %>
+ <% end %>
+
+
\ No newline at end of file
diff --git a/app/views/meetings/exit.html.erb b/app/views/meetings/exit.html.erb
new file mode 100644
index 0000000..c00cd1d
--- /dev/null
+++ b/app/views/meetings/exit.html.erb
@@ -0,0 +1,2 @@
+Meetings#exit
+Find me in app/views/meetings/exit.html.erb
diff --git a/app/views/meetings/index.html.erb b/app/views/meetings/index.html.erb
new file mode 100644
index 0000000..8972091
--- /dev/null
+++ b/app/views/meetings/index.html.erb
@@ -0,0 +1 @@
+<%= render :partial => 'meetings' %>
diff --git a/app/views/meetings/list.html.erb b/app/views/meetings/list.html.erb
new file mode 100644
index 0000000..8ffdccd
--- /dev/null
+++ b/app/views/meetings/list.html.erb
@@ -0,0 +1,2 @@
+Meetings#list
+Find me in app/views/meetings/list.html.erb
diff --git a/app/views/meetings/my_meetings.html.erb b/app/views/meetings/my_meetings.html.erb
new file mode 100644
index 0000000..0f156f1
--- /dev/null
+++ b/app/views/meetings/my_meetings.html.erb
@@ -0,0 +1,27 @@
+» <%='Мои Встречи'._%> (<%= @pages.item_count %>)
+<%= link_to "Добавить"._, :action => "new" %>
+<% for meeting in @meetings %>
+
+
+
+ <%=link_to image_tag('icons/trash.gif', :alt => 'Удалить'._), {:action => "delete_meeting", :id => meeting}, :confirm => 'Уверены?'._ %>
+
+
+ <%= h(meeting.location) %>
+ (<%= show_date(meeting.start_at) %>)
+
+
+ <%= format_message(meeting.description) %>
+
+
+
+<% end %>
+
+
+ <%= pagination_links(@pages) %>
+
diff --git a/app/views/meetings/new.html.erb b/app/views/meetings/new.html.erb
new file mode 100644
index 0000000..9d28f3d
--- /dev/null
+++ b/app/views/meetings/new.html.erb
@@ -0,0 +1,24 @@
+
+
+
+
+
+
<%= link_to 'Шаг 1: Информация о событии', :action => "new" %>
+
<%= link_to 'Шаг 2: Настройки', :action => :edit_settings, :id => @meeting.id%>
+
<%= link_to 'Шаг 3: Список гостей', :action => :add_guests, :id => @meeting.id%>
+
+
+
+
+ <%= render :partial => 'form' %>
+ <%# if @meeting_page == "event_info" %>
+ <%#= render :partial => 'form' %>
+ <%# elsif @meeting_page == "edit_settings" %>
+ <%#= render :partial => 'edit_settings' %>
+ <%# elsif @meeting_page == "edit_guests" %>
+ <%#= render :partial => 'edit_guests' %>
+ <%# end %>
+
+
diff --git a/app/views/meetings/photos.html.erb b/app/views/meetings/photos.html.erb
new file mode 100644
index 0000000..6ff8638
--- /dev/null
+++ b/app/views/meetings/photos.html.erb
@@ -0,0 +1,47 @@
+<% if @photos.size > 0 %>
+
+
+
+<% @photos.in_groups_of(3) do |row| -%>
+
+ <% for ph in row
+album = ph
+-%>
+
+ <% if ph.nil? %>
+
+ <% else %>
+
+
+
+
+
+ <%= link_to album_cover_img(album), photo_album_url(:id => album) %>
+ <%= link_to h(truncate(album.title, 20)), photo_album_url(:id => album)%>
+ <%= md_date(album.taken_at) %>(<%= album.photo_count %>)
+
+
+
+
+ <%= link_to h(truncate(ph.user.login, 13)), profile_url(:id => ph.user_id), :class => 'b ' + sex_class(ph.user.male?),
+ :onMouseOver=> "showUserInfoPopup(event, '#{'Загрузка...'._}', '#{url_for(:action => 'small_info', :controller => '/users', :id => ph.user_id)}');",
+ :onMouseOut=> "hideMsg();"
+ %>
+
+
+
+
+ <% end %>
+
+<% end %>
+
+<% end %>
+
+
+
+
+
+<%= pagination_div(@pages, params) %>
+<% else %>
+<%='Нет фоток'._%>
+<% end %>
\ No newline at end of file
diff --git a/app/views/meetings/show.html.erb b/app/views/meetings/show.html.erb
new file mode 100644
index 0000000..52690c6
--- /dev/null
+++ b/app/views/meetings/show.html.erb
@@ -0,0 +1,73 @@
+<%= link_to 'Вернуться назад'._ + '»', meetings_path %>
+
+ Организатор:
+ <%=link_to_profile @meeting.user %>
+
+
+ Место встречи:
+ <%=h @meeting.location %>
+
+
+ Описание:
+ <%= format_message @meeting.description %>
+
+
+ Время начала:
+ <%= @meeting.start_at.to_s(:short) %>
+
+
+ Время завершения:
+ <%= @meeting.end_at.to_s(:short) %>
+
+
+<%if logged_in?%>
+
+
+ <% form_for :current_participant, @current_participant, :url => { :action => "change_participant_status", :id => @meeting } do |form| %>
+
+ Планы
+
+ <%= form.radio_button :status, Participant::PLAN::YES %> Пойду
+ <%= form.radio_button :status, Participant::PLAN::MAYBE %> Возможно пойду
+ <%= form.radio_button :status, Participant::PLAN::NO %> Не пойду
+ <%= submit_tag "Ответ на приглашение" %>
+
+
+ <% end %>
+
+<% end %>
+ <% if @meeting.has_participant? current_user %>
+
+ <%= link_to 'Посмотреть/Добавить фотографии', :action => "add_photos", :id => @meeting %>
+ <% elsif !logged_in?%>
+ <% else %>
+ <%= link_to 'Участвовать', :action => "join", :id => @meeting %>
+ <% end %>
+ <%if @meeting.user_id == current_user.id %>
+ | <%= link_to 'Править', edit_meeting_path(:id => @meeting) %>
+<% end %>
+
+<%= render :partial => 'participants' %>
+
+<%='Комментарии'._%>
+<% if @comments.size > 0 %>
+<% @comment_obj = @meeting %>
+<%= render :partial => 'users/comments' %>
+<% else %>
+Нет
+<% end %>
+
+<% if is_allowed_to_post(@meeting.user) %>
+ <%='Мой коментарий к этому сообщению'._%>:
+ <% form_tag :action => 'add_comment', :id => @meeting.id do %>
+ <%= hidden_field_tag 'meeting_id', @meeting.id %>
+ <%= text_area 'comment', 'message', :rows => '4', :style=>"width:100%" %>
+
+ <%= 'Показать Смайлы'._ %>
+
+ <%= submit_tag '» ' + 'Сказать'._ %>
+ <% end %>
+<% end %>
+ <%= render :partial => 'shared/smiles', :locals => { :input_id => "comment_message" } %>
+
+
diff --git a/app/views/meetings/update.html.erb b/app/views/meetings/update.html.erb
new file mode 100644
index 0000000..601d774
--- /dev/null
+++ b/app/views/meetings/update.html.erb
@@ -0,0 +1,2 @@
+Meetings#update
+Find me in app/views/meetings/update.html.erb
diff --git a/app/views/spam_messages/revise_spam_messages.html.erb b/app/views/spam_messages/revise_spam_messages.html.erb
index f714fbd..27d0ba2 100644
--- a/app/views/spam_messages/revise_spam_messages.html.erb
+++ b/app/views/spam_messages/revise_spam_messages.html.erb
@@ -27,7 +27,7 @@
<% elsif spam_message.spam_status == SpamMessage::SPAM_STATUS::SPAM %>
<%= link_to 'не спам', { :action => "revise_cancel_status", :id => spam_message.id}, :confirm => 'Точно?' %>
<% elsif spam_message.spam_status == SpamMessage::SPAM_STATUS::REVISED_SPAM || spam_message.spam_status == SpamMessage::SPAM_STATUS::REVISED_NOT_SPAM %>
- Nothing to do
+ Nothing to do
<% end -%>
| <%= link_to 'показать', :action => "show_revise", :id => spam_message.id %>
diff --git a/app/views/spam_messages/show_revise.html.erb b/app/views/spam_messages/show_revise.html.erb
index 0b656bc..20e2185 100644
--- a/app/views/spam_messages/show_revise.html.erb
+++ b/app/views/spam_messages/show_revise.html.erb
@@ -11,7 +11,7 @@
<% elsif @spam_message.spam_status == SpamMessage::SPAM_STATUS::SPAM %>
<%= link_to 'не спам', { :action => "revise_cancel_status", :id => @spam_message.id}, :confirm => 'Точно?' %>
<% elsif @spam_message.spam_status == SpamMessage::SPAM_STATUS::REVISED_SPAM || @spam_message.spam_status == SpamMessage::SPAM_STATUS::REVISED_NOT_SPAM %>
-