Merge remote-tracking branch 'origin/szzh' into guange_dev
This commit is contained in:
commit
66e2bc5ef2
|
@ -274,6 +274,13 @@ module Mobile
|
|||
get ":course_id/members" do
|
||||
cs = CoursesService.new
|
||||
count = cs.course_members params
|
||||
# 我如果在学生当中,那么我将放在第一位
|
||||
count.each do |m|
|
||||
if m.user.id == current_user.id
|
||||
count.delete m
|
||||
count.unshift m
|
||||
end
|
||||
end
|
||||
present :data, count, with: Mobile::Entities::Member
|
||||
present :status, 0
|
||||
end
|
||||
|
@ -290,6 +297,20 @@ module Mobile
|
|||
present :data,homeworkscore,with: Mobile::Entities::Homeworkscore
|
||||
present :status,0
|
||||
end
|
||||
|
||||
desc '发布课程通知'
|
||||
params do
|
||||
requires :token,type:String
|
||||
requires :course_id,type:Integer,desc:'课程id'
|
||||
requires :title,type:String,desc:'通知标题'
|
||||
requires :desc,type:String,desc:'通知描述'
|
||||
end
|
||||
post ':course_id/create_course_notice' do
|
||||
cs = CoursesService.new
|
||||
news = cs.create_course_notice params,current_user
|
||||
present :data,news,with:Mobile::Entities::News
|
||||
present :status,0
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -85,6 +85,7 @@ module Mobile
|
|||
requires :search_by, type: String,desc: '搜索依据:0 昵称,1 用户名,2 邮箱,3 昵称和姓名'
|
||||
optional :is_search_assitant,type:Integer,desc:'是否搜索注册用户来作为助教'
|
||||
optional :course_id,type:Integer,desc: '课程id,搜索注册用户不为该课程教师的其他用户'
|
||||
optional :user_id,type:Integer,desc:'用户id'
|
||||
end
|
||||
get 'search/search_user' do
|
||||
us = UsersService.new
|
||||
|
|
|
@ -508,6 +508,12 @@ class CoursesService
|
|||
end
|
||||
end
|
||||
|
||||
def create_course_notice params ,current_user
|
||||
n = News.new(:course_id =>params[:course_id], :author_id => current_user.id,:title =>params[:title],:description=> params[:desc])
|
||||
n.save
|
||||
{:id => n.id,:title => n.title,:author_name => n.author.name,:author_id => n.author.id, :description => n.description,:created_on => format_time(n.created_on),:comments_count => n.comments_count}
|
||||
end
|
||||
|
||||
private
|
||||
def searchmember_by_name members, name
|
||||
#searchPeopleByRoles(project, StudentRoles)
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
<label><span class="c_red">*</span> <%= l(:label_tags_course_name)%> :</label>
|
||||
<input type="text" name="course[name]" id="course_name" class="courses_input" maxlength="100" onkeyup="regex_course_name();" value="<%= @course.name%>">
|
||||
<span class="c_red" id="course_name_notice" style="display: none;">课程名称不能为空</span>
|
||||
<input type="password" style="top: -100000px;position: fixed;">
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="ml45">
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<!-- added by fq -->
|
||||
<!--display the board-->
|
||||
<script>$(function(){$("img").removeAttr("alt");});</script>
|
||||
<div class="borad-topic-count">共有 <%=link_to @forum.memos.count %> 个贴子</div>
|
||||
<div style="padding-top: 10px">
|
||||
<% if memos.any? %>
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<a href="javascript:void(0)" onclick="submitSerch('<%= l(:label_search_conditions_not_null) %>');" class="search_btn fl f14 c_white" >
|
||||
<%= l(:label_search)%>
|
||||
</a>
|
||||
<br />
|
||||
<div class="cl"></div>
|
||||
<span id="project_name_span" style="float: left"></span>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<%=link_to l(:field_homepage), home_path %> >
|
||||
<%=link_to l(:field_homepage), home_path %> >
|
||||
<span>
|
||||
<%=link_to @user.name, user_path %>
|
||||
</span>
|
||||
|
@ -122,7 +122,7 @@
|
|||
<strong class="font_small_watch">
|
||||
<%= link_to l(:label_user_watcher)+"("+User.watched_by(@user.id).count.to_s+")" ,:controller=>"users", :action=>"user_watchlist"%>
|
||||
</strong>
|
||||
|
||||
|
||||
<strong class="font_small_watch">
|
||||
<%= link_to l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count)+"("+@user.watcher_users.count.to_s+")", :controller=>"users", :action=>"user_fanslist" %>
|
||||
</strong>
|
||||
|
@ -190,16 +190,16 @@
|
|||
<% unless @user.user_extensions.nil? %>
|
||||
<% if @user.user_extensions.identity == 0 || @user.user_extensions.identity == 1 %>
|
||||
<tr>
|
||||
<% unless @user.user_extensions.school.nil? %>
|
||||
<td style=" float: right" width="70px">
|
||||
<span style="float: right"><%= l(:field_occupation) %>:</span>
|
||||
</td>
|
||||
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
|
||||
<% unless @user.user_extensions.school.nil? %>
|
||||
<a href="http://course.trustie.net/?school_id=<%= @user.user_extensions.school.id%>"><%= @user.user_extensions.school.name %></a>
|
||||
<% end %>
|
||||
</td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% elsif @user.user_extensions.identity == 3 %>
|
||||
<% elsif @user.user_extensions.identity == 3 && @user.user_extensions.occupation.empty? %>
|
||||
<tr>
|
||||
<td style=" float: right" width="70px">
|
||||
<span style="float: right"> <%= l(:field_occupation) %>:</span>
|
||||
|
|
|
@ -18,9 +18,6 @@
|
|||
}
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function get_school(value){
|
||||
var prefix = '';
|
||||
if(location.href.indexOf('ros') >= 0)
|
||||
|
@ -36,14 +33,9 @@
|
|||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function test(id){
|
||||
location.href = encodeURI('http://<%= Setting.host_course %>/?school_id='+id);
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
function ssearch(){
|
||||
//alert($("#key_word").val());
|
||||
var value = $("#key_word").val();
|
||||
|
|
|
@ -7,6 +7,7 @@ h2, .wiki h1 {font-size: 20px;}
|
|||
h3, .wiki h2 {font-size: 15px; padding-left: 5px}
|
||||
h4, .wiki h3 {font-size: 13px;}
|
||||
h4 {border-bottom: 1px dotted #bbb;}
|
||||
li{list-style-type:none;}
|
||||
/*huang*/
|
||||
/*current position*/
|
||||
.contest_count{
|
||||
|
|
Loading…
Reference in New Issue