Merge branch 'sw_new_course' of http://repository.trustie.net/xianbo/trustie2 into sw_new_course
This commit is contained in:
commit
56a1283033
|
@ -113,7 +113,8 @@ class CoursesController < ApplicationController
|
||||||
courses = Course.visible.where("LOWER(name) like '%#{params[:name].to_s.downcase}%'")
|
courses = Course.visible.where("LOWER(name) like '%#{params[:name].to_s.downcase}%'")
|
||||||
@courses = paginateHelper courses,10
|
@courses = paginateHelper courses,10
|
||||||
end
|
end
|
||||||
|
@name = params[:name]
|
||||||
|
@type = 'courses'
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
render :layout => 'course_base'
|
render :layout => 'course_base'
|
||||||
|
|
|
@ -157,7 +157,7 @@ class MyController < ApplicationController
|
||||||
File.delete(diskfile1) if File.exist?(diskfile1)
|
File.delete(diskfile1) if File.exist?(diskfile1)
|
||||||
end
|
end
|
||||||
|
|
||||||
render :layout=>'base_users_new'
|
render :layout=>'new_base_user'
|
||||||
end
|
end
|
||||||
|
|
||||||
# Destroys user's account
|
# Destroys user's account
|
||||||
|
|
|
@ -93,7 +93,8 @@ class ProjectsController < ApplicationController
|
||||||
|
|
||||||
@project_count = Project.project_entities.visible.like(params[:name]).page(params[:page]).count
|
@project_count = Project.project_entities.visible.like(params[:name]).page(params[:page]).count
|
||||||
@project_pages = Paginator.new @project_count, @limit, params['page']
|
@project_pages = Paginator.new @project_count, @limit, params['page']
|
||||||
|
@name = params[:name]
|
||||||
|
@type = 'projects'
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
render :layout => 'base'
|
render :layout => 'base'
|
||||||
|
|
|
@ -454,6 +454,8 @@ class UsersController < ApplicationController
|
||||||
end
|
end
|
||||||
@users = scope.offset(@offset).limit(limit).all.reverse
|
@users = scope.offset(@offset).limit(limit).all.reverse
|
||||||
end
|
end
|
||||||
|
@name = params[:name]
|
||||||
|
@type = 'users'
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
@groups = Group.all.sort
|
@groups = Group.all.sort
|
||||||
|
|
|
@ -17,24 +17,40 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
<script>
|
||||||
|
<% type = type%>
|
||||||
|
$(document).ready(function (){
|
||||||
|
if('<%= type %>' != null && '<%= type %>' == 'courses' ){
|
||||||
|
$('input:radio[value="courses"]').attr('checked','checked');
|
||||||
|
}
|
||||||
|
if('<%= type %>' != null && '<%= type %>' == 'projects' ){
|
||||||
|
$('input:radio[value="projects"]').attr('checked','checked');
|
||||||
|
}
|
||||||
|
if('<%= type %>' != null && '<%= type %>' == 'users' ){
|
||||||
|
$('input:radio[value="users"]').attr('checked','checked');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
<div class="fl" id="navHomepageSearch">
|
<div class="fl" id="navHomepageSearch">
|
||||||
<form class="navHomepageSearchBox">
|
<!--<form class="navHomepageSearchBox">-->
|
||||||
<input type="text" name="navHomepageSearch" class="navHomepageSearchInput" />
|
<% name = name%>
|
||||||
<a href="javascript:void(0);" class="homepageSearchIcon"></a>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
|
<%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %>
|
||||||
|
<input type="text" name="q" value="<%= name.nil? ? "" : name%>" class="navHomepageSearchInput" />
|
||||||
|
<input type="hidden" name="search_type" id="type" value=""/>
|
||||||
|
<a href="javascript:void(0);" class="homepageSearchIcon" onclick="$('#type').val($('input[type=radio]:checked').val());$(this).parent().submit();"></a>
|
||||||
|
<% end %>
|
||||||
<div class="navSearchTypeBox" id="navHomepageSearchType">
|
<div class="navSearchTypeBox" id="navHomepageSearchType">
|
||||||
<div class="fl mr15 mt8">
|
<div class="fl mr15 mt8">
|
||||||
<input type="radio" value="课程" name="navSearchType" checked/>
|
<input type="radio" value="courses" name="search_type" checked/>
|
||||||
课程
|
课程
|
||||||
</div>
|
</div>
|
||||||
<div class="fl mr15 mt8">
|
<div class="fl mr15 mt8">
|
||||||
<input type="radio" value="项目" name="navSearchType" />
|
<input type="radio" value="projects" name="search_type" />
|
||||||
项目
|
项目
|
||||||
</div>
|
</div>
|
||||||
<div class="fl mr15 mt8">
|
<div class="fl mr15 mt8">
|
||||||
<input type="radio" value="用户" name="navSearchType" />
|
<input type="radio" value="users" name="search_type" />
|
||||||
用户
|
用户
|
||||||
</div>
|
</div>
|
||||||
<div id="navSearchAlert" class="fr mr10">
|
<div id="navSearchAlert" class="fr mr10">
|
||||||
|
|
|
@ -18,11 +18,25 @@
|
||||||
// alert(3)
|
// alert(3)
|
||||||
$(doc).parent().submit();
|
$(doc).parent().submit();
|
||||||
}
|
}
|
||||||
|
<% type = type%>
|
||||||
|
$(document).ready(function (){
|
||||||
|
if('<%= type %>' != null && '<%= type %>' == 'courses' ){
|
||||||
|
$('input:radio[value="courses"]').attr('checked','checked');
|
||||||
|
}
|
||||||
|
if('<%= type %>' != null && '<%= type %>' == 'projects' ){
|
||||||
|
$('input:radio[value="projects"]').attr('checked','checked');
|
||||||
|
}
|
||||||
|
if('<%= type %>' != null && '<%= type %>' == 'users' ){
|
||||||
|
$('input:radio[value="users"]').attr('checked','checked');
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<div class="fl" id="navHomepageSearch">
|
<div class="fl" id="navHomepageSearch">
|
||||||
<!--<form class="navHomepageSearchBox">-->
|
<!--<form class="navHomepageSearchBox">-->
|
||||||
|
<% name = name%>
|
||||||
|
|
||||||
<%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %>
|
<%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %>
|
||||||
<input type="text" name="q" class="navHomepageSearchInput"/>
|
<input type="text" name="q" value="<%= name.nil? ? "" : name%>" class="navHomepageSearchInput"/>
|
||||||
<input type="hidden" name="search_type" id="type" value=""/>
|
<input type="hidden" name="search_type" id="type" value=""/>
|
||||||
<a href="javascript:void(0);" class="homepageSearchIcon" onclick="$('#type').val($('input[type=radio]:checked').val());$(this).parent().submit();"></a>
|
<a href="javascript:void(0);" class="homepageSearchIcon" onclick="$('#type').val($('input[type=radio]:checked').val());$(this).parent().submit();"></a>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -24,9 +24,9 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="navContainer mb10">
|
<div class="navContainer mb10">
|
||||||
<% if User.current.logged? %>
|
<% if User.current.logged? %>
|
||||||
<%= render :partial => 'layouts/logined_header' %>
|
<%= render :partial => 'layouts/logined_header',:locals=>{:name=>@name,:type=>@type} %>
|
||||||
<% else%>
|
<% else%>
|
||||||
<%= render :partial => 'layouts/unlogin_header' %>
|
<%= render :partial => 'layouts/unlogin_header',:locals=>{:name=>@name,:type=>@type} %>
|
||||||
<% end%>
|
<% end%>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
|
@ -27,9 +27,9 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="navContainer mb10">
|
<div class="navContainer mb10">
|
||||||
<% if User.current.logged? %>
|
<% if User.current.logged? %>
|
||||||
<%= render :partial => 'layouts/logined_header' %>
|
<%= render :partial => 'layouts/logined_header' ,:locals=>{:name=>@name,:type=>@type}%>
|
||||||
<% else%>
|
<% else%>
|
||||||
<%= render :partial => 'layouts/unlogin_header' %>
|
<%= render :partial => 'layouts/unlogin_header' ,:locals=>{:name=>@name,:type=>@type}%>
|
||||||
<% end%>
|
<% end%>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<meta name="keywords" content="issue,bug,tracker" />
|
<meta name="keywords" content="issue,bug,tracker" />
|
||||||
<%= csrf_meta_tag %>
|
<%= csrf_meta_tag %>
|
||||||
<%= favicon %>
|
<%= favicon %>
|
||||||
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'new_user', 'user_leftside', :media => 'all' %>
|
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'new_user', 'user_leftside','users', :media => 'all' %>
|
||||||
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
|
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
|
||||||
<%= javascript_heads %>
|
<%= javascript_heads %>
|
||||||
<%= javascript_include_tag "bootstrap","avatars","new_user"%>
|
<%= javascript_include_tag "bootstrap","avatars","new_user"%>
|
||||||
|
|
|
@ -22,9 +22,9 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="navContainer mb10">
|
<div class="navContainer mb10">
|
||||||
<% if User.current.logged? %>
|
<% if User.current.logged? %>
|
||||||
<%= render :partial => 'layouts/logined_header' %>
|
<%= render :partial => 'layouts/logined_header',:locals=>{:name=>@name,:type=>@type} %>
|
||||||
<% else%>
|
<% else%>
|
||||||
<%= render :partial => 'layouts/unlogin_header' %>
|
<%= render :partial => 'layouts/unlogin_header',:locals=>{:name=>@name,:type=>@type} %>
|
||||||
<% end%>
|
<% end%>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
Loading…
Reference in New Issue