This commit is contained in:
huang 2015-03-09 10:31:51 +08:00
commit 402f3701da
18 changed files with 75 additions and 61 deletions

View File

@ -87,6 +87,17 @@ module Mobile
present :status, 0
end
desc '课程留言列表'
params do
optional :token, type: String
end
get ':id/course_message' do
cs = CommentService.new
jours = cs.course_messages params,(current_user.nil? ? User.find(2):current_user)
present :data, jours, with: Mobile::Entities::Jours
present :status, 0
end
end
end
end

View File

@ -125,7 +125,7 @@ class AccountController < ApplicationController
#register_by_email_activation(@user)
unless @user.new_record?
flash[:notice] = l(:notice_account_register_done)
render action: 'email_valid', locals: {:mail => user.mail}
render action: 'email_valid', locals: {:mail => @user.mail}
end
when '3'
#register_automatically(@user)

View File

@ -336,4 +336,8 @@ class AdminController < ApplicationController
end
def create_version
end
end

View File

@ -333,13 +333,21 @@ class ProjectsController < ApplicationController
end
def send_mail_to_member
unless params[:mail].nil?
if !params[:mail].nil? && User.find_by_mail(params[:mail].to_s).nil?
email = params[:mail]
Mailer.send_invite_in_project(email, @project, User.current).deliver
@is_zhuce =false
else
@is_zhuce = true
end
respond_to do |format|
format.js
end
end
#发送邮件邀请新用户
def invite_members_by_mail
@is_zhuce =false
respond_to do |format|
format.html
format.js

View File

@ -447,7 +447,7 @@ class UsersController < ApplicationController
activity = activity.reject { |e|
!User.current.admin? &&
(((e.act_type == "Issue") && !e.act.project.visible?(User.current)) ||
(e.act_type == "Bid" && e.act.courses.first.is_public == 0 && !User.current.member_of_course?(e.act.courses.first)) ||
(e.act_type == "Bid" && !e.act.courses.first.nil? && e.act.courses.first.is_public == 0 && !User.current.member_of_course?(e.act.courses.first)) ||
(e.act_type == "Journal" && e.act.respond_to?("Project") && !e.act.project.visible?(User.current)) ||
(e.act_type == "News" && ((!e.act.project.nil? && !e.act.project.visible?(User.current)) || (!e.act.course.nil? && e.act.course.is_public == 0 && !User.current.member_of_course?(e.act.course)))) ||
(e.act_type == "Message" && !e.act.board.nil? && ((!e.act.board.project.nil? && !e.act.board.project.visible?(User.current)) || (!e.act.board.course.nil? && e.act.board.course.is_public == 0 && !User.current.member_of_course?(e.act.board.course)))))

View File

@ -87,4 +87,15 @@ class CommentService
@memo
end
#课程留言列表
def course_messages params,current_user
@course = ::Course.find(params[:id])
if (current_user.admin? || @course.is_public == 1 || (@course.is_public == 0 && current_user.member_of_course?(@course)))
@jours = @course.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
else
raise '403'
end
@jours
end
end

View File

@ -158,9 +158,9 @@ class CoursesService
#显示课程
def show_course(params,currnet_user)
def show_course(params,current_user)
course = Course.find(params[:id])
unless (course.is_public == 1 || currnet_user.member_of_course?(@course)|| currnet_user.admin?)
unless (course.is_public == 1 || current_user.member_of_course?(course) || current_user.admin?)
raise '403'
end
{:course => course,:img_url => url_to_avatar(course),:current_user_is_member => current_user.member_of_course?(course),:current_user_is_teacher => is_course_teacher(current_user,course)}

View File

@ -2,9 +2,8 @@
<a href="javascript:void(0)" onclick="$('#new_version').slideToggle(400); ">发布新版本</a>
<div>
<form id="new_version" style="display: none">
发布新版本
</form>
</div>
<br/>
<div>当前版本:</div>

View File

@ -9,5 +9,5 @@
<%= link_to_unless page.current?, page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil}
-%>
<%= link_to_unless page.current?, page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} %>
<%= link_to page, url, page.current? ? {:remote => remote,:class => 'current-page', :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} : {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} %>

View File

@ -4,9 +4,7 @@
<h1 class="ur_page_title">
<%= @poll.polls_name.empty? ? l(:label_poll_new) : @poll.polls_name %>
</h1>
<p class="ur_prefix_content">
<%= @poll.polls_description%>
</p>
<%= @poll.polls_description.nil? ? "" : @poll.polls_description.html_safe%>
</div>
<div class="ur_card">
<ol class="ur_questions">

View File

@ -33,9 +33,7 @@
<h1 class="ur_page_title">
<%= @poll.polls_name%>
</h1>
<p class="ur_prefix_content">
<%= @poll.polls_description.html_safe %>
</p>
<%= @poll.polls_description.nil? ? "" : @poll.polls_description.html_safe%>
</div>

View File

@ -1,16 +1,22 @@
<div class="project_r_h">
<h2 class="project_h2">邀请加入</h2>
</div>
<div class="floatbox" style="margin:120px;">
<div class="floatbox" style="margin:100px;">
<div ><a href="#" class="box_close"></a></div>
<div class="cl"></div>
<div class="box_main">
<h3 class="box_h3">发送邮件邀请新用户</h3>
<p class="box_p">输入好友邮箱地址Trustie帮您免费发送</p>
<p style="padding-lef:20px;"><%= form_tag('send_mail_to_member', :controller => 'projects',:action => 'send_mail_to_member', method: 'get',:remote=>true) do %></p>
<div id="is_registed">
<%= render :partial => 'regested', locals: { :isregisted => false} %>
</div>
<%= form_tag('send_mail_to_member', :controller => 'projects',:action => 'send_mail_to_member', method: 'get',:remote=>true) do %>
<ul>
<li >
<%= text_field_tag 'mail', '邮箱', :class => "fb_item fl" %>
</li>
<div class="cl"></div>
<%= submit_tag '免费发送', :style=> "display:block; width:80px; text-align:center; color:#fff; height:26px; padding-top:3px; margin-bottom:10px;" %>
<div class="cl"></div>
</ul>
<%= submit_tag '免费发送', :class=> "btn_free" %>
<% end %>
</div>

View File

@ -0,0 +1,3 @@
<% if isregisted %>
<p style="color: #ff0000"><%= l(:notice_registed_success) %></p>
<% end %>

View File

@ -0,0 +1 @@
$("#is_registed").html("<%= escape_javascript( render :partial => 'regested', locals: {:isregisted => @is_zhuce})%>")

View File

@ -180,4 +180,4 @@
</div>
</div>
<%= paginate @events_pages %>
<%= paginate @events_pages, :window => 3%>

View File

@ -110,45 +110,7 @@
</div>
</div>
<div id="J_Slide" class="d-p-index-box d-p-index-Dynamic">
<ul class="user-welcome-message-list">
<h3 style="color: rgb(21, 188, 207)">
<strong>
<%= l(:lable_user_active)%>
</strong>
</h3>
<div class="user-message-box-list" style="margin-top: 10px;">
<%activities = find_all_activities%>
<% activities.each do |event| %>
<li style="display: block;height:60px; padding-bottom: 4px;">
<div class="inner-right" style="float: left; height: 100%; ">
<%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
</div>
<div class="inner-right" style="float: right; width:86%; height: 100%; overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" >
<span style="color: green;">
<%= link_to event.event_author, (user_path(event.event_author) if event.event_author),
:style => "color:green;", :target => "_blank" %>
</span>
<%= show_user_content event %>
<p style="margin-top: 4px;">
<span style="color: rgb(172, 174, 177)">
<%= l(:field_updated_on) %>
<%= format_time event.event_datetime %>
<%#= l(:field_time_ago) %>
</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="float: right; color: rgb(172, 174, 177);">
<%= show_event_reply event %>
</span>
</p>
</div>
</li>
<% end %>
</div>
</ul>
</div>
<div class="right" style="float: right; width: 48%; ">
<div class="right" style="float: right; width: 48%; padding-top: 8px;">
<ul class="welcome-message-list">
<div class="forum-topic" style="height: 25px; width: 98%; margin-left: 2px;">
<h3 style="color: rgb(21, 188, 207);"><strong> <%= l(:lable_bar_active)%> </strong> <%= link_to l(:label_my_question) , newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
@ -156,7 +118,7 @@
<span style="margin-top: -30px;float: right; display: block;"> <%= link_to l(:label_more), forums_path %> </span>
</div>
<div class="welcome-box-list-new memo_activity">
<% topics = find_new_forum_topics(6) %>
<% topics = find_new_forum_topics(12) %>
<% topics.includes(:forum, :last_reply, :author).each do |topic|%>
<li class="message-brief-intro" style="line-height:1.4em;">
<div class='memo_title text_nowrap'>

View File

@ -181,6 +181,7 @@ zh:
notice_successful_create: 创建成功
notice_successful_update: 更新成功
notice_successful_delete: 删除成功
notice_registed_success: 该邮箱已被注册,请直接邀请注册用户
notice_failed_delete: 删除失败
notice_successful_connection: 连接成功
notice_successful_join: 加入成功
@ -2273,6 +2274,17 @@ zh:
# 托管平台主页 > 搜索提示信息
label_search_information: 请输入要搜索的关键字
welcome:
search:
information: "请输入要搜索的关键字" # 搜索提示信息
select: # 下拉列表
project: "项目"
course: "课程"
user: "用户"
userinfo:
nickname: "昵称"
showname: "姓名"
email: "邮箱"
# 托管平台主页 > 下拉列表
label_select_project: 项目
label_select_course: 课程

View File

@ -645,6 +645,7 @@ RedmineApp::Application.routes.draw do
match 'admin/web_footer_made', as: :web_footer_made
match 'admin/enterprise_page_made', as: :enterprise_page_made
match 'admin/mobile_version', as: :mobile_version
match 'admin/create_version', as: :create_version
match 'admin/search', :via => [:get, :post]
match 'admin/plugins', :via => :get
match 'admin/info', :via => :get