diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 052df384e..f83580fba 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -180,6 +180,7 @@ class ProjectsController < ApplicationController @project = Project.new @project.safe_attributes = params[:project] @project.organization_id = params[:organization_id] + @project.user_id = User.current.id if validate_parent_id && @project.save @project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id') # Add current user as a project member if he is not admin @@ -347,16 +348,27 @@ class ProjectsController < ApplicationController end #发送邮件邀请新用户 def invite_members_by_mail - @is_zhuce =false - respond_to do |format| - format.html - format.js + if User.current.member_of?(@project) || User.current.admin? + @is_zhuce = false + respond_to do |format| + format.html + format.js + end + else + render_403 end end # 邀请Trustie注册用户 def invite_members - @member ||= @project.members.new + if User.current.member_of?(@project) || User.current.admin? + @member ||= @project.members.new + respond_to do |format| + format.html + end + else + render_403 + end end def edit diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb index 971bf603d..b9e658bb5 100644 --- a/app/helpers/watchers_helper.rb +++ b/app/helpers/watchers_helper.rb @@ -283,6 +283,6 @@ module WatchersHelper def exit_project_link(project) link_to(l(:label_exit_project),exit_cur_project_path(project.id), - :remote => true, :confirm => l(:lable_sure_exit_project), :style => "color: #fff; display:block; padding: 0px 5px;margin-right:10px;height:22px;background:none repeat scroll 0% 0% #64BDD9;TES" ) + :remote => true, :confirm => l(:lable_sure_exit_project), :style => "color: #fff; display:block; padding: 0px 5px; margin-right: 10px; height: 22px; line-height: 22px; background: none repeat scroll 0% 0% #64BDD9; TES" ) end end diff --git a/app/views/kaminari/_gap.html.erb b/app/views/kaminari/_gap.html.erb index a45dfdaa0..01b6cc640 100644 --- a/app/views/kaminari/_gap.html.erb +++ b/app/views/kaminari/_gap.html.erb @@ -5,4 +5,6 @@ per_page: number of items to fetch per page remote: data-remote -%> - + +<%= raw(t 'views.pagination.truncate') %> + \ No newline at end of file diff --git a/app/views/layouts/_base_feedback.html.erb b/app/views/layouts/_base_feedback.html.erb index e21500576..cd1e1f40f 100644 --- a/app/views/layouts/_base_feedback.html.erb +++ b/app/views/layouts/_base_feedback.html.erb @@ -107,7 +107,7 @@ $(function(){ $("#button1").click(function(){ - myTips("您的意见已经反馈到公共贴吧的新手讨论吧,我们会第一时间解决您的问题,谢谢支持!","success"); + myTips("<%= l(:label_feedback_success) %>","success"); }); }) @@ -153,7 +153,7 @@ function cookieget(n) -意见反馈 +<%= l(:label_feedback) %> @@ -161,15 +161,15 @@ function cookieget(n)
- +
<% get_memo %> <%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %> - <%= f.text_area :subject, :class => "opnionText",:placeholder => "有什么想说的,尽管来咆哮吧~~"%> - <%= f.hidden_field :content, :required => true ,:value=>'该贴来自用户反馈!'%> + <%= f.text_area :subject, :class => "opnionText", :placeholder => l(:label_feedback_tips) %> + <%= f.hidden_field :content, :required => true , :value => l(:label_feedback_value) %> <%#= f.submit :value => l(:label_memo_create), :class => "opnionButton", :id => "button1" %> - 提  交 + <%= l(:label_submit)%> <% end %>
@@ -180,7 +180,7 @@ function cookieget(n)
-
提交
+
<%= l(:label_submit)%>