• R/O
  • SSH
  • HTTPS

minisns: 提交


Commit MetaInfo

修订版18 (tree)
时间2009-02-17 23:26:02
作者rainyrook

Log Message

(empty log message)

更改概述

差异

--- minisns/app/helpers/application_helper.rb (revision 17)
+++ minisns/app/helpers/application_helper.rb (revision 18)
@@ -14,13 +14,13 @@
1414 end
1515 end
1616
17- def get_profile_picture(associated_account)
17+ def get_profile_picture(associated_account,type)
1818 a_users_picture_profile = Picture.find(:first, :conditions => ["user_id = ? and profile_picture_flag = true", associated_account.id])
1919 alt_string="#{associated_account.user_info.last_name} #{associated_account.user_info.first_name}"
20-
2120 unless a_users_picture_profile.nil?
22- p a_users_picture_profile.image_name
23- image_string = image_tag url_for_image_column(a_users_picture_profile, "image_name", :thumb)
21+ image_string = image_tag url_for_image_column(a_users_picture_profile, "image_name", :thumb) if type == "S"
22+ image_string = image_tag url_for_image_column(a_users_picture_profile, "image_name", :midle) if type == "M"
23+ image_string = image_tag url_for_image_column(a_users_picture_profile, "image_name", :large) if type == "L"
2424 else
2525 image_string = "<img src='/images/noimage_member76.gif' WIDTH='50' HEIGHT='50' alt='#{alt_string}'>"
2626 end
@@ -27,4 +27,12 @@
2727 image_string
2828 link_to image_string, associated_account.user_info ,:title=>alt_string
2929 end
30+
31+ def get_user_name
32+ user_name = ""
33+ if self.current_user.user_info
34+ user_name = "#{self.current_user.user_info.last_name} #{self.current_user.user_info.first_name}"
35+ end
36+ user_name
37+ end
3038 end
--- minisns/app/controllers/blog_entries_controller.rb (revision 17)
+++ minisns/app/controllers/blog_entries_controller.rb (revision 18)
@@ -4,7 +4,7 @@
44 # GET /blog_entries
55 # GET /blog_entries.xml
66 def index
7- @blog_entries = BlogEntry.paginate (:include => :users,:page => params[:page],:per_page => 5,:conditions => ["users.id=?",self.current_user.id])
7+ @blog_entries = BlogEntry.paginate(:include => :users,:page => params[:page],:per_page => 5,:conditions => ["users.id=?",self.current_user.id])
88 respond_to do |format|
99 format.html # index.html.erb
1010 format.xml { render :xml => @blog_entries }
--- minisns/app/controllers/pictures_controller.rb (revision 17)
+++ minisns/app/controllers/pictures_controller.rb (revision 18)
@@ -4,7 +4,8 @@
44 # GET /pictures
55 # GET /pictures.xml
66 def index
7- @pictures = Picture.find(:all, :conditions => ["user_id = ? ",self.current_user.id])
7+# @pictures = Picture.find(:all, :conditions => ["user_id = ? ",self.current_user.id])
8+ @pictures = Picture.paginate (:include => :user,:page => params[:page],:per_page => 5,:conditions => ["users.id=?",self.current_user.id])
89
910 respond_to do |format|
1011 format.html # index.html.erb
--- minisns/lib/authenticated_system.rb (revision 17)
+++ minisns/lib/authenticated_system.rb (revision 18)
@@ -110,14 +110,14 @@
110110 end
111111
112112 def get_user_info
113- @user_info = UserInfo.find(:first, :conditions => ["user_id = ? ",self.current_user.id])
114113 @picture_profile = Picture.find(:first, :conditions => ["user_id = ? and profile_picture_flag = true", self.current_user.id])
115114 @account_associations = AccountAssociation.paginate :conditions => ["user_id = ? ",self.current_user.id], :page => params[:page], :order => 'id DESC', :per_page => 40
116- redirect_back_or_default(:controller => '/user_infos', :action => 'new') if @user_info.nil?
117- rescue
118- @user_info = UserInfo.new
119- @user_info.id = self.current_user.id
120- @user_info.user_id = self.current_user.id
115+ if self.current_user.user_info.nil?
116+# @user_info = UserInfo.new
117+# @user_info.id = self.current_user.id
118+# @user_info.user_id = self.current_user.id
119+ redirect_back_or_default(:controller => '/user_infos', :action => 'new') if self.current_user.user_info.nil?
120+ end
121121 end
122122
123123 def get_one_line_comment
Show on old repository browser