diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index f96cf66fb..ab3d7b120 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -23,6 +23,7 @@ class AdminController < ApplicationController
before_filter :require_admin
helper :sort
+ helper :Users
include SortHelper
def index
@@ -39,6 +40,121 @@ class AdminController < ApplicationController
render :action => "projects", :layout => false if request.xhr?
end
+ def users
+ @project_type = params[:project_type]
+ role = params[:role]
+
+ sort_init 'login', 'asc'
+ sort_update %w(login firstname lastname mail admin created_on last_login_on)
+
+ case params[:format]
+ when 'xml', 'json'
+ @offset, @limit = api_offset_and_limit({:limit => 15})
+ else
+ @limit = 15#per_page_option
+ end
+
+ @status = params[:status] || 1
+ has = {
+ "show_changesets" => true
+ }
+ # @count = Redmine::Activity::Fetcher.new(User.current, :author => @user).scope_select {|t| !has["show_#{t}"].nil?}.events(nil, nil).count
+
+ scope = UserStatus.visible
+ case role
+ when 'teacher'
+ scope = UserStatus.teacher
+ when 'student'
+ scope = UserStatus.student
+ else
+
+ end
+
+ scope = scope.in_group(params[:group_id]) if params[:group_id].present?
+ # scope.each do |user|
+ # UserStatus.create(:changesets_count => user.changesets.count, :watchers_count => user.watcher_users.count, :user_id => user.id)
+ # end
+ @user_count = scope.count
+ @user_pages = Paginator.new @user_count, @limit, params['page']
+ #@offset ||= @user_pages.offset
+ #@users = scope.order(sort_clause).limit(@limit).offset(@offset).all
+ @user_base_tag = params[:id] ? 'base_users':'base'
+ if params[:user_sort_type].present?
+ case params[:user_sort_type]
+ when '0'
+ @offset ||= @user_pages.reverse_offset
+ unless @offset == 0
+ @users_statuses = scope.offset(@offset).limit(@limit).all.reverse
+ else
+ limit = @user_count % @limit
+ if limit == 0
+ limit = @limit
+ end
+ @users_statuses = scope.offset(@offset).limit(limit).all.reverse
+ end
+ @s_type = 0
+ # @projects = @projects.sort {|x,y| y.created_on <=> x.created_on }
+ # @projects = @projects[@offset, @limit]
+ when '1'
+ @offset ||= @user_pages.reverse_offset
+ unless @offset == 0
+ @users_statuses = scope.reorder('grade').offset(@offset).limit(@limit).all.reverse
+ else
+ limit = @user_count % @limit
+ if limit == 0
+ limit = @limit
+ end
+ @users_statuses = scope.reorder('grade').offset(@offset).limit(limit).all.reverse
+ end
+ @s_type = 1
+ #sort {|x,y| y.user_status.changesets_count <=> x.user_status.changesets_count}
+ #@users = @users[@offset, @limit]
+ when '2'
+ @offset ||= @user_pages.reverse_offset
+ unless @offset == 0
+ @users_statuses = scope.reorder('watchers_count').offset(@offset).limit(@limit).all.reverse
+ else
+ limit = @user_count % @limit
+ if limit == 0
+ limit = @limit
+ end
+ @users_statuses = scope.reorder('watchers_count').offset(@offset).limit(limit).all.reverse
+ end
+ @s_type = 2
+ #@users = @users[@offset, @limit]
+ end
+
+ else
+ @offset ||= @user_pages.reverse_offset
+ unless @offset == 0
+ @users_statuses = scope.reorder('grade').offset(@offset).limit(@limit).all.reverse
+ else
+ limit = @user_count % @limit
+ if limit == 0
+ limit = @limit
+ end
+ @users_statuses = scope.reorder('grade').offset(@offset).limit(limit).all.reverse
+ end
+ @s_type = 1
+ # @projects = @projects.sort {|x,y| y.created_on <=> x.created_on }
+ # @projects = @projects[@offset, @limit]
+ end
+
+ @users = []
+ @users_statuses.each do |obj|
+ @users << User.find_by_id("#{obj.user_id}")
+ end
+
+
+ respond_to do |format|
+ format.html {
+ @groups = Group.all.sort
+ render :layout => @user_base_tag
+ }
+ format.api
+ end
+ end
+
def plugins
@plugins = Redmine::Plugin.all
end
diff --git a/app/controllers/open_source_projects_controller.rb b/app/controllers/open_source_projects_controller.rb
index 1ca7ddcef..7b9333647 100644
--- a/app/controllers/open_source_projects_controller.rb
+++ b/app/controllers/open_source_projects_controller.rb
@@ -1,8 +1,8 @@
class OpenSourceProjectsController < ApplicationController
-
+
before_filter :find_osp, :only => [:master_apply, :accept_master_apply, :refuse_master_apply]
before_filter :require_master, :only => [:master_apply, :accept_master_apply, :refuse_master_apply]
-
+
helper :sort
include SortHelper
helper :apply_project_masters
@@ -22,7 +22,7 @@ class OpenSourceProjectsController < ApplicationController
@os_project_count = @open_source_projects.count
@os_project_pages = Paginator.new @os_project_count, per_page_option, params['page']
-
+
@open_source_projects = @open_source_projects.offset(@os_project_pages.offset).limit(@os_project_pages.per_page)
# @open_source_projects = OpenSourceProject.all
@@ -32,11 +32,11 @@ class OpenSourceProjectsController < ApplicationController
format.json { render json: @open_source_projects }
end
end
-
+
def master_apply
@apply = @open_source_project.apply_tips
@applicants = @open_source_project.applicants
-
+
respond_to do |format|
format.html {
render :layout => "base_opensource_p"
@@ -49,7 +49,7 @@ class OpenSourceProjectsController < ApplicationController
# GET /open_source_projects/1.json
def show
@open_source_project = OpenSourceProject.find(params[:id])
-
+
sort_init 'updated_at', 'desc'
sort_update 'created_at' => "#{RelativeMemo.table_name}.created_at",
'replies' => "#{RelativeMemo.table_name}.replies_count",
@@ -63,9 +63,9 @@ class OpenSourceProjectsController < ApplicationController
includes(:last_reply).
limit(@topic_pages.per_page).
offset(@topic_pages.offset).
- order(sort_clause).
+ order(sort_clause).
all
-
+
@bugs = @open_source_project.bugs.limit(6)
respond_to do |format|
@@ -76,25 +76,50 @@ class OpenSourceProjectsController < ApplicationController
end
end
+ def search
-def search
-
end
+ def showbug
+ @open_source_project = OpenSourceProject.find(params[:id])
-# added by yiang 暴力添加,请绕道
-def showmemo
- @open_source_project = OpenSourceProject.find(params[:id])
+ sort_init 'updated_at', 'desc'
+ sort_update 'created_at' => "#{RelativeMemo.table_name}.created_at",
+ 'replies' => "#{RelativeMemo.table_name}.replies_count",
+ 'updated_at' => "COALESCE (last_replies_relative_memos.created_at, #{RelativeMemo.table_name}.created_at)"
- sort_init 'updated_at', 'desc'
- sort_update 'created_at' => "#{RelativeMemo.table_name}.created_at",
+ @memo = RelativeMemo.new(:open_source_project => @open_source_project)
+ @topic_count = @open_source_project.bugs.count
+ @topic_pages = Paginator.new @topic_count, per_page_option, params['page']
+ @memos = @open_source_project.bugs.
+ reorder("#{RelativeMemo.table_name}.sticky DESC").
+ includes(:last_reply).
+ limit(@topic_pages.per_page).
+ offset(@topic_pages.offset).
+ order(sort_clause).
+ all
+
+ respond_to do |format|
+ format.html {
+ render :layout => "base_opensource_p"
+ }
+ format.json { render json: @open_source_project }
+ end
+ end
+
+ # added by yiang 暴力添加,请绕道
+ def showmemo
+ @open_source_project = OpenSourceProject.find(params[:id])
+
+ sort_init 'updated_at', 'desc'
+ sort_update 'created_at' => "#{RelativeMemo.table_name}.created_at",
'replies' => "#{RelativeMemo.table_name}.replies_count",
'updated_at' => "COALESCE (last_replies_relative_memos.created_at, #{RelativeMemo.table_name}.created_at)"
- @memo = RelativeMemo.new(:open_source_project => @open_source_project)
- @topic_count = @open_source_project.topics.count
- @topic_pages = Paginator.new @topic_count, per_page_option, params['page']
- @memos = @open_source_project.topics.
+ @memo = RelativeMemo.new(:open_source_project => @open_source_project)
+ @topic_count = @open_source_project.topics.count
+ @topic_pages = Paginator.new @topic_count, per_page_option, params['page']
+ @memos = @open_source_project.topics.
reorder("#{RelativeMemo.table_name}.sticky DESC").
includes(:last_reply).
limit(@topic_pages.per_page).
@@ -102,13 +127,14 @@ def showmemo
order(sort_clause).
all
- respond_to do |format|
- format.html {
- render :layout => "base_opensource_p"
- }
- format.json { render json: @open_source_project }
+ respond_to do |format|
+ format.html {
+ render :layout => "base_opensource_p"
+ }
+ format.json { render json: @open_source_project }
+ end
end
-end
+
# GET /open_source_projects/new
# GET /open_source_projects/new.json
def new
@@ -168,52 +194,51 @@ end
format.json { head :no_content }
end
end
-
+
def remove_condition
@app_dir = params[:app_dir]
@language = params[:language]
@created_at = params[:created_at]
redirect_to open_source_projects_path(:app_dir => @app_dir, :language => @language, :created_at => @created_at, :name => params[:name])
end
-
+
def search
# per_page_option = 10
-#
+ #
# @open_source_projects = OpenSourceProject.filter(@app_dir, @language, @created_at)
# @open_source_projects = @open_source_projects.like(params[:name]) if params[:name].present?
-#
+ #
# @os_project_count = @open_source_projects.count
# @os_project_pages = Paginator.new @os_project_count, per_page_option, params['page']
-#
+ #
# @open_source_projects = @open_source_projects.offset(@os_project_pages.offset).limit(@os_project_pages.per_page)
redirect_to open_source_projects_path(:name => params[:name])
end
-
+
def refuse_master_apply
@apply = ApplyProjectMaster.where("user_id = ? and apply_id = ? and apply_type = 'OpenSourceProject'", params[:user_id], @open_source_project.id)
@apply.first.destory
-
+
redirect_to master_apply_open_source_project_path
end
-
+
def accept_master_apply
@apply = ApplyProjectMaster.where("user_id = ? and apply_id = ? and apply_type = 'OpenSourceProject'", params[:user_id], @open_source_project.id)
if @apply.count == 1
- @apply.first.update_attributes(:status => 2)
+ @apply.first.update_attributes(:status => 2)
end
-
+
redirect_to master_apply_open_source_project_path
end
-
-
+
private
-
+
def require_master
render_403 unless @open_source_project.admin?(User.current)
end
-
+
def find_osp
@open_source_project = OpenSourceProject.find(params[:id])
render_404 unless @open_source_project.present?
diff --git a/app/controllers/test_controller.rb b/app/controllers/test_controller.rb
index ddb47a8b7..ec3e5cbdb 100644
--- a/app/controllers/test_controller.rb
+++ b/app/controllers/test_controller.rb
@@ -3,6 +3,8 @@ class TestController < ApplicationController
helper :UserScore
layout 'bootstrap_base'
+ def bootstrap; end
+
def zip
homeworks_attach_path = []
homework_id = params[:homework_id]
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 6174e2124..19c84cc33 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -67,7 +67,7 @@ class UsersController < ApplicationController
if User.current.admin?
@memberships = @user.memberships.all
else
- cond = Project.visible_condition(User.current) + "AND projects.project_type <> 1"
+ cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1"
@memberships = @user.memberships.all(:conditions => cond)
end
events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 20)
@@ -565,7 +565,7 @@ class UsersController < ApplicationController
end
def watch_projects
- @watch_projects = Project.joins(:watchers).where("project_type <>? and watchable_type = ? and user_id = ?", '1','Project', @user.id)
+ @watch_projects = Project.joins(:watchers).where("project_type <>? and watchable_type = ? and watchers.user_id = ?", '1','Project', @user.id)
@state = 1
respond_to do |format|
format.html {
@@ -782,7 +782,7 @@ class UsersController < ApplicationController
end
def setting_layout(default_base='base_users')
- User.current.admin? ? 'base_admin' : default_base
+ User.current.admin? ? default_base : default_base
end
# 必填自己的工作单位,其实就是学校
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index e0d52e89d..76da3b684 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1342,7 +1342,18 @@ module ApplicationHelper
def bootstrap_head
tags = stylesheet_link_tag('bootstrap/bootstrap.min', 'bootstrap/bootstrap-theme.min')
- tags << javascript_include_tag('bootstrap/bootstrap.min', 'bootstrap/jquery.transition.min')
+ tags << javascript_include_tag('bootstrap/affix')
+ tags << javascript_include_tag('bootstrap/alert')
+ tags << javascript_include_tag('bootstrap/button')
+ tags << javascript_include_tag('bootstrap/carousel')
+ tags << javascript_include_tag('bootstrap/collapse')
+ tags << javascript_include_tag('bootstrap/dropdown')
+ tags << javascript_include_tag('bootstrap/modal')
+ tags << javascript_include_tag('bootstrap/popover')
+ tags << javascript_include_tag('bootstrap/scrollspy')
+ tags << javascript_include_tag('bootstrap/tab')
+ tags << javascript_include_tag('bootstrap/tooltip')
+ tags << javascript_include_tag('bootstrap/transition')
tags
end
@@ -1674,5 +1685,20 @@ module ApplicationHelper
# end
# end
# end
+
+ def footer_logo(ul_class=nil, li_class=nil)
+ logos = []
+ logos.push(link_to image_tag('/images/footer_logo/nudt.png',:alt=>"nudt"),"http://www.nudt.edu.cn/special.asp?classid=12" )
+ logos.push(link_to image_tag('/images/footer_logo/peking_eecs.png', :alt=>"peking_eecs"), "http://eecs.pku.edu.cn" )
+ logos.push(link_to image_tag('/images/footer_logo/buaa_scse.png', :alt=>"buaa_scse"), "http://scse.buaa.edu.cn/" )
+ logos.push(link_to image_tag('/images/footer_logo/iscas.png', :alt=>"iscas"), "http://www.iscas.ac.cn" )
+ logos.push(link_to image_tag('/images/footer_logo/inforbus.png', :alt=>"inforbus"), "http://www.inforbus.com" )
+
+ logos.collect! { |logo|
+ content_tag(:li, logo.html_safe, :class => li_class.to_s)
+ }
+
+ content_tag(:ul, logos.join("").html_safe, :class => ul_class.to_s).html_safe
+ end
end
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index 23351d919..5e7f7c18c 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -59,12 +59,11 @@ module IssuesHelper
def issue_heading(issue)
#h("#{issue.tracker} ##{issue.id}")
- #h("#{issue.tracker} #{issue.source_from}")
+ # h("#{issue.tracker} #{issue.source_from}")
s = ''
- s << ">>"
- s << link_to(@issue.project.name+l(:issue_list), project_issues_path(@issue.project))
- s << " >"
- s << @issue.source_from
+ s << link_to(@issue.project.name, project_issues_path(@issue.project))
+ s << " > #"
+ s << @issue.project_index
s.html_safe
end
diff --git a/app/models/issue.rb b/app/models/issue.rb
index d2332350a..7e899eafc 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -1156,7 +1156,11 @@ class Issue < ActiveRecord::Base
# back string obj which is belong to project.
def source_from
"" << self.project.name.to_s <<
- "#" << (self.project.issues.index(self).to_i + 1).to_s
+ "#" << project_index
+ end
+
+ def project_index
+ (self.project.issues.index(self).to_i + 1).to_s
end
private
diff --git a/app/models/relative_memo.rb b/app/models/relative_memo.rb
index 073d1ca12..f087fce2b 100644
--- a/app/models/relative_memo.rb
+++ b/app/models/relative_memo.rb
@@ -70,6 +70,11 @@ class RelativeMemo < ActiveRecord::Base
def cannot_reply_to_locked_topic
errors.add :base, l(:label_memo_locked) if root.locked? && self != root
end
+
+ def short_content(length = 25)
+ str = "^(.{,#{length}})[^\n\r]*.*$"
+ content.gsub(Regexp.new(str), '\1...').strip if content
+ end
# def update_memos_forum
# if forum_id_changed?
diff --git a/app/views/admin/users.html.erb b/app/views/admin/users.html.erb
new file mode 100644
index 000000000..779316469
--- /dev/null
+++ b/app/views/admin/users.html.erb
@@ -0,0 +1,69 @@
+<% if User.current.admin? %>
+
+ <%= link_to l(:label_user_new), new_user_path, :class => 'icon icon-add' %>
+
+
+ <%= l(:label_user_plural)%>
+
+ <%= form_tag(:controller => 'users', :action => 'search', :method => :get) do %>
+
+
+ <%= l(:label_filter_plural) %>
+
+ <%= l(:field_status) %>:
+ <%= select_tag 'status', users_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %>
+
+ <% if @groups.present? %>
+ <%= l(:label_group) %>:
+ <%= select_tag 'group_id', content_tag('option') + options_from_collection_for_select(@groups, :id, :name, params[:group_id].to_i), :onchange => "this.form.submit(); return false;" %>
+ <% end %>
+
+ <%= l(:label_user) %>:
+ <%= text_field_tag 'name', params[:name], :size => 30 %>
+ <%= submit_tag l(:label_search), :class => "small", :name => nil %>
+
+ <% end %>
+
+
+
+
+
+ <% html_title(l(:label_user_plural)) -%>
+<%else %>
+
+<% end%>
\ No newline at end of file
diff --git a/app/views/layouts/_bootstrap_base_footer.html.erb b/app/views/layouts/_bootstrap_base_footer.html.erb
new file mode 100644
index 000000000..2bda28bdd
--- /dev/null
+++ b/app/views/layouts/_bootstrap_base_footer.html.erb
@@ -0,0 +1,20 @@
+
+
\ No newline at end of file
diff --git a/app/views/layouts/_bootstrap_base_header.html.erb b/app/views/layouts/_bootstrap_base_header.html.erb
index 2c55ff2cc..8c2d26c54 100644
--- a/app/views/layouts/_bootstrap_base_header.html.erb
+++ b/app/views/layouts/_bootstrap_base_header.html.erb
@@ -1,51 +1,49 @@
<%
- request.headers['REQUEST_URI'] = "" if request.headers['REQUEST_URI'].nil?
- realUrl = request.original_url
- if (realUrl.match(/forge\.trustie\.net\/*/))
- @nav_dispaly_project_label = 1
- @nav_dispaly_forum_label = 1
- elsif (realUrl.match(/course\.trustie\.net\/*/))
- @nav_dispaly_course_all_label = 1
- @nav_dispaly_forum_label = 1
- @nav_dispaly_course_label = nil
- @nav_dispaly_store_all_label = 1
- elsif (realUrl.match(/user\.trustie\.net\/*/))
- @nav_dispaly_home_path_label = 1
- @nav_dispaly_main_course_label = 1
- @nav_dispaly_main_project_label = 1
- @nav_dispaly_main_contest_label = 1
- elsif (realUrl.match(/contest\.trustie\.net\/*/))
- @nav_dispaly_contest_label = 1
- @nav_dispaly_store_all_label = 1
- else
- @nav_dispaly_project_all_label = 1
- @nav_dispaly_course_all_label = 1
- @nav_dispaly_forum_label = 1
- @nav_dispaly_bid_label = 1
- @nav_dispaly_contest_label = 1
- @nav_dispaly_store_all_label = 1
- @nav_dispaly_user_label = 1
- end
+request.headers['REQUEST_URI'] = "" if request.headers['REQUEST_URI'].nil?
+realUrl = request.original_url
+if (realUrl.match(/forge\.trustie\.net\/*/))
+ @nav_dispaly_project_label = 1
+ @nav_dispaly_forum_label = 1
+elsif (realUrl.match(/course\.trustie\.net\/*/))
+ @nav_dispaly_course_all_label = 1
+ @nav_dispaly_forum_label = 1
+ @nav_dispaly_course_label = nil
+ @nav_dispaly_store_all_label = 1
+elsif (realUrl.match(/user\.trustie\.net\/*/))
+ @nav_dispaly_home_path_label = 1
+ @nav_dispaly_main_course_label = 1
+ @nav_dispaly_main_project_label = 1
+ @nav_dispaly_main_contest_label = 1
+elsif (realUrl.match(/contest\.trustie\.net\/*/))
+ @nav_dispaly_contest_label = 1
+ @nav_dispaly_store_all_label = 1
+else
+ @nav_dispaly_project_all_label = 1
+ @nav_dispaly_course_all_label = 1
+ @nav_dispaly_forum_label = 1
+ @nav_dispaly_bid_label = 1
+ @nav_dispaly_contest_label = 1
+ @nav_dispaly_store_all_label = 1
+end
%>
-
-
+
+
+
+ Toggle navigation
+
+
+
+
+ <%=link_to image_tag("/images/logo5.png", class: 'navbar-brand', style:"width: 50px; height: 50px; padding:4px"), '/' %>
+
-
-
-
- <%= bootstrap_render_dynamic_nav if User.current.logged? || !Setting.login_required? -%>
-
+
+
+
+ <%= bootstrap_render_dynamic_nav if User.current.logged? || !Setting.login_required? -%>
+
Dropdown
Submit
- ">
- <%= bootstrap_render_menu :account_menu -%>
-
-
+
+ <%=link_to l(:label_my_course), {:controller => 'users', :action => 'user_courses', id: User.current.id, host: Setting.course_domain} %>
+ <%=link_to l(:label_my_projects),{:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain} %>
+
+ <%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.user_domain}%>
+
+
+ <%= bootstrap_render_menu :account_menu -%>
+
+
-
+
diff --git a/app/views/layouts/bootstrap_base.html.erb b/app/views/layouts/bootstrap_base.html.erb
index f485d5c4a..040857df4 100644
--- a/app/views/layouts/bootstrap_base.html.erb
+++ b/app/views/layouts/bootstrap_base.html.erb
@@ -5,43 +5,30 @@
<%= h html_title %>
+
<%= csrf_meta_tag %>
<%= favicon %>
- <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %>
- <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
+ <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'bootstrap_custom.css', :media => 'all' %>
<%= javascript_heads %>
- <%= javascript_include_tag "jquery.leanModal.min" %>
- <%= javascript_include_tag 'seems_rateable/jRating', 'seems_rateable/rateable' %>
- <%= heads_for_theme %>
+ <%#= javascript_include_tag "jquery.leanModal.min" %>
<%= bootstrap_head %>
- <%= call_hook :view_layouts_base_html_head %>
-
+ <%= javascript_include_tag 'gas' %>
<%= yield :header_tags -%>
-
+
+ <%= render :partial => 'layouts/bootstrap_base_header' %>
+
+ <%= render_flash_messages %>
+ <%= yield %>
+
+
-
-
-
- <%= render :partial => 'layouts/bootstrap_base_header' %>
-
-
- <%= render_flash_messages %>
- <%= yield %>
- <%= call_hook :view_layouts_base_content %>
-
- <%= render :partial => 'layouts/base_footer' %>
-
-
-
-
<%= l(:label_loading) %>
-
-
-
-<%= call_hook :view_layouts_base_body_bottom %>
+ <%= l(:label_loading) %>
+
+ <%= render :partial => 'layouts/bootstrap_base_footer' %>
diff --git a/app/views/open_source_projects/_show_bug.html.erb b/app/views/open_source_projects/_show_bug.html.erb
new file mode 100644
index 000000000..97dae6829
--- /dev/null
+++ b/app/views/open_source_projects/_show_bug.html.erb
@@ -0,0 +1,80 @@
+
+
+
+
+
共有 <%= link_to @topic_count %> 个贴子
+
+ <% if memos.any? %>
+ <% memos.each do |topic| %>
+
+
+ <%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) if topic.author%>
+ <%= image_tag('../images/avatars/User/0', :class => "avatar") unless topic.author%>
+
+
+
+
+ <% if topic.url.nil? || topic.url == '' %>
+ <%= link_to h(topic.subject), open_source_project_relative_memo_path(open_source_project, topic) %>
+ <% else %>
+ <%= link_to h(topic.subject), topic.url %>
+ <% end %>
+
+
+
+ <%= link_to (topic.replies_count), topic.url, :target => '_blank' %>
+
+
+ 回帖
+
+
+
+
+
+
+ <%= link_to (topic.viewed_count_crawl+topic.viewed_count_local), topic.url, :target => '_blank' %>
+
+
+ 关注
+
+
+
+
+
+
+ <%= link_to (topic.viewed_count_crawl+topic.viewed_count_local), topic.url, :target => '_blank' %>
+
+
+ 浏览
+
+
+
+
+ <%= topic.short_content(70) %>
+
+
+ <%= user_url_and_time topic.username, topic.userhomeurl, topic.created_at %>
+
+
+
+
+ 帖子来源:<%=link_to topic.topic_resource, topic.url %>
+
+ <%= no_use_link(topic, User.current) %>
+
+
+
+
+
+
+ <% end %>
+
+ <% else %>
+
+ <%= l(:label_no_data) %>
+
+ <% end %>
+
\ No newline at end of file
diff --git a/app/views/open_source_projects/_show_memo.html.erb b/app/views/open_source_projects/_show_memo.html.erb
index 63de42132..7d723dca9 100644
--- a/app/views/open_source_projects/_show_memo.html.erb
+++ b/app/views/open_source_projects/_show_memo.html.erb
@@ -2,7 +2,7 @@
-
共有 <%= link_to memos.count %> 个贴子 共有 <%= link_to @topic_count %> 个贴子
<% if memos.any? %>
@@ -23,7 +23,7 @@
- <%= link_to (topic.replies_count), open_source_project_relative_memo_path(open_source_project, topic) %>
+ <%= link_to (topic.replies_count), topic.url, :target => '_blank' %>
回帖
@@ -33,7 +33,7 @@
- <%= link_to (topic.viewed_count_crawl+topic.viewed_count_local), open_source_project_relative_memo_path(open_source_project, topic) %>
+ <%= link_to (topic.viewed_count_crawl+topic.viewed_count_local), topic.url, :target => '_blank' %>
关注
@@ -43,7 +43,7 @@
- <%= link_to (topic.viewed_count_crawl+topic.viewed_count_local), open_source_project_relative_memo_path(open_source_project, topic) %>
+ <%= link_to (topic.viewed_count_crawl+topic.viewed_count_local), topic.url, :target => '_blank' %>
浏览
@@ -51,17 +51,17 @@
-
+
- <%= user_url_and_time topic.username, topic.userhomeurl, topic.created_at %>
+ <%= user_url_and_time topic.username, topic.userhomeurl, topic.created_at %>
- 帖子来源:<%=link_to 'OSChina', topic.url %>
+ 帖子来源:<%=link_to 'OSChina', topic.url %>
- <%= no_use_link(topic, User.current) %>
+ <%= no_use_link(topic, User.current) %>
diff --git a/app/views/open_source_projects/_show_topics.html.erb b/app/views/open_source_projects/_show_topics.html.erb
index 3ba463944..dacc9b013 100644
--- a/app/views/open_source_projects/_show_topics.html.erb
+++ b/app/views/open_source_projects/_show_topics.html.erb
@@ -20,7 +20,7 @@
-
项目安全态势 <%= link_to "更多 >>", :controller => "open_source_projects",:action => "showmemo", :id => @open_source_project.id %>
+
项目安全态势 <%= link_to "更多 >>", :controller => "open_source_projects",:action => "showbug", :id => @open_source_project.id %>
@@ -435,11 +435,11 @@
- <%= link_to h(topic.subject), topic.url %>
+ <%= link_to h(topic.subject), topic.url, :target => '_blank' %>
- <%= link_to (topic.replies_count), open_source_project_relative_memo_path(open_source_project, topic) %>
+ <%= link_to (topic.replies_count), topic.url, :target => '_blank' %>
回帖
@@ -449,7 +449,7 @@
- <%= link_to (topic.viewed_count_crawl+topic.viewed_count_local), open_source_project_relative_memo_path(open_source_project, topic) %>
+ <%= link_to (topic.viewed_count_crawl+topic.viewed_count_local), topic.url, :target => '_blank' %>
关注
@@ -459,7 +459,7 @@
- <%= link_to (topic.viewed_count_crawl+topic.viewed_count_local), open_source_project_relative_memo_path(open_source_project, topic) %>
+ <%= link_to (topic.viewed_count_crawl+topic.viewed_count_local), topic.url, :target => '_blank' %>
浏览
@@ -467,17 +467,17 @@
-
+
-
+
- 帖子来源:<%=link_to 'OSChina', topic.url %>
+ 帖子来源:<%=link_to 'OSChina', topic.url %>
- <%= no_use_link(topic, User.current) %>
+ <%= no_use_link(topic, User.current) %>
diff --git a/app/views/open_source_projects/show.html.erb b/app/views/open_source_projects/show.html.erb
index d1751dec8..ec9d521d5 100644
--- a/app/views/open_source_projects/show.html.erb
+++ b/app/views/open_source_projects/show.html.erb
@@ -32,7 +32,7 @@
<% #= link_to '发布帖子', new_forum_memo_path(@forum), :class => 'icon icon-add' %>
- <%= link_to l(:label_memo_new_from_forum), new_open_source_project_relative_memo_path(@open_source_project), :class => 'icon icon-add',
+ <%#= link_to l(:label_memo_new_from_forum), new_open_source_project_relative_memo_path(@open_source_project), :class => 'icon icon-add',
:onclick => 'showAndScrollTo("add-memo", "memo_subject"); return false;' if User.current.logged? %>
diff --git a/app/views/open_source_projects/showbug.html.erb b/app/views/open_source_projects/showbug.html.erb
new file mode 100644
index 000000000..86e8a226b
--- /dev/null
+++ b/app/views/open_source_projects/showbug.html.erb
@@ -0,0 +1,55 @@
+
+
+
<%=l(:label_memo_new)%>
+ <% if User.current.logged? %>
+ <%= labelled_form_for(@memo, :url => open_source_project_relative_memos_path(@open_source_project), :html => {:multipart => true} ) do |f| %>
+ <% if @memo.errors.any? %>
+
+
<%= pluralize(@memo.errors.count, "error") %> prohibited this memo from being saved:
+
+
+ <% @memo.errors.full_messages.each do |msg| %>
+ <%= msg %>
+ <% end %>
+
+
+ <% end %>
+
+
<%= f.text_field :subject, :required => true%>
+
<%= f.text_area :content, :required => true, :id => 'editor02' %>
+
+
+
+ <%#= l(:label_attachment_plural) %>
+ <%#= render :partial => 'attachments/form', :locals => {:container => @memo} %>
+
+ <%= f.submit :value => l(:label_memo_create) %>
+ <%= link_to l(:button_cancel), "#", :onclick => '$("#add-memo").hide(); return false;' %>
+
+ <% end %>
+<% end %>
+
+
+<% #= link_to '发布帖子', new_forum_memo_path(@forum), :class => 'icon icon-add' %>
+
+ <%= link_to l(:label_memo_new_from_forum), new_open_source_project_relative_memo_path(@open_source_project), :class => 'icon icon-add',
+ :onclick => 'showAndScrollTo("add-memo", "memo_subject"); return false;' if User.current.logged? %>
+
+
+
+ <%#= link_to(
+ image_tag('edit.png')+l(:label_forum_edit),
+ {:action => 'edit', :id => @forum},
+ :method => 'get',
+ :title => l(:button_edit)
+ ) if @forum.editable_by?(User.current) %>
+ <%#= link_to(
+ image_tag('delete.png')+'删除讨论区',
+ {:action => 'destroy', :id => @forum},
+ :method => :delete,
+ :data => {:confirm => l(:text_are_you_sure)},
+ :title => l(:button_delete)
+ ) if @forum.destroyable_by?(User.current) %>
+
+<%= render :partial => 'open_source_projects/show_bug', :locals => {:memos => @memos, :open_source_project => @open_source_project} %>
+
\ No newline at end of file
diff --git a/app/views/test/bootstrap.html.erb b/app/views/test/bootstrap.html.erb
new file mode 100644
index 000000000..56c1d11bf
--- /dev/null
+++ b/app/views/test/bootstrap.html.erb
@@ -0,0 +1 @@
+<%= image_tag "http://image227.poco.cn/mypoco/myphoto/20140516/17/5527437020140516173219035.png", class: "img-responsive" %>
\ No newline at end of file
diff --git a/app/views/test/courselist.html.erb b/app/views/test/courselist.html.erb
index 959d6a4be..e11c16fad 100644
--- a/app/views/test/courselist.html.erb
+++ b/app/views/test/courselist.html.erb
@@ -1,42 +1,54 @@
-
-<% @courses.each do |course| %>
-
- <%= course.name %>
+
+ Well done! You successfully read this important alert message.
+
+
+ Heads up! This alert needs your attention, but it's not super important.
+
+
+ Warning! Best check yo self, you're not looking too good.
+
+
+ Oh snap! Change a few things up and try submitting again.
+
+
+