Merge branch 'szzh' into guange_dev
This commit is contained in:
commit
a8e7590b16
|
@ -274,6 +274,13 @@ module Mobile
|
||||||
get ":course_id/members" do
|
get ":course_id/members" do
|
||||||
cs = CoursesService.new
|
cs = CoursesService.new
|
||||||
count = cs.course_members params
|
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 :data, count, with: Mobile::Entities::Member
|
||||||
present :status, 0
|
present :status, 0
|
||||||
end
|
end
|
||||||
|
@ -290,6 +297,20 @@ module Mobile
|
||||||
present :data,homeworkscore,with: Mobile::Entities::Homeworkscore
|
present :data,homeworkscore,with: Mobile::Entities::Homeworkscore
|
||||||
present :status,0
|
present :status,0
|
||||||
end
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -85,6 +85,7 @@ module Mobile
|
||||||
requires :search_by, type: String,desc: '搜索依据:0 昵称,1 用户名,2 邮箱,3 昵称和姓名'
|
requires :search_by, type: String,desc: '搜索依据:0 昵称,1 用户名,2 邮箱,3 昵称和姓名'
|
||||||
optional :is_search_assitant,type:Integer,desc:'是否搜索注册用户来作为助教'
|
optional :is_search_assitant,type:Integer,desc:'是否搜索注册用户来作为助教'
|
||||||
optional :course_id,type:Integer,desc: '课程id,搜索注册用户不为该课程教师的其他用户'
|
optional :course_id,type:Integer,desc: '课程id,搜索注册用户不为该课程教师的其他用户'
|
||||||
|
optional :user_id,type:Integer,desc:'用户id'
|
||||||
end
|
end
|
||||||
get 'search/search_user' do
|
get 'search/search_user' do
|
||||||
us = UsersService.new
|
us = UsersService.new
|
||||||
|
|
|
@ -508,6 +508,12 @@ class CoursesService
|
||||||
end
|
end
|
||||||
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
|
private
|
||||||
def searchmember_by_name members, name
|
def searchmember_by_name members, name
|
||||||
#searchPeopleByRoles(project, StudentRoles)
|
#searchPeopleByRoles(project, StudentRoles)
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
<label><span class="c_red">*</span> <%= l(:label_tags_course_name)%> :</label>
|
<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%>">
|
<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>
|
<span class="c_red" id="course_name_notice" style="display: none;">课程名称不能为空</span>
|
||||||
|
<input type="password" style="top: -100000px;position: fixed;">
|
||||||
</li>
|
</li>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<li class="ml45">
|
<li class="ml45">
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<!-- added by fq -->
|
<script>$(function(){$("img").removeAttr("alt");});</script>
|
||||||
<!--display the board-->
|
|
||||||
<div class="borad-topic-count">共有 <%=link_to @forum.memos.count %> 个贴子</div>
|
<div class="borad-topic-count">共有 <%=link_to @forum.memos.count %> 个贴子</div>
|
||||||
<div style="padding-top: 10px">
|
<div style="padding-top: 10px">
|
||||||
<% if memos.any? %>
|
<% 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" >
|
<a href="javascript:void(0)" onclick="submitSerch('<%= l(:label_search_conditions_not_null) %>');" class="search_btn fl f14 c_white" >
|
||||||
<%= l(:label_search)%>
|
<%= l(:label_search)%>
|
||||||
</a>
|
</a>
|
||||||
<br />
|
<div class="cl"></div>
|
||||||
<span id="project_name_span" style="float: left"></span>
|
<span id="project_name_span" style="float: left"></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -190,16 +190,16 @@
|
||||||
<% unless @user.user_extensions.nil? %>
|
<% unless @user.user_extensions.nil? %>
|
||||||
<% if @user.user_extensions.identity == 0 || @user.user_extensions.identity == 1 %>
|
<% if @user.user_extensions.identity == 0 || @user.user_extensions.identity == 1 %>
|
||||||
<tr>
|
<tr>
|
||||||
|
<% unless @user.user_extensions.school.nil? %>
|
||||||
<td style=" float: right" width="70px">
|
<td style=" float: right" width="70px">
|
||||||
<span style="float: right"><%= l(:field_occupation) %>:</span>
|
<span style="float: right"><%= l(:field_occupation) %>:</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
|
<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>
|
<a href="http://course.trustie.net/?school_id=<%= @user.user_extensions.school.id%>"><%= @user.user_extensions.school.name %></a>
|
||||||
<% end %>
|
|
||||||
</td>
|
</td>
|
||||||
|
<% end %>
|
||||||
</tr>
|
</tr>
|
||||||
<% elsif @user.user_extensions.identity == 3 %>
|
<% elsif @user.user_extensions.identity == 3 && @user.user_extensions.occupation.empty? %>
|
||||||
<tr>
|
<tr>
|
||||||
<td style=" float: right" width="70px">
|
<td style=" float: right" width="70px">
|
||||||
<span style="float: right"> <%= l(:field_occupation) %>:</span>
|
<span style="float: right"> <%= l(:field_occupation) %>:</span>
|
||||||
|
|
|
@ -18,9 +18,6 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
</script>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
function get_school(value){
|
function get_school(value){
|
||||||
var prefix = '';
|
var prefix = '';
|
||||||
if(location.href.indexOf('ros') >= 0)
|
if(location.href.indexOf('ros') >= 0)
|
||||||
|
@ -36,14 +33,9 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</script>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
function test(id){
|
function test(id){
|
||||||
location.href = encodeURI('http://<%= Setting.host_course %>/?school_id='+id);
|
location.href = encodeURI('http://<%= Setting.host_course %>/?school_id='+id);
|
||||||
}
|
}
|
||||||
</script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
function ssearch(){
|
function ssearch(){
|
||||||
//alert($("#key_word").val());
|
//alert($("#key_word").val());
|
||||||
var value = $("#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}
|
h3, .wiki h2 {font-size: 15px; padding-left: 5px}
|
||||||
h4, .wiki h3 {font-size: 13px;}
|
h4, .wiki h3 {font-size: 13px;}
|
||||||
h4 {border-bottom: 1px dotted #bbb;}
|
h4 {border-bottom: 1px dotted #bbb;}
|
||||||
|
li{list-style-type:none;}
|
||||||
/*huang*/
|
/*huang*/
|
||||||
/*current position*/
|
/*current position*/
|
||||||
.contest_count{
|
.contest_count{
|
||||||
|
|
Loading…
Reference in New Issue