@@ -150,22 +152,26 @@
-
<%=l(:label_current_hot_contest)%>
- <%= link_to l(:label_more_information), {:controller => 'contests', :action => 'index'}, :target => "_blank" %> + + <% if User.current.logged? %> + <% unless User.current.user_extensions.identity == 1 %> + <%= link_to(l(:label_newtype_contest), new_contest_contests_path, :class => 'icon icon-add') %> + <% end %> + <% end %> + + <%= link_to l(:label_more), {:controller => 'contests', :action => 'index'}, :target => "_blank" %> +
<% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[5]) %>
-
<% end; reset_cycle %>
-
<%= image_tag('/images/contest1.png')%>
-
-
- <%= link_to(contest.name, contest_contestnotifications_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %>
+ <%= link_to(contest.name.truncate(50, omission: '...'), contest_contestnotifications_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %>
<% if contest.id == 2 or contest.id == 3 or contest.id == 6 %>
(<%= link_to("#{contest.projects.where('is_public=1').count}"+l(:label_work_quantity), show_attendingcontest_contest_path(contest), :target => "_blank") %>)
<% else %>
@@ -178,29 +184,35 @@
-
<%=l(:label_release_time)%>: <%=format_time contest.created_on %>
-
-
+
+
<%=l(:label_notification)%>
<% @contest_notifications.each do |notification| %>
-
-<%= link_to notification.title, notification %>
-<%= truncate(strip_tags(notification.content).gsub( ' ',' '), length:60) %>
-<%=l(:label_release_time)%>: <%=format_time notification.created_at %>
+
+ <%= link_to image_tag(url_to_avatar(notification.author), :class => "avatar"), user_path(notification.author) %>
+
+
+
+ <%= link_to_user(notification.author) %>
+ <%= l(:label_project_notice) %>
+ <%= link_to notification.title.truncate(35, omission: '...'), contest_contestnotifications_path(notification.contest_id) %>
+
+
+ <%= notification.description.truncate(30, omission: '...') %>
+ <%=l(:label_release_time)%>: <%=format_time notification.created_at %>
<% end %>
@@ -215,7 +227,7 @@
<%= link_to l(:label_more_information), forums_path %>
- <% find_new_forum_topics(8).each do |topic|%>
+ <% find_new_forum_topics(9 - @contest_notifications.count).each do |topic|%>
-
diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb
index 9ec745f87..f57bc97d7 100644
--- a/app/views/welcome/course.html.erb
+++ b/app/views/welcome/course.html.erb
@@ -32,10 +32,7 @@
-
- <%= image_tag '/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" %>
- 微信扫码
-
+ <%#= render partial: 'wei_xin' %>
<%= image_tag(@logoLink, width:@course_page.image_width,height: @course_page.image_height) %>
@@ -78,7 +75,7 @@
-
新开课程
+ <%= l(:lable_hot_course)%>
<% if @school_id %>
<% school_course = find_miracle_course(10,7, @school_id) %>
<% else %>
diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb
index 6745e5abe..c4f7f27a7 100644
--- a/app/views/welcome/index.html.erb
+++ b/app/views/welcome/index.html.erb
@@ -1,164 +1,195 @@
-<% @nav_dispaly_project_label = 1
- @nav_dispaly_forum_label = 1 %>
-<%= stylesheet_link_tag 'welcome' %>
-<%= javascript_include_tag 'welcome' %>
-
-
-
-
- <%= link_to image_tag('/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" ), home_path %>
- 微信扫码
-
-
-
-
- <% if get_avatar?(@first_page) %>
- <%= image_tag(url_to_avatar(@first_page), width:@first_page.image_width,height: @first_page.image_height) %>
- <% else %>
- <%= image_tag '/images/transparent.png', width:@first_page.image_width,height: @first_page.image_height %>
- <% end %>
-
-
-
- <% unless @first_page.nil? %>
-
- <%= @first_page.description.html_safe %>
- <% end %>
-
-
- <%= render :partial => "search_project", :locals => {:project_type => 0}%>
-
-
-
-
-
-
-
-
-热门项目
- <%= link_to "更多>>", { :controller => 'projects', :action => 'index', :project_type => 0, :host => Setting.project_domain}, :target => "_blank" %>
-
-
- <% #projects = find_miracle_project(10, 3) %>
- <% @projects.map do |project| %>
-
- -
-
- <%= image_tag(get_project_avatar(project), :class => "avatar-4") %>
-
-
-
- <% unless project.is_public %>
- <%= l(:label_private) %>
- <% end %>
- <%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%>
- (<%= link_to "#{projectCount(project)}人", project_member_path(project) ,:course =>'0' %>)
-
-
- <%=project.description.truncate(100, omission: '...')%>
-
-
- <%= content_tag "span", l(:label_project_score)+ ":" + red_project_scores(project).to_i.to_s,
- :style => "cursor: pointer; display: inline-block; float: right; color: #ec6300;",
- :title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度",
- :class => "tooltip",
- :id => "tooltip-#{project.id}" %>
-
-
-
- <% end; reset_cycle %>
-
-
-
-
-
-
- 用户动态
- <%= link_to "更多>>", { :controller => 'users', :action => 'index'}, :target => "_blank" %>
-
- <%activities = find_all_activities%>
- <% activities.each do |event| %>
-
- -
-
- <%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
-
-
-
- <%= link_to event.event_author, (user_path(event.event_author) if event.event_author), :style => "color:green;", :target => "_blank" %><%= show_user_content event %>
-
<%= l(:field_updated_on) %><%= time_tag_welcome event.event_datetime %>前 <%= show_event_reply event %>
-
-
-
- <% end %>
-
-
-
-
-
-
-
-
-
- 贴吧动态
- <%= link_to "我要提问" , newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
- <%= link_to "我要反馈" , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
- <%= link_to "更多>>", forums_path %>
-
-
-
- <% topics = find_new_forum_topics(7) %>
- <% topics.includes(:forum, :last_reply, :author).each do |topic|%>
-
- -
-
- <%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %><%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url,title: topic.subject %>
-
-
-
- <%= "#{l(:label_updated_time, value: time_tag_welcome(topic_last_time topic))}".html_safe %>
-
-
- 楼主: <%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %>
-
-
- 最后回复:<% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %><%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%><% end %>
-
-
- 回复(<%= link_to topic.try(:replies_count), topic.event_url %>)
-
-
-
-
- <% end %>
-
-
-
-
-
-
+<% @nav_dispaly_project_label = 1
+ @nav_dispaly_forum_label = 1 %>
+<%= stylesheet_link_tag 'welcome' %>
+<%= javascript_include_tag 'welcome' %>
+
+
+
+ <%#= render partial: 'wei_xin' %>
+
+
+
+ <% if get_avatar?(@first_page) %>
+ <%= image_tag(url_to_avatar(@first_page), width:@first_page.image_width,height: @first_page.image_height) %>
+ <% else %>
+ <%= image_tag '/images/transparent.png', width:@first_page.image_width,height: @first_page.image_height %>
+ <% end %>
+
+
+
+ <% unless @first_page.nil? %>
+ <%= @first_page.description.html_safe %>
+ <% end %>
+
+
+ <%= render :partial => "search_project", :locals => {:project_type => 0}%>
+
+
+
+
+
+
+
+
+
+ <%= l(:lable_hot_projects)%>
+
+
+ <% if User.current.logged? %>
+ <%= link_to(l(:label_project_new), {:controller => 'projects',
+ :action => 'new',
+ :course => 0,
+ :project_type =>( @project_type||=0)},
+ :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %>
+ <% end %>
+
+ <%= link_to l(:label_more), { :controller => 'projects',
+ :action => 'index',
+ :project_type => 0,
+ :host => Setting.project_domain},
+ :target => "_blank" %>
+
+
+
+ <% #projects = find_miracle_project(10, 3) %>
+ <% @projects.map do |project| %>
+
+ -
+
+ <%= image_tag(get_project_avatar(project), :class => "avatar-4") %>
+
+
+
+ <% unless project.is_public %>
+ <%= l(:label_private) %>
+ <% end %>
+ <%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%>
+ (<%= link_to "#{projectCount(project)}人", project_member_path(project) ,:course =>'0' %>)
+
+
+
+ <%=project.description.truncate(100, omission: '...')%>
+
+
+
+ <%= content_tag "span", l(:label_project_score)+ ":" + red_project_scores(project).to_i.to_s,
+ :style => "cursor: pointer; display: inline-block; float: right; color: #ec6300;",
+ :title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度",
+ :class => "tooltip",
+ :id => "tooltip-#{project.id}" %>
+
+
+
+ <% end; reset_cycle %>
+
+
+
+
+
+
+ <%= l(:lable_user_active)%>
+ <%= link_to l(:label_more), { :controller => 'users', :action => 'index'}, :target => "_blank" %>
+
+ <%activities = find_all_activities%>
+ <% activities.each do |event| %>
+
+ -
+
+ <%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
+
+
+
+
+ <%= link_to event.event_author, (user_path(event.event_author) if event.event_author),
+ :style => "color:green;", :target => "_blank" %>
+
+ <%= show_user_content event %>
+
+
+ <%= l(:field_updated_on) %>
+ <%= time_tag_welcome event.event_datetime %>前
+
+
+
+ <%= show_event_reply event %>
+
+
+
+
+ <% end %>
+
+
+
+
+
+
+
+
+
+ <%= l(:lable_bar_active)%>
+ <%= link_to l(:label_my_question) , newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
+ <%= link_to l(:label_my_feedback) , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
+
+ <%= link_to l(:label_more), forums_path %>
+
+
+ <% topics = find_new_forum_topics(7) %>
+ <% topics.includes(:forum, :last_reply, :author).each do |topic|%>
+
+ -
+
+ <%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %>
+ <%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url,title: topic.subject %>
+
+
+
+ <%= "#{l(:label_updated_time, value: time_tag_welcome(topic_last_time topic))}".html_safe %>
+
+
+ <%= l(:label_question_sponsor)%>:
+ <%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %>
+
+
+ <%= l(:label_final_reply)%>:
+ <% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %>
+ <%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%>
+ <% end %>
+
+
+ <%= l(:label_reply)%>
+ (<%= link_to topic.try(:replies_count), topic.event_url %>)
+
+
+
+
+ <% end %>
+
+
+
+
+
<%= render partial: 'link_to_another' %>
\ No newline at end of file
diff --git a/app/views/words/_feedback.html.erb b/app/views/words/_feedback.html.erb
index 774ee3b64..48460e449 100644
--- a/app/views/words/_feedback.html.erb
+++ b/app/views/words/_feedback.html.erb
@@ -22,7 +22,7 @@
<% if User.current.logged? %>
<% if journal.user_id==User.current.id|| User.current.admin? %>
<%= link_to(l(:button_delete),{:controller => 'words', :action => 'destroyJournal', :object_id => journal.id, :project_id=>@project.id, :page=>@page},
- :remote => true, :title => l(:button_delete)) %>
+ :remote => true, :title => l(:button_delete), :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete") %>
<% end %>
<% end %>
diff --git a/config/environment.rb b/config/environment.rb
index f44e25ae3..b105e8e25 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -13,3 +13,16 @@ end
# Initialize the rails application
RedmineApp::Application.initialize!
+
+#日志格式
+class Logger
+ def format_message(level, time, progname, msg)
+ "#{time.to_s(:db)} #{level} -- #{msg}\r\n"
+ end
+end
+
+#输出日志(database文件夹下get、sql、controller按照日期 分别输出路由信息、SQL语句、调用页面)[影响系统效率使用完请注释掉]
+#include LoggerHelper
+#LoggerHelper.OutLogger
+
+
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index e5922e6a6..27589e5f1 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -232,9 +232,6 @@ zh:
mail_body_wiki_content_added: "'%{id}' wiki页面已由 %{author} 添加。"
mail_subject_wiki_content_updated: "'%{id}' wiki页面已更新。"
mail_body_wiki_content_updated: "'%{id}' wiki页面已由 %{author} 更新。"
-
-
-
field_name: 名称
#added by huang
field_tea_name: 教师
@@ -1940,7 +1937,7 @@ zh:
label_forum_edit: 编辑讨论区
label_memo_create: 发布
label_memo_new: 新建主题
- label_memo_edit: 修改主题label_board_new
+ label_memo_edit: 修改主题
label_memo_new_from_forum: 发布帖子
label_forum: 公共贴吧
label_forum_new: 新建贴吧
@@ -2080,7 +2077,7 @@ zh:
label_current_hot_contest: 最新热门竞赛
label_current_attendingcontest_work: 最新参赛作品
label_issue_feedback_activities: 问题和反馈动态
- label_more_information: 更多...
+ label_more_information: 更多>>
label_my_question: 我要提问
label_my_feedback: 我要反馈
label_release_time: 发布时间
@@ -2126,4 +2123,9 @@ zh:
label_my_school: 我的学校
label_all_schol: 全部学校
label_select_province: 请选择省份
- label_search_conditions_not_null: 搜索条件不能为空
\ No newline at end of file
+ label_search_conditions_not_null: 搜索条件不能为空
+
+ lable_hot_course: 活跃课程
+ lable_hot_projects: 热门项目
+ lable_user_active: 用户动态
+ lable_bar_active: 贴吧动态
diff --git a/config/routes.rb b/config/routes.rb
index 89578ae6f..c4584ea7b 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -724,7 +724,7 @@ RedmineApp::Application.routes.draw do
# added by young
match 'calls', :to => 'bids#index'
- match 'calls/:id', :to => 'bid#show', :as => 'respond'
+ match 'calls/:id', :to => 'bids#show', :as => 'respond'
# modified by longjun
# bids#contests is not exist
# match 'contest', :to => 'bids#contests', :as => 'contest' #modified @20140403
diff --git a/db/migrate/20140916005319_update_works_categories.rb b/db/migrate/20140916005319_update_works_categories.rb
new file mode 100644
index 000000000..e4cf812bf
--- /dev/null
+++ b/db/migrate/20140916005319_update_works_categories.rb
@@ -0,0 +1,26 @@
+# -*coding:utf-8 -*-
+class UpdateWorksCategories < ActiveRecord::Migration
+ def up
+ WorksCategory.all.each do |wc|
+ wc.destroy
+ end
+
+ workscategory1 = WorksCategory.new
+ workscategory1.category = "开源软件"
+ workscategory1.save
+
+ workscategory2 = WorksCategory.new
+ workscategory2.category = "移动APP"
+ workscategory2.save
+
+ workscategory3 = WorksCategory.new
+ workscategory3.category = "其他"
+ workscategory3.save
+ end
+
+ def down
+ WorksCategory.all.each do |wc|
+ wc.destroy
+ end
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 95c52cca3..ebf24f547 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20140826072838) do
+ActiveRecord::Schema.define(:version => 20140916005319) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -878,18 +878,18 @@ ActiveRecord::Schema.define(:version => 20140826072838) do
create_table "relative_memos", :force => true do |t|
t.integer "osp_id"
t.integer "parent_id"
- t.string "subject", :null => false
- t.text "content", :null => false
+ t.string "subject", :null => false
+ t.text "content", :limit => 16777215, :null => false
t.integer "author_id"
- t.integer "replies_count", :default => 0
+ t.integer "replies_count", :default => 0
t.integer "last_reply_id"
- t.boolean "lock", :default => false
- t.boolean "sticky", :default => false
- t.boolean "is_quote", :default => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "viewed_count_crawl", :default => 0
- t.integer "viewed_count_local", :default => 0
+ t.boolean "lock", :default => false
+ t.boolean "sticky", :default => false
+ t.boolean "is_quote", :default => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.integer "viewed_count_crawl", :default => 0
+ t.integer "viewed_count_local", :default => 0
t.string "url"
t.string "username"
t.string "userhomeurl"
@@ -976,10 +976,11 @@ ActiveRecord::Schema.define(:version => 20140826072838) do
t.string "url"
t.string "title"
t.integer "share_type"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.integer "project_id"
t.integer "user_id"
+ t.string "description"
end
create_table "softapplications", :force => true do |t|
@@ -1085,8 +1086,8 @@ ActiveRecord::Schema.define(:version => 20140826072838) do
t.integer "zip_code"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
- t.integer "identity"
t.string "technical_title"
+ t.integer "identity"
t.string "student_id"
t.string "teacher_realname"
t.string "student_realname"
@@ -1144,9 +1145,6 @@ ActiveRecord::Schema.define(:version => 20140826072838) do
t.integer "active"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
- t.integer "level"
- t.integer "file"
- t.integer "issue"
end
create_table "user_statuses", :force => true do |t|
diff --git a/public/javascripts/welcome.js b/public/javascripts/welcome.js
index a0166bb3f..13466edd0 100644
--- a/public/javascripts/welcome.js
+++ b/public/javascripts/welcome.js
@@ -60,5 +60,10 @@
fixedBar('backTopBtn' , {autoHidden: true, top : 186});
fixedBar('identifier-pannel' , {autoHidden: false , top : 956 , show : true});
+ //修改微信扫码样式布局后添加微信扫码跟随滚动处理
+ $(window).scroll(function(){
+ var vtop=$(document).scrollTop();
+ $("#identifier-pannel").css('top',vtop+"px");
+ })
}
})();
\ No newline at end of file
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index 72b379585..1fda63f93 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -2794,3 +2794,19 @@ div.repos_explain{
padding-top: 20px;
padding-bottom: 20px;
}
+
+.button-canel{
+ padding-bottom: 5px;
+ width: auto;
+ height: 25px;
+ font-family: '微软雅黑',Arial,Helvetica,sans-serif;
+ font-size: 12px;
+ color: #ffffff;
+ padding: 3px 9px;
+ background: #15bccf;
+ border-radius: 4px;
+ border: 1px solid #15bccf;
+ box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.2), 0px 0px 2px rgb(255, 255, 255) inset;
+ text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.2), 0px 1px 0px rgb(255, 255, 255);
+ cursor: pointer;
+}
diff --git a/public/stylesheets/welcome.css b/public/stylesheets/welcome.css
index c6bdd1ab5..3e333d231 100644
--- a/public/stylesheets/welcome.css
+++ b/public/stylesheets/welcome.css
@@ -340,7 +340,7 @@ a.attachments_list_color {
}
#identifier-pannel{
- position:fixed;
+ position:absolute;
left: 50%;
bottom:0;
z-index:9999;
+ <%= link_to image_tag(url_to_avatar(notification.author), :class => "avatar"), user_path(notification.author) %>
+
+
+
+ <%= link_to_user(notification.author) %>
+ <%= l(:label_project_notice) %>
+ <%= link_to notification.title.truncate(35, omission: '...'), contest_contestnotifications_path(notification.contest_id) %>
+
+
+ <%= notification.description.truncate(30, omission: '...') %>
+ <%=l(:label_release_time)%>: <%=format_time notification.created_at %>
-
- <% find_new_forum_topics(8).each do |topic|%>
+ <% find_new_forum_topics(9 - @contest_notifications.count).each do |topic|%>
-
diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb index 9ec745f87..f57bc97d7 100644 --- a/app/views/welcome/course.html.erb +++ b/app/views/welcome/course.html.erb @@ -32,10 +32,7 @@-- <%= image_tag '/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" %> -+ <%#= render partial: 'wei_xin' %>微信扫码-<%= image_tag(@logoLink, width:@course_page.image_width,height: @course_page.image_height) %> @@ -78,7 +75,7 @@-
新开课程
+<%= l(:lable_hot_course)%>
<% if @school_id %> <% school_course = find_miracle_course(10,7, @school_id) %> <% else %> diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index 6745e5abe..c4f7f27a7 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -1,164 +1,195 @@ -<% @nav_dispaly_project_label = 1 - @nav_dispaly_forum_label = 1 %> -<%= stylesheet_link_tag 'welcome' %> -<%= javascript_include_tag 'welcome' %> - - --- - - -- <%= link_to image_tag('/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" ), home_path %> --微信扫码---- - <% if get_avatar?(@first_page) %> - <%= image_tag(url_to_avatar(@first_page), width:@first_page.image_width,height: @first_page.image_height) %> - <% else %> - <%= image_tag '/images/transparent.png', width:@first_page.image_width,height: @first_page.image_height %> - <% end %> - --- <% unless @first_page.nil? %> - - <%= @first_page.description.html_safe %> - <% end %> --- <%= render :partial => "search_project", :locals => {:project_type => 0}%> -- --- -热门项目
- <%= link_to "更多>>", { :controller => 'projects', :action => 'index', :project_type => 0, :host => Setting.project_domain}, :target => "_blank" %> ----
- <% #projects = find_miracle_project(10, 3) %>
- <% @projects.map do |project| %>
-
-
-
- - <%= image_tag(get_project_avatar(project), :class => "avatar-4") %> -- -- <% unless project.is_public %> - <%= l(:label_private) %> - <% end %> - <%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%> - (<%= link_to "#{projectCount(project)}人", project_member_path(project) ,:course =>'0' %>) --- <%=project.description.truncate(100, omission: '...')%> --- <%= content_tag "span", l(:label_project_score)+ ":" + red_project_scores(project).to_i.to_s, - :style => "cursor: pointer; display: inline-block; float: right; color: #ec6300;", - :title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度", - :class => "tooltip", - :id => "tooltip-#{project.id}" %> --
-
- <% end; reset_cycle %>
-
-- --
-
-
- - <%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %> -- -- <%= link_to event.event_author, (user_path(event.event_author) if event.event_author), :style => "color:green;", :target => "_blank" %><%= show_user_content event %> --
<%= l(:field_updated_on) %><%= time_tag_welcome event.event_datetime %>前 <%= show_event_reply event %>
-
-
- <% end %>
-
用户动态
- <%= link_to "更多>>", { :controller => 'users', :action => 'index'}, :target => "_blank" %> -- <%activities = find_all_activities%> - <% activities.each do |event| %> - ---- - - +<% @nav_dispaly_project_label = 1 + @nav_dispaly_forum_label = 1 %> +<%= stylesheet_link_tag 'welcome' %> +<%= javascript_include_tag 'welcome' %> + + +-
-
-
-
- - <%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %><%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url,title: topic.subject %> --- - <%= "#{l(:label_updated_time, value: time_tag_welcome(topic_last_time topic))}".html_safe %> - - - 楼主: <%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %> - - - 最后回复:<% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %><%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%><% end %> - - - 回复(<%= link_to topic.try(:replies_count), topic.event_url %>) - --
-
- <% end %>
-
-- -- 贴吧动态 - <%= link_to "我要提问" , newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%> - <%= link_to "我要反馈" , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
- <%= link_to "更多>>", forums_path %> -- <% topics = find_new_forum_topics(7) %> - <% topics.includes(:forum, :last_reply, :author).each do |topic|%> - --+ <%#= render partial: 'wei_xin' %> ++ + + ++++ + <% if get_avatar?(@first_page) %> + <%= image_tag(url_to_avatar(@first_page), width:@first_page.image_width,height: @first_page.image_height) %> + <% else %> + <%= image_tag '/images/transparent.png', width:@first_page.image_width,height: @first_page.image_height %> + <% end %> + +++ <% unless @first_page.nil? %> + <%= @first_page.description.html_safe %> + <% end %> +++ <%= render :partial => "search_project", :locals => {:project_type => 0}%> ++ +++ ++ <%= l(:lable_hot_projects)%> +
+ + <% if User.current.logged? %> + <%= link_to(l(:label_project_new), {:controller => 'projects', + :action => 'new', + :course => 0, + :project_type =>( @project_type||=0)}, + :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %> + <% end %> + + <%= link_to l(:label_more), { :controller => 'projects', + :action => 'index', + :project_type => 0, + :host => Setting.project_domain}, + :target => "_blank" %> + +++-
+ <% #projects = find_miracle_project(10, 3) %>
+ <% @projects.map do |project| %>
+
+
-
+ + <%= image_tag(get_project_avatar(project), :class => "avatar-4") %> ++ ++ <% unless project.is_public %> + <%= l(:label_private) %> + <% end %> + <%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%> + (<%= link_to "#{projectCount(project)}人", project_member_path(project) ,:course =>'0' %>) +++ + <%=project.description.truncate(100, omission: '...')%> + +++ <%= content_tag "span", l(:label_project_score)+ ":" + red_project_scores(project).to_i.to_s, + :style => "cursor: pointer; display: inline-block; float: right; color: #ec6300;", + :title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度", + :class => "tooltip", + :id => "tooltip-#{project.id}" %> ++
+
+ <% end; reset_cycle %>
+
++ +-
+
-
+ + <%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %> ++ ++ + <%= link_to event.event_author, (user_path(event.event_author) if event.event_author), + :style => "color:green;", :target => "_blank" %> + + <%= show_user_content event %> ++
+ + <%= l(:field_updated_on) %> + <%= time_tag_welcome event.event_datetime %>前 + + + + <%= show_event_reply event %> + +
+
+ <% end %>
+
<%= l(:lable_user_active)%>
+ <%= link_to l(:label_more), { :controller => 'users', :action => 'index'}, :target => "_blank" %> ++ <%activities = find_all_activities%> + <% activities.each do |event| %> + ++++ + <%= render partial: 'link_to_another' %> \ No newline at end of file diff --git a/app/views/words/_feedback.html.erb b/app/views/words/_feedback.html.erb index 774ee3b64..48460e449 100644 --- a/app/views/words/_feedback.html.erb +++ b/app/views/words/_feedback.html.erb @@ -22,7 +22,7 @@ <% if User.current.logged? %> <% if journal.user_id==User.current.id|| User.current.admin? %> <%= link_to(l(:button_delete),{:controller => 'words', :action => 'destroyJournal', :object_id => journal.id, :project_id=>@project.id, :page=>@page}, - :remote => true, :title => l(:button_delete)) %> + :remote => true, :title => l(:button_delete), :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete") %> <% end %> <% end %> diff --git a/config/environment.rb b/config/environment.rb index f44e25ae3..b105e8e25 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -13,3 +13,16 @@ end # Initialize the rails application RedmineApp::Application.initialize! + +#日志格式 +class Logger + def format_message(level, time, progname, msg) + "#{time.to_s(:db)} #{level} -- #{msg}\r\n" + end +end + +#输出日志(database文件夹下get、sql、controller按照日期 分别输出路由信息、SQL语句、调用页面)[影响系统效率使用完请注释掉] +#include LoggerHelper +#LoggerHelper.OutLogger + + diff --git a/config/locales/zh.yml b/config/locales/zh.yml index e5922e6a6..27589e5f1 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -232,9 +232,6 @@ zh: mail_body_wiki_content_added: "'%{id}' wiki页面已由 %{author} 添加。" mail_subject_wiki_content_updated: "'%{id}' wiki页面已更新。" mail_body_wiki_content_updated: "'%{id}' wiki页面已由 %{author} 更新。" - - - field_name: 名称 #added by huang field_tea_name: 教师 @@ -1940,7 +1937,7 @@ zh: label_forum_edit: 编辑讨论区 label_memo_create: 发布 label_memo_new: 新建主题 - label_memo_edit: 修改主题label_board_new + label_memo_edit: 修改主题 label_memo_new_from_forum: 发布帖子 label_forum: 公共贴吧 label_forum_new: 新建贴吧 @@ -2080,7 +2077,7 @@ zh: label_current_hot_contest: 最新热门竞赛 label_current_attendingcontest_work: 最新参赛作品 label_issue_feedback_activities: 问题和反馈动态 - label_more_information: 更多... + label_more_information: 更多>> label_my_question: 我要提问 label_my_feedback: 我要反馈 label_release_time: 发布时间 @@ -2126,4 +2123,9 @@ zh: label_my_school: 我的学校 label_all_schol: 全部学校 label_select_province: 请选择省份 - label_search_conditions_not_null: 搜索条件不能为空 \ No newline at end of file + label_search_conditions_not_null: 搜索条件不能为空 + + lable_hot_course: 活跃课程 + lable_hot_projects: 热门项目 + lable_user_active: 用户动态 + lable_bar_active: 贴吧动态 diff --git a/config/routes.rb b/config/routes.rb index 89578ae6f..c4584ea7b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -724,7 +724,7 @@ RedmineApp::Application.routes.draw do # added by young match 'calls', :to => 'bids#index' - match 'calls/:id', :to => 'bid#show', :as => 'respond' + match 'calls/:id', :to => 'bids#show', :as => 'respond' # modified by longjun # bids#contests is not exist # match 'contest', :to => 'bids#contests', :as => 'contest' #modified @20140403 diff --git a/db/migrate/20140916005319_update_works_categories.rb b/db/migrate/20140916005319_update_works_categories.rb new file mode 100644 index 000000000..e4cf812bf --- /dev/null +++ b/db/migrate/20140916005319_update_works_categories.rb @@ -0,0 +1,26 @@ +# -*coding:utf-8 -*- +class UpdateWorksCategories < ActiveRecord::Migration + def up + WorksCategory.all.each do |wc| + wc.destroy + end + + workscategory1 = WorksCategory.new + workscategory1.category = "开源软件" + workscategory1.save + + workscategory2 = WorksCategory.new + workscategory2.category = "移动APP" + workscategory2.save + + workscategory3 = WorksCategory.new + workscategory3.category = "其他" + workscategory3.save + end + + def down + WorksCategory.all.each do |wc| + wc.destroy + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 95c52cca3..ebf24f547 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20140826072838) do +ActiveRecord::Schema.define(:version => 20140916005319) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -878,18 +878,18 @@ ActiveRecord::Schema.define(:version => 20140826072838) do create_table "relative_memos", :force => true do |t| t.integer "osp_id" t.integer "parent_id" - t.string "subject", :null => false - t.text "content", :null => false + t.string "subject", :null => false + t.text "content", :limit => 16777215, :null => false t.integer "author_id" - t.integer "replies_count", :default => 0 + t.integer "replies_count", :default => 0 t.integer "last_reply_id" - t.boolean "lock", :default => false - t.boolean "sticky", :default => false - t.boolean "is_quote", :default => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "viewed_count_crawl", :default => 0 - t.integer "viewed_count_local", :default => 0 + t.boolean "lock", :default => false + t.boolean "sticky", :default => false + t.boolean "is_quote", :default => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "viewed_count_crawl", :default => 0 + t.integer "viewed_count_local", :default => 0 t.string "url" t.string "username" t.string "userhomeurl" @@ -976,10 +976,11 @@ ActiveRecord::Schema.define(:version => 20140826072838) do t.string "url" t.string "title" t.integer "share_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.integer "project_id" t.integer "user_id" + t.string "description" end create_table "softapplications", :force => true do |t| @@ -1085,8 +1086,8 @@ ActiveRecord::Schema.define(:version => 20140826072838) do t.integer "zip_code" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.integer "identity" t.string "technical_title" + t.integer "identity" t.string "student_id" t.string "teacher_realname" t.string "student_realname" @@ -1144,9 +1145,6 @@ ActiveRecord::Schema.define(:version => 20140826072838) do t.integer "active" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.integer "level" - t.integer "file" - t.integer "issue" end create_table "user_statuses", :force => true do |t| diff --git a/public/javascripts/welcome.js b/public/javascripts/welcome.js index a0166bb3f..13466edd0 100644 --- a/public/javascripts/welcome.js +++ b/public/javascripts/welcome.js @@ -60,5 +60,10 @@ fixedBar('backTopBtn' , {autoHidden: true, top : 186}); fixedBar('identifier-pannel' , {autoHidden: false , top : 956 , show : true}); + //修改微信扫码样式布局后添加微信扫码跟随滚动处理 + $(window).scroll(function(){ + var vtop=$(document).scrollTop(); + $("#identifier-pannel").css('top',vtop+"px"); + }) } })(); \ No newline at end of file diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 72b379585..1fda63f93 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -2794,3 +2794,19 @@ div.repos_explain{ padding-top: 20px; padding-bottom: 20px; } + +.button-canel{ + padding-bottom: 5px; + width: auto; + height: 25px; + font-family: '微软雅黑',Arial,Helvetica,sans-serif; + font-size: 12px; + color: #ffffff; + padding: 3px 9px; + background: #15bccf; + border-radius: 4px; + border: 1px solid #15bccf; + box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.2), 0px 0px 2px rgb(255, 255, 255) inset; + text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.2), 0px 1px 0px rgb(255, 255, 255); + cursor: pointer; +} diff --git a/public/stylesheets/welcome.css b/public/stylesheets/welcome.css index c6bdd1ab5..3e333d231 100644 --- a/public/stylesheets/welcome.css +++ b/public/stylesheets/welcome.css @@ -340,7 +340,7 @@ a.attachments_list_color { } #identifier-pannel{ - position:fixed; + position:absolute; left: 50%; bottom:0; z-index:9999;-
+
+
-
+ + <%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %> + <%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url,title: topic.subject %> +++ + <%= "#{l(:label_updated_time, value: time_tag_welcome(topic_last_time topic))}".html_safe %> + + + <%= l(:label_question_sponsor)%>: + <%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %> + + + <%= l(:label_final_reply)%>: + <% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %> + <%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%> + <% end %> + + + <%= l(:label_reply)%> + (<%= link_to topic.try(:replies_count), topic.event_url %>) + ++
+
+ <% end %>
+
+++ <%= l(:lable_bar_active)%> + <%= link_to l(:label_my_question) , newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%> + <%= link_to l(:label_my_feedback) , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%> +
+ <%= link_to l(:label_more), forums_path %> ++ <% topics = find_new_forum_topics(7) %> + <% topics.includes(:forum, :last_reply, :author).each do |topic|%> + ++ -
-