From 0e03798f6e8f2075fae224089f3f39bdade47b56 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 23 May 2016 16:24:32 +0800 Subject: [PATCH 001/126] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=A1=86=E6=9E=B6?= =?UTF-8?q?=E7=BB=93=E6=9E=84=EF=BC=88yeild=EF=BC=89=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 2 +- app/views/layouts/base_org2.html.erb | 38 +----- app/views/organizations/_show_type2.html.erb | 33 +++++ app/views/organizations/show.html.erb | 122 ++++++++++--------- 4 files changed, 102 insertions(+), 93 deletions(-) create mode 100644 app/views/organizations/_show_type2.html.erb diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 3ab62bbea..2ab724728 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -76,7 +76,7 @@ class OrganizationsController < ApplicationController def show # 组织新类型 show_mode:判断标准 1为新类型,0为旧 - if @organization.show_mode.to_i == 1 && params[:org_subfield_id].nil? && params[:list] .nil? + if @organization.switch_type && params[:org_subfield_id].nil? && params[:list] .nil? if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization) # REDO:时间紧,暂时先这样 @org_logo_attchment = Attachment.find_by_sql("SELECT * from attachments WHERE container_id = #{@organization.id} and container_type = 'Organization' and attachtype = 0 and filename REGEXP '(.jpg|.png|.bmp|.gif|.jpeg)' ORDER BY created_on desc limit 1").first diff --git a/app/views/layouts/base_org2.html.erb b/app/views/layouts/base_org2.html.erb index 799aaa42b..e51a62e24 100644 --- a/app/views/layouts/base_org2.html.erb +++ b/app/views/layouts/base_org2.html.erb @@ -14,7 +14,7 @@ <%= javascript_include_tag 'attachments' %> <%#= call_hook :view_layouts_base_html_head %> - <%#= yield :header_tags -%> + <%= yield :header_tags -%> - <% act = OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?", @organization.home_id).first %> - <%= render :partial => 'show_home_page', :locals => {:document => OrgDocumentComment.find(@organization.home_id), :home_id => @organization.home_id, :act => act} %> -<% end %> -<% if @org_activities %> - <%= render :partial => 'organizations/org_activities', - :locals => {:org_activities => @org_activities, - :page=> @page, - :org => @organization, - :org_act_count=> @org_activities.count} %> + <% end %> + + <% end %> + <% if !@organization.home_id.nil? and OrgDocumentComment.where("id = ?", @organization.home_id).count > 0 and params[:org_subfield_id].nil? %> + + <% act = OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?", @organization.home_id).first %> + <%= render :partial => 'show_home_page', :locals => {:document => OrgDocumentComment.find(@organization.home_id), :home_id => @organization.home_id, :act => act} %> + <% end %> + <% if @org_activities %> + <%= render :partial => 'organizations/org_activities', + :locals => {:org_activities => @org_activities, + :page=> @page, + :org => @organization, + :org_act_count=> @org_activities.count} %> + <% end %> <% end %> @@ -70,3 +75,4 @@ + From ed7c6cbcfe62d37513f567eb517760f97e4a3b47 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 24 May 2016 09:40:16 +0800 Subject: [PATCH 002/126] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E5=B8=96=E5=AD=90=E5=A2=9E=E5=87=8Fstatus=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org_document_comments_controller.rb | 1 + app/models/org_document_comment.rb | 3 +- .../org_document_comments/_form.html.erb | 34 ++ app/views/org_document_comments/edit.html.erb | 29 -- app/views/org_document_comments/new.html.erb | 31 +- app/views/organizations/show.html.erb | 4 +- db/schema.rb | 436 +++++++++++++++++- 7 files changed, 454 insertions(+), 84 deletions(-) create mode 100644 app/views/org_document_comments/_form.html.erb diff --git a/app/controllers/org_document_comments_controller.rb b/app/controllers/org_document_comments_controller.rb index 82062d3dd..b012ba901 100644 --- a/app/controllers/org_document_comments_controller.rb +++ b/app/controllers/org_document_comments_controller.rb @@ -12,6 +12,7 @@ class OrgDocumentCommentsController < ApplicationController @org_document_comment = OrgDocumentComment.new(:organization_id => @organization.id, :creator_id => User.current.id) @org_document_comment.title = params[:org_document_comment][:title] @org_document_comment.content = params[:org_document_comment][:content] + @org_document_comment.status = params[:org_document_comment][:status] == "on" ? 1 : 0 @org_document_comment.save_attachments(params[:attachments]) if params[:field_id] @org_document_comment.org_subfield_id = params[:field_id].to_i diff --git a/app/models/org_document_comment.rb b/app/models/org_document_comment.rb index 5aa3c1dab..dd070c825 100644 --- a/app/models/org_document_comment.rb +++ b/app/models/org_document_comment.rb @@ -1,5 +1,6 @@ class OrgDocumentComment < ActiveRecord::Base - attr_accessible :content, :creator_id, :organization_id, :parent_id, :reply_id, :title,:sticky,:locked + # status: 1 模式二中置顶 0:模式二中正常显示 + attr_accessible :content, :creator_id, :organization_id, :parent_id, :reply_id, :title, :sticky, :locked, :status include Redmine::SafeAttributes include ApplicationHelper belongs_to :organization diff --git a/app/views/org_document_comments/_form.html.erb b/app/views/org_document_comments/_form.html.erb new file mode 100644 index 000000000..502da97ad --- /dev/null +++ b/app/views/org_document_comments/_form.html.erb @@ -0,0 +1,34 @@ +
+ +
+
+
+
+
+
+ + <%#= kindeditor_tag 'org_document_comment[content]','', :editor_id => 'org_document_description_editor', :height => "150px" %> +
+
+

+

+

+
+
置顶显示 : + (仅限模式二) +
+
+
+
+ <%= render :partial => 'org_document_comments/attachment', :locals => {:container => nil} %> +
+
+
+ +
+ 确定 + + 取消 +
+
+
\ No newline at end of file diff --git a/app/views/org_document_comments/edit.html.erb b/app/views/org_document_comments/edit.html.erb index 5997482fb..a36397677 100644 --- a/app/views/org_document_comments/edit.html.erb +++ b/app/views/org_document_comments/edit.html.erb @@ -28,36 +28,7 @@
<%= form_tag url_for(:controller => 'org_document_comments',:action => 'update', :id => @org_document.id, :flag => @flag, :org_subfield_id => params[:org_subfield_id]),:method => 'put', :id => 'new_org_document_form' do |f| %> -
- -
-
-
-
-
- - <%#= kindeditor_tag 'org_document_comment[content]','', :editor_id => 'org_document_description_editor', :height => "150px" %> -
-
-

-

-

-
- -
-
- <%= render :partial => 'org_document_comments/attachment', :locals => {:container => @org_document} %> -
-
-
-
- 确定 - - 取消 -
-
-
<% end %>
\ No newline at end of file diff --git a/app/views/org_document_comments/new.html.erb b/app/views/org_document_comments/new.html.erb index cf4ffddcf..ed327dece 100644 --- a/app/views/org_document_comments/new.html.erb +++ b/app/views/org_document_comments/new.html.erb @@ -37,35 +37,6 @@
<%= form_tag organization_org_document_comments_path(:organization_id => @organization.id, :field_id => params[:field_id]), :id => 'new_org_document_form' do |f| %> -
- -
-
-
-
-
-
- - <%#= kindeditor_tag 'org_document_comment[content]','', :editor_id => 'org_document_description_editor', :height => "150px" %> -
-
-

-

-

-
-
-
- <%= render :partial => 'org_document_comments/attachment', :locals => {:container => nil} %> -
-
-
- -
- 确定 - - 取消 -
-
-
+ <%= render :partial => "form" %> <% end %>
diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb index db3849de9..c490efb85 100644 --- a/app/views/organizations/show.html.erb +++ b/app/views/organizations/show.html.erb @@ -1,5 +1,5 @@ -<%# 区分两种模式 %> -<% if @organization.switch_type %> +<%# 区分两种模式 params[:org_subfield_id] 不为空的时候则跳到栏目%> +<% if @organization.switch_type && params[:org_subfield_id].nil? %> <%= render :partial => 'show_type2' %> <% else %> <%= javascript_include_tag "jquery.infinitescroll.js" %> diff --git a/db/schema.rb b/db/schema.rb index 9c4b4b333..7462c304e 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 => 20160519070718) do +ActiveRecord::Schema.define(:version => 20160523085440) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -52,6 +52,28 @@ ActiveRecord::Schema.define(:version => 20160519070718) do add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token" add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id" + create_table "application_settings", :force => true do |t| + t.integer "default_projects_limit" + t.boolean "signup_enabled" + t.boolean "signin_enabled" + t.boolean "gravatar_enabled" + t.text "sign_in_text" + t.datetime "created_at" + t.datetime "updated_at" + t.string "home_page_url" + t.integer "default_branch_protection", :default => 2 + t.boolean "twitter_sharing_enabled", :default => true + t.text "restricted_visibility_levels" + t.boolean "version_check_enabled", :default => true + t.integer "max_attachment_size", :default => 10, :null => false + t.integer "default_project_visibility" + t.integer "default_snippet_visibility" + t.text "restricted_signup_domains" + t.boolean "user_oauth_applications", :default => true + t.string "after_sign_out_path" + t.integer "session_expire_delay", :default => 10080, :null => false + end + create_table "applied_projects", :force => true do |t| t.integer "project_id", :null => false t.integer "user_id", :null => false @@ -77,6 +99,18 @@ ActiveRecord::Schema.define(:version => 20160519070718) do t.datetime "updated_at", :null => false end + create_table "apply_resources", :force => true do |t| + t.integer "status" + t.integer "user_id" + t.integer "attachment_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "container_id" + t.string "container_type" + t.text "content" + t.integer "apply_user_id" + end + create_table "at_messages", :force => true do |t| t.integer "user_id" t.integer "at_message_id" @@ -144,6 +178,20 @@ ActiveRecord::Schema.define(:version => 20160519070718) do t.string "typeName", :limit => 50 end + create_table "audit_events", :force => true do |t| + t.integer "author_id", :null => false + t.string "type", :null => false + t.integer "entity_id", :null => false + t.string "entity_type", :null => false + t.text "details" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "audit_events", ["author_id"], :name => "index_audit_events_on_author_id" + add_index "audit_events", ["entity_id", "entity_type"], :name => "index_audit_events_on_entity_id_and_entity_type" + add_index "audit_events", ["type"], :name => "index_audit_events_on_type" + create_table "auth_sources", :force => true do |t| t.string "type", :limit => 30, :default => "", :null => false t.string "name", :limit => 60, :default => "", :null => false @@ -241,6 +289,17 @@ ActiveRecord::Schema.define(:version => 20160519070718) do add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id" add_index "boards", ["project_id"], :name => "boards_project_id" + create_table "broadcast_messages", :force => true do |t| + t.text "message", :null => false + t.datetime "starts_at" + t.datetime "ends_at" + t.integer "alert_type" + t.datetime "created_at" + t.datetime "updated_at" + t.string "color" + t.string "font" + end + create_table "bug_to_osps", :force => true do |t| t.integer "osp_id" t.integer "relative_memo_id" @@ -540,6 +599,10 @@ ActiveRecord::Schema.define(:version => 20160519070718) do t.integer "visits", :default => 0 end + add_index "courses", ["id"], :name => "id", :unique => true + add_index "courses", ["tea_id"], :name => "tea_id" + add_index "courses", ["visits"], :name => "visits" + create_table "custom_fields", :force => true do |t| t.string "type", :limit => 30, :default => "", :null => false t.string "name", :limit => 30, :default => "", :null => false @@ -601,6 +664,15 @@ ActiveRecord::Schema.define(:version => 20160519070718) do add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" + create_table "deploy_keys_projects", :force => true do |t| + t.integer "deploy_key_id", :null => false + t.integer "project_id", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "deploy_keys_projects", ["project_id"], :name => "index_deploy_keys_projects_on_project_id" + create_table "discuss_demos", :force => true do |t| t.string "title" t.text "body" @@ -650,6 +722,16 @@ ActiveRecord::Schema.define(:version => 20160519070718) do t.datetime "created_at" end + create_table "emails", :force => true do |t| + t.integer "user_id", :null => false + t.string "email", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "emails", ["email"], :name => "index_emails_on_email", :unique => true + add_index "emails", ["user_id"], :name => "index_emails_on_user_id" + create_table "enabled_modules", :force => true do |t| t.integer "project_id" t.string "name", :null => false @@ -672,6 +754,25 @@ ActiveRecord::Schema.define(:version => 20160519070718) do add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type" add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id" + create_table "events", :force => true do |t| + t.string "target_type" + t.integer "target_id" + t.string "title" + t.text "data" + t.integer "project_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "action" + t.integer "author_id" + end + + add_index "events", ["action"], :name => "index_events_on_action" + add_index "events", ["author_id"], :name => "index_events_on_author_id" + add_index "events", ["created_at"], :name => "index_events_on_created_at" + add_index "events", ["project_id"], :name => "index_events_on_project_id" + add_index "events", ["target_id"], :name => "index_events_on_target_id" + add_index "events", ["target_type"], :name => "index_events_on_target_type" + create_table "exercise_answers", :force => true do |t| t.integer "user_id" t.integer "exercise_question_id" @@ -774,6 +875,15 @@ ActiveRecord::Schema.define(:version => 20160519070718) do add_index "forge_messages", ["forge_message_id", "forge_message_type"], :name => "index_forge_messages_on_forge_message_id_and_forge_message_type" add_index "forge_messages", ["user_id", "project_id", "created_at"], :name => "index_forge_messages_on_user_id_and_project_id_and_created_at" + create_table "forked_project_links", :force => true do |t| + t.integer "forked_to_project_id", :null => false + t.integer "forked_from_project_id", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "forked_project_links", ["forked_to_project_id"], :name => "index_forked_project_links_on_forked_to_project_id", :unique => true + create_table "forums", :force => true do |t| t.string "name", :null => false t.text "description" @@ -903,6 +1013,17 @@ ActiveRecord::Schema.define(:version => 20160519070718) do t.datetime "updated_at", :null => false end + create_table "identities", :force => true do |t| + t.string "extern_uid" + t.string "provider" + t.integer "user_id" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "identities", ["created_at", "id"], :name => "index_identities_on_created_at_and_id" + add_index "identities", ["user_id"], :name => "index_identities_on_user_id" + create_table "invite_lists", :force => true do |t| t.integer "project_id" t.integer "user_id" @@ -1046,6 +1167,20 @@ ActiveRecord::Schema.define(:version => 20160519070718) do t.integer "private", :default => 0 end + create_table "keys", :force => true do |t| + t.integer "user_id" + t.datetime "created_at" + t.datetime "updated_at" + t.text "key" + t.string "title" + t.string "type" + t.string "fingerprint" + t.boolean "public", :default => false, :null => false + end + + add_index "keys", ["created_at", "id"], :name => "index_keys_on_created_at_and_id" + add_index "keys", ["user_id"], :name => "index_keys_on_user_id" + create_table "kindeditor_assets", :force => true do |t| t.string "asset" t.integer "file_size" @@ -1057,6 +1192,27 @@ ActiveRecord::Schema.define(:version => 20160519070718) do t.integer "owner_type", :default => 0 end + create_table "label_links", :force => true do |t| + t.integer "label_id" + t.integer "target_id" + t.string "target_type" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "label_links", ["label_id"], :name => "index_label_links_on_label_id" + add_index "label_links", ["target_id", "target_type"], :name => "index_label_links_on_target_id_and_target_type" + + create_table "labels", :force => true do |t| + t.string "title" + t.string "color" + t.integer "project_id" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "labels", ["project_id"], :name => "index_labels_on_project_id" + create_table "member_roles", :force => true do |t| t.integer "member_id", :null => false t.integer "role_id", :null => false @@ -1107,23 +1263,47 @@ ActiveRecord::Schema.define(:version => 20160519070718) do t.integer "viewed_count", :default => 0 end - create_table "mess", :id => false, :force => true do |t| - t.string "课程名" - t.integer "课程ID", :default => 0, :null => false - t.string "教师姓", :default => "", :null => false - t.string "教师名", :limit => 30, :default => "", :null => false - t.string "主贴名", :default => "", :null => false - t.integer "主贴或回帖ID", :default => 0, :null => false - t.integer "回帖对应主贴ID" - t.integer "帖子点赞数" - t.integer "主贴回复数", :default => 0, :null => false - t.text "主贴或回帖内容" - t.datetime "发帖时间", :null => false - t.integer "发帖或回帖用户ID", :default => 0, :null => false - t.string "发帖或回帖用户姓", :default => "", :null => false - t.string "发帖或回帖用户名", :limit => 30, :default => "", :null => false + create_table "merge_request_diffs", :force => true do |t| + t.string "state" + t.text "st_commits", :limit => 2147483647 + t.text "st_diffs", :limit => 2147483647 + t.integer "merge_request_id", :null => false + t.datetime "created_at" + t.datetime "updated_at" end + add_index "merge_request_diffs", ["merge_request_id"], :name => "index_merge_request_diffs_on_merge_request_id", :unique => true + + create_table "merge_requests", :force => true do |t| + t.string "target_branch", :null => false + t.string "source_branch", :null => false + t.integer "source_project_id", :null => false + t.integer "author_id" + t.integer "assignee_id" + t.string "title" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "milestone_id" + t.string "state" + t.string "merge_status" + t.integer "target_project_id", :null => false + t.integer "iid" + t.text "description" + t.integer "position", :default => 0 + t.datetime "locked_at" + end + + add_index "merge_requests", ["assignee_id"], :name => "index_merge_requests_on_assignee_id" + add_index "merge_requests", ["author_id"], :name => "index_merge_requests_on_author_id" + add_index "merge_requests", ["created_at", "id"], :name => "index_merge_requests_on_created_at_and_id" + add_index "merge_requests", ["created_at"], :name => "index_merge_requests_on_created_at" + add_index "merge_requests", ["milestone_id"], :name => "index_merge_requests_on_milestone_id" + add_index "merge_requests", ["source_branch"], :name => "index_merge_requests_on_source_branch" + add_index "merge_requests", ["source_project_id"], :name => "index_merge_requests_on_source_project_id" + add_index "merge_requests", ["target_branch"], :name => "index_merge_requests_on_target_branch" + add_index "merge_requests", ["target_project_id", "iid"], :name => "index_merge_requests_on_target_project_id_and_iid", :unique => true + add_index "merge_requests", ["title"], :name => "index_merge_requests_on_title" + create_table "message_alls", :force => true do |t| t.integer "user_id" t.integer "message_id" @@ -1158,6 +1338,39 @@ ActiveRecord::Schema.define(:version => 20160519070718) do add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id" add_index "messages", ["parent_id"], :name => "messages_parent_id" + create_table "milestones", :force => true do |t| + t.string "title", :null => false + t.integer "project_id", :null => false + t.text "description" + t.date "due_date" + t.datetime "created_at" + t.datetime "updated_at" + t.string "state" + t.integer "iid" + end + + add_index "milestones", ["created_at", "id"], :name => "index_milestones_on_created_at_and_id" + add_index "milestones", ["due_date"], :name => "index_milestones_on_due_date" + add_index "milestones", ["project_id", "iid"], :name => "index_milestones_on_project_id_and_iid", :unique => true + add_index "milestones", ["project_id"], :name => "index_milestones_on_project_id" + + create_table "namespaces", :force => true do |t| + t.string "name", :null => false + t.string "path", :null => false + t.integer "owner_id" + t.datetime "created_at" + t.datetime "updated_at" + t.string "type" + t.string "description", :default => "", :null => false + t.string "avatar" + end + + add_index "namespaces", ["created_at", "id"], :name => "index_namespaces_on_created_at_and_id" + add_index "namespaces", ["name"], :name => "index_namespaces_on_name", :unique => true + add_index "namespaces", ["owner_id"], :name => "index_namespaces_on_owner_id" + add_index "namespaces", ["path"], :name => "index_namespaces_on_path", :unique => true + add_index "namespaces", ["type"], :name => "index_namespaces_on_type" + create_table "news", :force => true do |t| t.integer "project_id" t.string "title", :limit => 60, :default => "", :null => false @@ -1183,6 +1396,31 @@ ActiveRecord::Schema.define(:version => 20160519070718) do t.datetime "updated_at", :null => false end + create_table "notes", :force => true do |t| + t.text "note" + t.string "noteable_type" + t.integer "author_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "project_id" + t.string "attachment" + t.string "line_code" + t.string "commit_id" + t.integer "noteable_id" + t.boolean "system", :default => false, :null => false + t.text "st_diff", :limit => 2147483647 + end + + add_index "notes", ["author_id"], :name => "index_notes_on_author_id" + add_index "notes", ["commit_id"], :name => "index_notes_on_commit_id" + add_index "notes", ["created_at", "id"], :name => "index_notes_on_created_at_and_id" + add_index "notes", ["created_at"], :name => "index_notes_on_created_at" + add_index "notes", ["noteable_id", "noteable_type"], :name => "index_notes_on_noteable_id_and_noteable_type" + add_index "notes", ["noteable_type"], :name => "index_notes_on_noteable_type" + add_index "notes", ["project_id", "noteable_type"], :name => "index_notes_on_project_id_and_noteable_type" + add_index "notes", ["project_id"], :name => "index_notes_on_project_id" + add_index "notes", ["updated_at"], :name => "index_notes_on_updated_at" + create_table "notificationcomments", :force => true do |t| t.string "notificationcommented_type" t.integer "notificationcommented_id" @@ -1192,6 +1430,49 @@ ActiveRecord::Schema.define(:version => 20160519070718) do t.datetime "updated_at", :null => false end + create_table "oauth_access_grants", :force => true do |t| + t.integer "resource_owner_id", :null => false + t.integer "application_id", :null => false + t.string "token", :null => false + t.integer "expires_in", :null => false + t.text "redirect_uri", :null => false + t.datetime "created_at", :null => false + t.datetime "revoked_at" + t.string "scopes" + end + + add_index "oauth_access_grants", ["token"], :name => "index_oauth_access_grants_on_token", :unique => true + + create_table "oauth_access_tokens", :force => true do |t| + t.integer "resource_owner_id" + t.integer "application_id" + t.string "token", :null => false + t.string "refresh_token" + t.integer "expires_in" + t.datetime "revoked_at" + t.datetime "created_at", :null => false + t.string "scopes" + end + + add_index "oauth_access_tokens", ["refresh_token"], :name => "index_oauth_access_tokens_on_refresh_token", :unique => true + add_index "oauth_access_tokens", ["resource_owner_id"], :name => "index_oauth_access_tokens_on_resource_owner_id" + add_index "oauth_access_tokens", ["token"], :name => "index_oauth_access_tokens_on_token", :unique => true + + create_table "oauth_applications", :force => true do |t| + t.string "name", :null => false + t.string "uid", :null => false + t.string "secret", :null => false + t.text "redirect_uri", :null => false + t.string "scopes", :default => "", :null => false + t.datetime "created_at" + t.datetime "updated_at" + t.integer "owner_id" + t.string "owner_type" + end + + add_index "oauth_applications", ["owner_id", "owner_type"], :name => "index_oauth_applications_on_owner_id_and_owner_type" + add_index "oauth_applications", ["uid"], :name => "index_oauth_applications_on_uid", :unique => true + create_table "onclick_times", :force => true do |t| t.integer "user_id" t.datetime "onclick_time" @@ -1282,6 +1563,7 @@ ActiveRecord::Schema.define(:version => 20160519070718) do t.boolean "locked", :default => false t.integer "sticky", :default => 0 t.integer "org_subfield_id" + t.integer "status", :default => 0 end create_table "org_member_roles", :force => true do |t| @@ -1348,6 +1630,23 @@ ActiveRecord::Schema.define(:version => 20160519070718) do t.integer "allow_teacher", :default => 0 end + create_table "permissions", :force => true do |t| + t.string "controller", :limit => 30, :default => "", :null => false + t.string "action", :limit => 30, :default => "", :null => false + t.string "description", :limit => 60, :default => "", :null => false + t.boolean "is_public", :default => false, :null => false + t.integer "sort", :default => 0, :null => false + t.boolean "mail_option", :default => false, :null => false + t.boolean "mail_enabled", :default => false, :null => false + end + + create_table "permissions_roles", :id => false, :force => true do |t| + t.integer "permission_id", :default => 0, :null => false + t.integer "role_id", :default => 0, :null => false + end + + add_index "permissions_roles", ["role_id"], :name => "permissions_roles_role_id" + create_table "phone_app_versions", :force => true do |t| t.string "version" t.text "description" @@ -1430,6 +1729,11 @@ ActiveRecord::Schema.define(:version => 20160519070718) do t.datetime "updated_at", :null => false end + create_table "project_import_data", :force => true do |t| + t.integer "project_id" + t.text "data" + end + create_table "project_infos", :force => true do |t| t.integer "project_id" t.integer "user_id" @@ -1519,6 +1823,16 @@ ActiveRecord::Schema.define(:version => 20160519070718) do add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id" + create_table "protected_branches", :force => true do |t| + t.integer "project_id", :null => false + t.string "name", :null => false + t.datetime "created_at" + t.datetime "updated_at" + t.boolean "developers_can_push", :default => false, :null => false + end + + add_index "protected_branches", ["project_id"], :name => "index_protected_branches_on_project_id" + create_table "queries", :force => true do |t| t.integer "project_id" t.string "name", :default => "", :null => false @@ -1653,6 +1967,25 @@ ActiveRecord::Schema.define(:version => 20160519070718) do t.integer "is_teacher_score", :default => 0 end + create_table "services", :force => true do |t| + t.string "type" + t.string "title" + t.integer "project_id" + t.datetime "created_at" + t.datetime "updated_at" + t.boolean "active", :default => false, :null => false + t.text "properties" + t.boolean "template", :default => false + t.boolean "push_events", :default => true + t.boolean "issues_events", :default => true + t.boolean "merge_requests_events", :default => true + t.boolean "tag_push_events", :default => true + t.boolean "note_events", :default => true, :null => false + end + + add_index "services", ["created_at", "id"], :name => "index_services_on_created_at_and_id" + add_index "services", ["project_id"], :name => "index_services_on_project_id" + create_table "settings", :force => true do |t| t.string "name", :default => "", :null => false t.text "value" @@ -1691,6 +2024,26 @@ ActiveRecord::Schema.define(:version => 20160519070718) do t.datetime "updated_at", :null => false end + create_table "snippets", :force => true do |t| + t.string "title" + t.text "content", :limit => 2147483647 + t.integer "author_id", :null => false + t.integer "project_id" + t.datetime "created_at" + t.datetime "updated_at" + t.string "file_name" + t.datetime "expires_at" + t.string "type" + t.integer "visibility_level", :default => 0, :null => false + end + + add_index "snippets", ["author_id"], :name => "index_snippets_on_author_id" + add_index "snippets", ["created_at", "id"], :name => "index_snippets_on_created_at_and_id" + add_index "snippets", ["created_at"], :name => "index_snippets_on_created_at" + add_index "snippets", ["expires_at"], :name => "index_snippets_on_expires_at" + add_index "snippets", ["project_id"], :name => "index_snippets_on_project_id" + add_index "snippets", ["visibility_level"], :name => "index_snippets_on_visibility_level" + create_table "softapplications", :force => true do |t| t.string "name" t.text "description" @@ -1763,9 +2116,9 @@ ActiveRecord::Schema.define(:version => 20160519070718) do t.integer "absence_penalty", :default => 0 t.float "system_score", :default => 0.0 t.boolean "is_test", :default => false + t.float "work_score" t.integer "simi_id" t.integer "simi_value" - t.float "work_score" end add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id" @@ -1813,13 +2166,13 @@ ActiveRecord::Schema.define(:version => 20160519070718) do create_table "sub_domains", :force => true do |t| t.integer "org_subfield_id" - t.integer "priority", :default => 0 + t.integer "priority" t.string "name" t.string "field_type" - t.integer "hide", :default => 0 - t.integer "status", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.integer "hide" + t.integer "status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "subfield_subdomain_dirs", :force => true do |t| @@ -1829,6 +2182,17 @@ ActiveRecord::Schema.define(:version => 20160519070718) do t.datetime "updated_at", :null => false end + create_table "subscriptions", :force => true do |t| + t.integer "user_id" + t.integer "subscribable_id" + t.string "subscribable_type" + t.boolean "subscribed" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "subscriptions", ["subscribable_id", "subscribable_type", "user_id"], :name => "subscriptions_user_id_and_ref_fields", :unique => true + create_table "system_messages", :force => true do |t| t.integer "user_id" t.string "content" @@ -2068,6 +2432,17 @@ ActiveRecord::Schema.define(:version => 20160519070718) do add_index "users", ["id", "type"], :name => "index_users_on_id_and_type" add_index "users", ["type"], :name => "index_users_on_type" + create_table "users_star_projects", :force => true do |t| + t.integer "project_id", :null => false + t.integer "user_id", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "users_star_projects", ["project_id"], :name => "index_users_star_projects_on_project_id" + add_index "users_star_projects", ["user_id", "project_id"], :name => "index_users_star_projects_on_user_id_and_project_id", :unique => true + add_index "users_star_projects", ["user_id"], :name => "index_users_star_projects_on_user_id" + create_table "versions", :force => true do |t| t.integer "project_id", :default => 0, :null => false t.string "name", :default => "", :null => false @@ -2119,6 +2494,23 @@ ActiveRecord::Schema.define(:version => 20160519070718) do t.datetime "updated_at", :null => false end + create_table "web_hooks", :force => true do |t| + t.string "url" + t.integer "project_id" + t.datetime "created_at" + t.datetime "updated_at" + t.string "type", :default => "ProjectHook" + t.integer "service_id" + t.boolean "push_events", :default => true, :null => false + t.boolean "issues_events", :default => false, :null => false + t.boolean "merge_requests_events", :default => false, :null => false + t.boolean "tag_push_events", :default => false + t.boolean "note_events", :default => false, :null => false + end + + add_index "web_hooks", ["created_at", "id"], :name => "index_web_hooks_on_created_at_and_id" + add_index "web_hooks", ["project_id"], :name => "index_web_hooks_on_project_id" + create_table "wechat_logs", :force => true do |t| t.string "openid", :null => false t.text "request_raw" From 61eeee702ca2efe5d33803d65a97b98cbe3d61c7 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 24 May 2016 09:40:47 +0800 Subject: [PATCH 003/126] migrate --- .../20160523085440_add_status_to_org_document_comment.rb | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 db/migrate/20160523085440_add_status_to_org_document_comment.rb diff --git a/db/migrate/20160523085440_add_status_to_org_document_comment.rb b/db/migrate/20160523085440_add_status_to_org_document_comment.rb new file mode 100644 index 000000000..e29426450 --- /dev/null +++ b/db/migrate/20160523085440_add_status_to_org_document_comment.rb @@ -0,0 +1,5 @@ +class AddStatusToOrgDocumentComment < ActiveRecord::Migration + def change + add_column :org_document_comments, :status, :integer, :default => false + end +end From 909d40b4eb462e4aa28a5242792580bec8dcbebd Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 24 May 2016 17:14:01 +0800 Subject: [PATCH 004/126] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=85=AC=E5=85=B1=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 6f3cca744..cff97e423 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -2050,7 +2050,7 @@ class UsersController < ApplicationController @score = @b_sort == "desc" ? "asc" : "desc" user_project_ids = User.current.projects.map {|p| p.id} user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源 - if(params[:type].blank? || params[:type] == "1") # 我的资源 + if(params[:type] == "1") # 我的资源 # 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源 if params[:status] == "2" @attachments = get_course_resources(params[:id], user_course_ids, @order, @score) @@ -2064,7 +2064,7 @@ class UsersController < ApplicationController # 公共资源库:所有公开资源或者我上传的私有资源 @attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score) end - elsif params[:type] == "6" # 公共资源 + elsif (params[:type].blank? || params[:type] == "6") # 公共资源 if params[:status] == "2" @attachments = get_course_resources_public( user_course_ids, @order, @score) elsif params[:status] == "3" @@ -2203,7 +2203,7 @@ class UsersController < ApplicationController @score = @b_sort == "desc" ? "asc" : "desc" user_project_ids = User.current.projects.map {|p| p.id} user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源 - if(params[:type].blank? || params[:type] == "1") # 我的资源 + if(params[:type] == "1") # 我的资源 # 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源 if params[:status] == "2" @attachments = get_course_resources(params[:id], user_course_ids, @order, @score) @@ -2217,7 +2217,7 @@ class UsersController < ApplicationController # 公共资源库:所有公开资源或者我上传的私有资源 @attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score) end - elsif params[:type] == "6" # 公共资源 + elsif (params[:type].blank? || params[:type] == "6") # 公共资源 if params[:status] == "2" @attachments = get_course_resources_public( user_course_ids, @order, @score) elsif params[:status] == "3" @@ -2344,7 +2344,7 @@ class UsersController < ApplicationController @score = @b_sort == "desc" ? "asc" : "desc" user_project_ids = User.current.projects.map {|p| p.id} user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源 - if(params[:type].blank? || params[:type] == "1") # 我的资源 + if(params[:type] == "1") # 我的资源 # 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源 if params[:status] == "2" @attachments = get_course_resources(params[:id], user_course_ids, @order, @score) @@ -2358,7 +2358,7 @@ class UsersController < ApplicationController # 公共资源库:所有公开资源或者我上传的私有资源 @attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score) end - elsif params[:type] == "6" # 公共资源 + elsif (params[:type].blank? || params[:type] == "6") # 公共资源 if params[:status] == "2" @attachments = get_course_resources_public( user_course_ids, @order, @score) elsif params[:status] == "3" From d1e11d426010b93de1d3d9631241258ddcd6c940 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 25 May 2016 08:58:58 +0800 Subject: [PATCH 005/126] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=AE=A1=E6=9F=A5?= =?UTF-8?q?=E5=90=8E=E4=BB=A3=E7=A0=81=E7=AE=80=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 7 +------ app/helpers/application_helper.rb | 1 - app/models/attachment.rb | 2 +- app/views/users/apply_resource.js.erb | 4 ++-- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index cff97e423..18093b790 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -443,12 +443,7 @@ class UsersController < ApplicationController # 资源分享请求弹框 def apply_resource - if User.current.logged? - @attachment = Attachment.find params[:attachment_id] - @state = 2 - else - @state = 1 - end + @attachment = Attachment.find params[:attachment_id] respond_to do |format| format.js end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4d92808d4..ce6d2259c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -70,7 +70,6 @@ module ApplicationHelper attach = Attachment.find(attachment_id) # 条件取否,result结果为true则不能下载 result = attach.is_public == 0 && attach.author != User.current && !attach.get_apply_resource_status(attach.id, User.current.id) && !attach_show_allow(attach) - return result end # Time 2015-03-24 15:27:29 diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 8f9ee2d85..aa4ef8670 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -143,7 +143,7 @@ class Attachment < ActiveRecord::Base def get_apply_resource_status attachment_id, author_id status = ApplyResource.where("attachment_id =? and user_id =?", attachment_id, author_id).first.try(:status) - status == 2 ? true :false + status == 2 end # add by nwb diff --git a/app/views/users/apply_resource.js.erb b/app/views/users/apply_resource.js.erb index 14a795fe5..601cafa11 100644 --- a/app/views/users/apply_resource.js.erb +++ b/app/views/users/apply_resource.js.erb @@ -1,6 +1,6 @@ -<% if @state == 1 %> +<% if !User.current.logged? %> alert("您还未登录"); -<% elsif @state == 2 %> +<% else %> $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/apply_resource', :locals => {:attachment => @attachment}) %>'); showModal('ajax-modal', '500px'); $('#ajax-modal').siblings().remove(); From 2abb68c00cba170db035219d4e699e9d41456f56 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 25 May 2016 10:54:49 +0800 Subject: [PATCH 006/126] =?UTF-8?q?=E7=BB=84=E7=BB=87=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=85=AC=E5=85=B1=E9=83=A8=E5=88=86=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_org2.html.erb | 70 +------------------ app/views/organizations/_org2_footer.html.erb | 12 ++++ .../organizations/_org_avater_swap.html.erb | 8 +++ .../organizations/_org_field_menu.html.erb | 44 ++++++++++++ 4 files changed, 67 insertions(+), 67 deletions(-) create mode 100644 app/views/organizations/_org2_footer.html.erb create mode 100644 app/views/organizations/_org_avater_swap.html.erb create mode 100644 app/views/organizations/_org_field_menu.html.erb diff --git a/app/views/layouts/base_org2.html.erb b/app/views/layouts/base_org2.html.erb index e51a62e24..c234fd288 100644 --- a/app/views/layouts/base_org2.html.erb +++ b/app/views/layouts/base_org2.html.erb @@ -62,66 +62,15 @@
-
    - <% @subfield_content.each do |field| %> - <% if is_default_field?(field) %> - <% case field.name %> - <% when 'activity' %> - - <% when 'course' %> - - <% when 'project' %> - - <% end %> - <% else %> - <% if field.field_type == "Post" && field.hide == 0 %> - - - - <% elsif field.field_type == "Resource" && field.hide == 0 %> - - <% end %> - <% end %> - <% end %> - <% if User.current.admin_of_org?(@organization) %> - - <% end %> -
+ <%= render :partial => "org_field_menu", :locals => {:subfield_content => @subfield_content} %>
@@ -136,20 +85,7 @@
- -
- -
+ <%= render :partial => "org2_footer" %>
diff --git a/app/views/organizations/_org2_footer.html.erb b/app/views/organizations/_org2_footer.html.erb new file mode 100644 index 000000000..9ff7051c1 --- /dev/null +++ b/app/views/organizations/_org2_footer.html.erb @@ -0,0 +1,12 @@ +
+ +
\ No newline at end of file diff --git a/app/views/organizations/_org_avater_swap.html.erb b/app/views/organizations/_org_avater_swap.html.erb new file mode 100644 index 000000000..70bdf3b1b --- /dev/null +++ b/app/views/organizations/_org_avater_swap.html.erb @@ -0,0 +1,8 @@ +<% if @org_logo_attchment.blank? || !User.current.logged? %> + +<% else %> + +<% end %> +<% if User.current.admin_of_org?(@organization) %> + +<% end %> \ No newline at end of file diff --git a/app/views/organizations/_org_field_menu.html.erb b/app/views/organizations/_org_field_menu.html.erb new file mode 100644 index 000000000..792bea87e --- /dev/null +++ b/app/views/organizations/_org_field_menu.html.erb @@ -0,0 +1,44 @@ +
    + <% subfield_content.each do |field| %> + <% if is_default_field?(field) %> + <% case field.name %> + <% when 'activity' %> + + <% when 'course' %> + + <% when 'project' %> + + <% end %> + <% else %> + <% if field.field_type == "Post" && field.hide == 0 %> + + + + <% elsif field.field_type == "Resource" && field.hide == 0 %> + + <% end %> + <% end %> + <% end %> + <% if User.current.admin_of_org?(@organization) %> + + <% end %> +
\ No newline at end of file From 415b624e0bba4456848995741f8076b7fc5216ad Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 25 May 2016 11:07:36 +0800 Subject: [PATCH 007/126] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_show_new_upload.html.erb | 4 +--- app/views/users/user_resource.html.erb | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/views/users/_show_new_upload.html.erb b/app/views/users/_show_new_upload.html.erb index b343aeae1..e63cf2af9 100644 --- a/app/views/users/_show_new_upload.html.erb +++ b/app/views/users/_show_new_upload.html.erb @@ -1,3 +1 @@ -<% if @type != "2" %> - -<% end %> + diff --git a/app/views/users/user_resource.html.erb b/app/views/users/user_resource.html.erb index d2e3242d8..3c70e6c33 100644 --- a/app/views/users/user_resource.html.erb +++ b/app/views/users/user_resource.html.erb @@ -58,7 +58,7 @@ -
  •  
  • +
  •  
  • <%= render :partial => 'user_resource_type_filter' %> From 0a8d21ea5579a52ba59be284c1ff7470af380fc1 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 25 May 2016 14:05:09 +0800 Subject: [PATCH 008/126] =?UTF-8?q?=E5=85=AC=E5=85=B1=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=BA=95=E7=AB=AF=E5=8F=91=E9=80=81JS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_resources_list.html.erb | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/app/views/users/_resources_list.html.erb b/app/views/users/_resources_list.html.erb index 26e8f922b..3f5138107 100644 --- a/app/views/users/_resources_list.html.erb +++ b/app/views/users/_resources_list.html.erb @@ -49,8 +49,6 @@ alert("您只能删除没有历史记录的资源,请重新选择后再删除。"); return; } - - if(data != "" && confirm('确认要删除这些资源吗?')) { $.post( '<%= user_resource_delete_user_path(User.current.id,:type=>@type,:status=>@status)%>', @@ -62,8 +60,6 @@ } } - - function show_send(){ $("#contextMenu").hide(); document.oncontextmenu = function() {return true;} @@ -99,13 +95,26 @@ if (lastSendType === '2'){ //如果已经发送过一次了,那么就应该沿用上次发送的类型。 $.ajax({ type: 'get', - url: '<%= search_user_project_user_path(User.current.id)%>' + '?' + $("#resources_list_form").serialize() + "&type=<%= @type%>", + url: '<%= search_user_project_user_path(User.current.id) %>' + '?' + $("#resources_list_form").serialize() + "&type=<%= @type %>", data:{send_type:'file'} }); - }else{ + }else if (lastSendType === '1'){ $.ajax({ type: 'get', - url: '<%= search_user_course_user_path(User.current.id)%>' + '?'+ $("#resources_list_form").serialize() + "&type=<%= @type%>", + url: '<%= search_user_course_user_path(User.current.id) %>' + '?' + $("#resources_list_form").serialize() + "&type=<%= @type %>", + data:{send_type:'file'} + }); + }else if (lastSendType === '3'){ + $.ajax({ + type: 'get', + url: '<%= search_user_org_user_path(User.current.id) %>' + '?' + $("#resources_list_form").serialize() + "&type=<%= @type %>", + data:{send_type:'file'} + }); + } + else{ + $.ajax({ + type: 'get', + url: '<%= search_user_course_user_path(User.current.id)%>' + '?'+ $("#resources_list_form").serialize() + "&type=<%= @type %>", data:{send_type:'file'} }); From 74384d10a57832939d6eb1d75785e74dbf5f08bd Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 27 May 2016 10:06:25 +0800 Subject: [PATCH 009/126] =?UTF-8?q?=E7=BB=84=E7=BB=87=20=E8=AE=BA=E5=9D=9B?= =?UTF-8?q?=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/org_document_comments/edit.html.erb | 33 +++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/app/views/org_document_comments/edit.html.erb b/app/views/org_document_comments/edit.html.erb index a36397677..fc3410eb0 100644 --- a/app/views/org_document_comments/edit.html.erb +++ b/app/views/org_document_comments/edit.html.erb @@ -27,8 +27,37 @@
    - <%= form_tag url_for(:controller => 'org_document_comments',:action => 'update', :id => @org_document.id, :flag => @flag, :org_subfield_id => params[:org_subfield_id]),:method => 'put', :id => 'new_org_document_form' do |f| %> + <%= form_tag url_for(:controller => 'org_document_comments',:action => 'update', :id => @org_document.id, :flag => @flag, :org_subfield_id => params[:org_subfield_id]),:method => 'put', :id => 'new_org_document_form' do |f| %> +
    + +
    +
    +
    +
    +
    + + <%#= kindeditor_tag 'org_document_comment[content]','', :editor_id => 'org_document_description_editor', :height => "150px" %> +
    +
    +

    +

    +

    +
    + +
    +
    + <%= render :partial => 'org_document_comments/attachment', :locals => {:container => @org_document} %> +
    +
    +
    +
    + 确定 + + 取消 +
    +
    +
    <% end %> -
    +
    \ No newline at end of file From 1535c4cd0703acc6514bdcc344f214fc96c1cfe1 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 27 May 2016 15:54:55 +0800 Subject: [PATCH 010/126] =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=88=86=E7=BB=84?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=97=B6=E7=9A=84=E5=9F=BA=E4=BA=8E=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E5=AE=9E=E6=96=BD=E6=80=BB=E6=98=AF=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E9=80=89=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_group_attr.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_user_group_attr.html.erb b/app/views/users/_user_group_attr.html.erb index 48c303a29..681f158e7 100644 --- a/app/views/users/_user_group_attr.html.erb +++ b/app/views/users/_user_group_attr.html.erb @@ -10,7 +10,7 @@

    提醒:勾选后各小组必须在Trustie平台创建项目,教师可随时观察平台对各小组最新进展的实时统计。

    From 086ccedc08b9304f7497ac0c4756258ab8a37cf5 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 27 May 2016 16:45:04 +0800 Subject: [PATCH 011/126] =?UTF-8?q?=E5=85=88=E9=9A=90=E8=97=8F=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E4=BF=A1=E6=81=AF=EF=BC=8C=E5=86=8D=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=88=96=E5=88=86=E7=8F=AD=E5=90=8E=E2=80=9C?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=BD=9C=E4=B8=9A=E4=BF=A1=E6=81=AF=E2=80=9D?= =?UTF-8?q?=E7=9A=84=E6=8C=89=E9=92=AE=E4=B8=8D=E8=A7=81=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_student_work_list.html.erb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/views/student_work/_student_work_list.html.erb b/app/views/student_work/_student_work_list.html.erb index bc7ab947f..eaf6b9304 100644 --- a/app/views/student_work/_student_work_list.html.erb +++ b/app/views/student_work/_student_work_list.html.erb @@ -39,6 +39,10 @@ + + \ No newline at end of file From 0cafebb3a24ad9007f59996e982d40f12902842e Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 27 May 2016 17:14:37 +0800 Subject: [PATCH 013/126] =?UTF-8?q?=E6=96=B0=E9=97=BB=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E7=82=B9=E8=B5=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_project_news.html.erb | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/app/views/users/_project_news.html.erb b/app/views/users/_project_news.html.erb index 55e2182b5..b354bc668 100644 --- a/app/views/users/_project_news.html.erb +++ b/app/views/users/_project_news.html.erb @@ -66,11 +66,7 @@
    回复 <%= count>0 ? "(#{count})" : "" %> - <% if activity.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
    <%#= format_date(activity.updated_on) %>
    @@ -108,11 +104,7 @@ <% end %> <%= format_time(comment.created_on) %> - <% if comment.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
    From 622d71c47654b12f310a85231fe350b14ed2a4c5 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 27 May 2016 22:14:41 +0800 Subject: [PATCH 014/126] =?UTF-8?q?=E5=B7=B2=E7=BB=91=E5=AE=9A=E6=88=90?= =?UTF-8?q?=E5=8A=9F=E7=9A=84=EF=BC=8C=E7=9B=B4=E6=8E=A5=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wechats_controller.rb | 4 +++- app/views/wechats/login.html.erb | 23 ++++++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 43bab082a..30a39e86e 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -162,7 +162,6 @@ class WechatsController < ActionController::Base code = params[:code] || session[:wechat_code] openid = get_openid_from_code(code) - raise "无法获取到微信openid" unless openid render :json => {status:0, openid: openid} rescue Exception=>e @@ -197,6 +196,9 @@ class WechatsController < ActionController::Base def login session[:wechat_code] = params[:code] if params[:code] + openid = get_openid_from_code(code) + @wechat_user = user_binded?(openid) + render 'wechats/login', layout: 'base_wechat' end diff --git a/app/views/wechats/login.html.erb b/app/views/wechats/login.html.erb index dc39b9f23..6de7b9bd8 100644 --- a/app/views/wechats/login.html.erb +++ b/app/views/wechats/login.html.erb @@ -1,4 +1,22 @@ +<% if @wechat_user %> +
    +
    +
    +
    +

    操作成功

    +

    您已经绑定过微信了,用户名: (<%= @wechat_user.user.login %>)

    +
    +
    +

    + 确定 +

    +
    + +
    +
    + +<% else %>

    @@ -63,4 +81,7 @@ }) }); - \ No newline at end of file + + + +<% end %> \ No newline at end of file From 4561bdfd0deae1eb761a8455b9f9ad831daffff5 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 27 May 2016 22:18:03 +0800 Subject: [PATCH 015/126] code=>params[:code] --- app/controllers/wechats_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 30a39e86e..8570d3140 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -196,7 +196,7 @@ class WechatsController < ActionController::Base def login session[:wechat_code] = params[:code] if params[:code] - openid = get_openid_from_code(code) + openid = get_openid_from_code(params[:code]) @wechat_user = user_binded?(openid) render 'wechats/login', layout: 'base_wechat' From be94d445a947aec1054a15c40e7742643d81a8f1 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 27 May 2016 22:19:49 +0800 Subject: [PATCH 016/126] window close --- app/views/wechats/login.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/wechats/login.html.erb b/app/views/wechats/login.html.erb index 6de7b9bd8..65a8b1857 100644 --- a/app/views/wechats/login.html.erb +++ b/app/views/wechats/login.html.erb @@ -9,7 +9,7 @@

    From 63b9aaefe2c38424bba40a6eec81b164a948126d Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 27 May 2016 22:22:09 +0800 Subject: [PATCH 017/126] window close --- app/views/wechats/login.html.erb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/views/wechats/login.html.erb b/app/views/wechats/login.html.erb index 65a8b1857..39e188664 100644 --- a/app/views/wechats/login.html.erb +++ b/app/views/wechats/login.html.erb @@ -1,5 +1,11 @@ <% if @wechat_user %> + +
    @@ -9,7 +15,7 @@
    From bb30709fa110dd96e787c15482e6bed159b67d14 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 27 May 2016 22:54:57 +0800 Subject: [PATCH 018/126] window close --- app/views/wechats/login.html.erb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/app/views/wechats/login.html.erb b/app/views/wechats/login.html.erb index 39e188664..17878e318 100644 --- a/app/views/wechats/login.html.erb +++ b/app/views/wechats/login.html.erb @@ -1,11 +1,5 @@ <% if @wechat_user %> - -
    @@ -15,7 +9,7 @@
    From 389172e5b2ed9f641d21e1cbb1d0f11c7c168bbf Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 30 May 2016 10:45:00 +0800 Subject: [PATCH 019/126] =?UTF-8?q?CSS=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/org_custom.css | 136 ++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 public/stylesheets/org_custom.css diff --git a/public/stylesheets/org_custom.css b/public/stylesheets/org_custom.css new file mode 100644 index 000000000..790877660 --- /dev/null +++ b/public/stylesheets/org_custom.css @@ -0,0 +1,136 @@ +/* 门户样式重置 */ +body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;} +body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:12px;line-height:1.5; background:#fff;} +div,img,tr,td,table{ border:0;} +table,tr,td{border:0;cellspacing:0; cellpadding:0;} +ol,ul,li{ list-style-type:none} +a:link,a:visited{color:#000;text-decoration:none;} +a:hover,a:active{color:#3b94d6;} + + + +/* 公共 */ +.clear:after {content:".";height:0;visibility:hidden;display:block;clear:both;} +.fl{ float:left;} +.fr{ float:right;} +.cl{ clear:both; overflow:hidden;} +.mt5{ margin-top:5px;} +.mt10{ margin-top:10px;} +.mb5{ margin-bottom:5px;} +.mb10{ margin-bottom:10px;} +.ml5{ margin-left:5px;} +.ml10{ margin-left:10px;} +.ml15{ margin-left:15px;} +.mr5{ margin-right:5px;} +.mr10{ margin-right:15px;} +.mr15{ margin-right:10px;} +a.c_red{color:#df0600;} +.c_red{color:#df0600;} +/* 门户首页 */ +#por_header{ width:100%; height:70px; background-color:#3b94d6; } +.por_header_con{ width:1000px; margin:0 auto;} +.por_logo{ margin-top:5px;} +.por_login li{ float:left;} +.por_login li a{ display:block; padding:0 15px; height:70px; line-height:70px;font-size:16px; color:#fff; } +.por_login li a:hover{ background-color:#1173bc;} +.por_search{ margin-top:15px; margin-right:20px;} +.pro_input_search{ background-color:#daeefc; height:36px; width:355px; border:none; padding:0 5px; color:#3b94d6;} +a.por_search_btn{ display:block;background:#daeefc url(../images/icons_por.png) 0 8px no-repeat; width:25px; height:36px;} +a:hover.por_search_btn{background:#daeefc url(../images/icons_por.png) -35px 8px no-repeat; } + +#por_container{ width:1000px; margin:10px auto;} +.por_left{ width:685px; margin-right:15px; float:left; } +.por_right{ width:300px; float:left;} +.por_nav{ width:1000px; overflow:hidden; position:relative;height:53px; border-bottom:7px solid #ccc; margin-bottom:10px;} +a.por_edit_index{ position:absolute; font-size:14px; right:5px; top:15px;} +.por_nav ul li{ float:left;} +.por_nav ul li a{ display: block; height:53px; padding:0 20px; line-height:53px; font-size:18px; color:#333;} +.por_nav ul li a:hover{ border-bottom:7px solid #3b94d6;} +.por_icons_hot{ background:url(../images/icons_por.png) 0 -78px no-repeat; height:22px; width:55px; padding-left:3px; color:#fff; font-size:12px; line-height:22px; font-weight:normal;} +.por_h2_index{ font-size:20px; font-weight:normal; color:#3b94d6; width:100%; border-bottom:1px solid #e8e5e5; height:40px; line-height:40px;} +a.por_more_index{ font-size:12px; color:#999; } +.por_hotbar_left li{ width:365px; padding:12px 5px 12px 0; border-bottom:1px dashed #e8e5e5;} +a.por_hot_title{ font-size:16px; display:block; font-weight:bold; width:365px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} +.por_hot_txt{ color:#666; line-height:20px;max-height:60px;overflow:hidden;text-overflow:ellipsis;} +.por_time{ color:#999;} +a.por_hot_name{color:#3b94d6;} +.por_hotbar_right{ border:1px solid #e8e5e5; padding:5px; margin-top:15px; width:300px;} +.por_hotbar_right img{ width:300px; height:246px;} +.por_hot_title_r{ font-size:16px; display:block; font-weight:bold; width:300px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} +.por_hot_txt_r{color:#666; line-height:20px;max-height:80px;overflow:hidden;text-overflow:ellipsis;} +.por_course{ } +.por_course_bar{ width:328px; margin:0 7px; padding:20px 0; border-bottom:1px solid #e8e5e5;} +a.por_course_title{font-size:14px; margin-bottom:10px; display:block; font-weight:bold; width:328px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} +.por_course_bar img{ width:140px; height:100px; } +.por_course_txt { width:180px; margin-left:5px;color:#666; line-height:20px;max-height:80px;overflow:hidden;text-overflow:ellipsis;} +a.por_course_time{color:#3b94d6; margin-left:5px;} +.por_post{ border-bottom:1px solid #e8e5e5; padding-bottom:5px;} +.por_post_left{ width:394px; margin-top:15px;} +.por_post_leftbar img{ width:377px; height:163px;} +.por_post_leftbar { border-bottom:1px dashed #e8e5e5; padding-bottom:5px; margin-bottom:10px;} +a.por_post_title{font-size:18px; display:block; width:377px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} +.por_post_txt{color:#666; line-height:20px;max-height:40px;overflow:hidden;text-overflow:ellipsis; } +.post_icons_grey{ width:5px; height:5px; margin:10px 5px 0 0; background-color:#b3b3b3; display:block; line-height:20px;} +.por_post_list li{ height:20px; height:30px;} +.por_post_list li a{ font-size:14px; } +a.por_hidden_w390{ display:block; width:390px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} +a.por_hidden_w270{ display:block; width:280px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} +.por_post_right{ width:280px; border-left:1px solid #e8e5e5; margin-top:15px; padding-left:10px;} +.por_news_list li{ padding:15px 0; border-bottom:1px dashed #e8e5e5;} +.por_users_img{ width:40px; height:40px; border:1px solid #e8e5e5;} +.por_news_txt{ width:245px; margin-left:10px;} +.por_news_p{ line-height:20px;max-height:40px;overflow:hidden;text-overflow:ellipsis; } +a.por_zan{ background:url(../images/icons_por.png) 0 -41px no-repeat; height:15px; width:20px; display:block; padding-left:15px; line-height:20px; color:#999;} +a.por_zan:hover{background:url(../images/icons_por.png) -34px -42px no-repeat; color:#3b94d6; } +.por_hidden_w205{ font-size:14px; display:block; width:205px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} +.por_projects{border-bottom:1px solid #e8e5e5; padding-bottom:10px; margin-top:10px;} +.por_projects ul li{ padding:5px 0;} +.por_projects ul{ margin-top:5px;} +.por_project_p{ line-height:20px;max-height:40px;overflow:hidden;text-overflow:ellipsis; margin-top:5px; margin-left:10px; color:#666; } +.por_project_li{border-bottom:1px dashed #ccc; padding-bottom:10px; margin-bottom:5px;} +.por_time a{ color:#3b94d6;} +.por_teachers{ margin-top:20px; } +#por_teachers_nav {border-bottom:1px solid #d0d0d0; height:31px;} +#por_teachers_nav li {float:left; padding:0px 5px; text-align:center; } +#por_teachers_nav li a{font-size:20px;} +.por_teachers_hover {border:1px solid #d0d0d0; border-bottom:1px solid #fff; } +.por_teachers_hover a{color:#3b94d6;} +.por_teachers_nomal {border-bottom:none; } +.por_teachers_nomal a{color:#999;} +.undis {display:none;} +.dis {display:block;} +a.por_more_teacher{ font-size:12px; } +.por_teachers_li{ margin-top:10px;} +.por_teachers_li li{ padding:10px 0;border-bottom:1px solid #e8e5e5;} +.por_teachers_img{ width:60px; height:60px; -webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px;} +a.por_teachers_name{ display:block; width:80px; font-size:18px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} +.por_teachers_p{ font-size:14px; color:#999; width:150px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} +.por_teachers_span{ color:#999;} +.por_teachers_span a{ margin:0 5px; color:#999;} +.por_footer{ padding:35px 0; width:100%; background-color:#efeded; margin-top:30px;} +.por_footer_con{ width:1000px; margin:0 auto;} +.por_footer_con ul{ width:350px; margin:0 auto;} +.por_footer_con ul li{ float:left; text-align:center;} +.por_footer_con ul li a{ font-size:14px;} +.por_footer_con ul li a span{ color:#999; margin:0 15px ;} +.por_footer_con p{ text-align:center; margin-top:20px; color:#777;} + +.por_index_position{ position:relative;} +a.por_xiang_index{ position:absolute; color:red; background:#fff; top:40px; left:292px;} + + + + + + + + + + + + + + + + + From 46e4f2c14321f744d416f8236994c8254ed499a9 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 30 May 2016 14:23:52 +0800 Subject: [PATCH 020/126] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=96=B0base?= =?UTF-8?q?=E6=A1=86=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 2 +- app/views/layouts/_org_custom_footer.html.erb | 10 +++ ...stom.thml.erb => base_org_custom.html.erb} | 40 +++-------- .../organizations/_org_custom_header.html.erb | 67 +++++++++++++++++++ .../organizations/_org_custom_left1.html.erb | 0 .../organizations/_org_custom_left2.html.erb | 0 .../organizations/_org_custom_left3.html.erb | 0 .../organizations/_org_custom_right1.html.erb | 0 .../organizations/_org_custom_right2.html.erb | 0 .../organizations/_org_custom_right3.html.erb | 0 app/views/organizations/show.html.erb | 2 +- public/stylesheets/org_custom.css | 24 +++---- 12 files changed, 100 insertions(+), 45 deletions(-) create mode 100644 app/views/layouts/_org_custom_footer.html.erb rename app/views/layouts/{base_org_custom.thml.erb => base_org_custom.html.erb} (50%) create mode 100644 app/views/organizations/_org_custom_header.html.erb create mode 100644 app/views/organizations/_org_custom_left1.html.erb create mode 100644 app/views/organizations/_org_custom_left2.html.erb create mode 100644 app/views/organizations/_org_custom_left3.html.erb create mode 100644 app/views/organizations/_org_custom_right1.html.erb create mode 100644 app/views/organizations/_org_custom_right2.html.erb create mode 100644 app/views/organizations/_org_custom_right3.html.erb diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 2ab724728..3cf36a781 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -91,7 +91,7 @@ class OrganizationsController < ApplicationController course_types = "('Message','News','HomeworkCommon','Poll','Course')" @project_acts = get_project_activities_org @organization, project_ids @course_acts = get_course_activities_org @organization, course_ids - render :layout => 'base_org2' + render :layout => 'base_org_custom' else render_403 end diff --git a/app/views/layouts/_org_custom_footer.html.erb b/app/views/layouts/_org_custom_footer.html.erb new file mode 100644 index 000000000..a9c4a7e36 --- /dev/null +++ b/app/views/layouts/_org_custom_footer.html.erb @@ -0,0 +1,10 @@ + diff --git a/app/views/layouts/base_org_custom.thml.erb b/app/views/layouts/base_org_custom.html.erb similarity index 50% rename from app/views/layouts/base_org_custom.thml.erb rename to app/views/layouts/base_org_custom.html.erb index a453d1cd7..4a9ba4dce 100644 --- a/app/views/layouts/base_org_custom.thml.erb +++ b/app/views/layouts/base_org_custom.html.erb @@ -9,36 +9,18 @@ <%= favicon %> <%= javascript_heads %> <%= heads_for_theme %> - <%= stylesheet_link_tag 'org2','jquery/jquery-ui-1.9.2' %> - - <%#= call_hook :view_layouts_base_html_head %> + <%= stylesheet_link_tag 'org_custom', 'new_user', 'public','jquery/jquery-ui-1.9.2' %> + <%= call_hook :view_layouts_base_html_head %> <%= yield :header_tags -%> <%=render :partial => "math_js" %> - - - - -
    -
    -
    - -
    - -
    - <%= render :partial => "org_field_menu", :locals => {:subfield_content => @subfield_content} %> -
    -
    + +<% update_visiti_count @organization %> +
    + <%= render :partial => 'org_custom_header' %>
    -<%# 更新访问数,刷新的时候更新访问次数 %> -<% update_visiti_count @organization %> -<%# over %> +
    <%= render_flash_messages %> @@ -46,10 +28,8 @@ <%= call_hook :view_layouts_base_content %>
    -
    - <%= render :partial => "org2_footer" %> -
    - +
    + <%= render :partial => "layouts/org_custom_footer" %>
    <%# 弹框 %> @@ -60,7 +40,7 @@ <%= javascript_include_tag 'cookie','project', 'organization','header','prettify','select_list_move','org'%> <%= javascript_include_tag 'attachments' %> - + diff --git a/app/views/organizations/_org_custom_header.html.erb b/app/views/organizations/_org_custom_header.html.erb new file mode 100644 index 000000000..027e4e8ec --- /dev/null +++ b/app/views/organizations/_org_custom_header.html.erb @@ -0,0 +1,67 @@ +
    +
    + + <% if User.current.logged? %> + + <% else %> + + <% end %> + +
    +
    +
    + + + + \ No newline at end of file diff --git a/app/views/organizations/_org_custom_left1.html.erb b/app/views/organizations/_org_custom_left1.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/app/views/organizations/_org_custom_left2.html.erb b/app/views/organizations/_org_custom_left2.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/app/views/organizations/_org_custom_left3.html.erb b/app/views/organizations/_org_custom_left3.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/app/views/organizations/_org_custom_right1.html.erb b/app/views/organizations/_org_custom_right1.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/app/views/organizations/_org_custom_right2.html.erb b/app/views/organizations/_org_custom_right2.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/app/views/organizations/_org_custom_right3.html.erb b/app/views/organizations/_org_custom_right3.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb index c490efb85..ba18438e5 100644 --- a/app/views/organizations/show.html.erb +++ b/app/views/organizations/show.html.erb @@ -1,6 +1,6 @@ <%# 区分两种模式 params[:org_subfield_id] 不为空的时候则跳到栏目%> <% if @organization.switch_type && params[:org_subfield_id].nil? %> - <%= render :partial => 'show_type2' %> + <%#= render :partial => 'show_type2' %> <% else %> <%= javascript_include_tag "jquery.infinitescroll.js" %> diff --git a/public/stylesheets/org_custom.css b/public/stylesheets/org_custom.css index 790877660..ce4bff32f 100644 --- a/public/stylesheets/org_custom.css +++ b/public/stylesheets/org_custom.css @@ -7,8 +7,6 @@ ol,ul,li{ list-style-type:none} a:link,a:visited{color:#000;text-decoration:none;} a:hover,a:active{color:#3b94d6;} - - /* 公共 */ .clear:after {content:".";height:0;visibility:hidden;display:block;clear:both;} .fl{ float:left;} @@ -24,11 +22,11 @@ a:hover,a:active{color:#3b94d6;} .mr5{ margin-right:5px;} .mr10{ margin-right:15px;} .mr15{ margin-right:10px;} -a.c_red{color:#df0600;} -.c_red{color:#df0600;} + /* 门户首页 */ -#por_header{ width:100%; height:70px; background-color:#3b94d6; } -.por_header_con{ width:1000px; margin:0 auto;} +#por_header{ width:100%; } +.por_header_top{ width:100%; height:70px; background:#3b94d6; } +.por_header_con{ width:1000px; margin:0 auto; height:70px; } .por_logo{ margin-top:5px;} .por_login li{ float:left;} .por_login li a{ display:block; padding:0 15px; height:70px; line-height:70px;font-size:16px; color:#fff; } @@ -37,15 +35,17 @@ a.c_red{color:#df0600;} .pro_input_search{ background-color:#daeefc; height:36px; width:355px; border:none; padding:0 5px; color:#3b94d6;} a.por_search_btn{ display:block;background:#daeefc url(../images/icons_por.png) 0 8px no-repeat; width:25px; height:36px;} a:hover.por_search_btn{background:#daeefc url(../images/icons_por.png) -35px 8px no-repeat; } +.por_nav{ width:1000px; height:70px; overflow:hidden; margin: 0 auto; position:relative; } +a.por_edit_index{ position:absolute; font-size:14px; right:5px; top:20px;} +.por_nav ul{ border-bottom:7px solid #ccc; height:63px;} +.por_nav ul li{ float:left; } +.por_nav ul li a{ display: block; height:63px; padding:0 20px; line-height:63px; font-size:18px; color:#333; } +.por_nav ul li a:hover{ border-bottom:7px solid #3b94d6; } +.por_index_act{border-bottom:7px solid #3b94d6; } #por_container{ width:1000px; margin:10px auto;} .por_left{ width:685px; margin-right:15px; float:left; } .por_right{ width:300px; float:left;} -.por_nav{ width:1000px; overflow:hidden; position:relative;height:53px; border-bottom:7px solid #ccc; margin-bottom:10px;} -a.por_edit_index{ position:absolute; font-size:14px; right:5px; top:15px;} -.por_nav ul li{ float:left;} -.por_nav ul li a{ display: block; height:53px; padding:0 20px; line-height:53px; font-size:18px; color:#333;} -.por_nav ul li a:hover{ border-bottom:7px solid #3b94d6;} .por_icons_hot{ background:url(../images/icons_por.png) 0 -78px no-repeat; height:22px; width:55px; padding-left:3px; color:#fff; font-size:12px; line-height:22px; font-weight:normal;} .por_h2_index{ font-size:20px; font-weight:normal; color:#3b94d6; width:100%; border-bottom:1px solid #e8e5e5; height:40px; line-height:40px;} a.por_more_index{ font-size:12px; color:#999; } @@ -115,8 +115,6 @@ a.por_teachers_name{ display:block; width:80px; font-size:18px;overflow:hidden; .por_footer_con ul li a span{ color:#999; margin:0 15px ;} .por_footer_con p{ text-align:center; margin-top:20px; color:#777;} -.por_index_position{ position:relative;} -a.por_xiang_index{ position:absolute; color:red; background:#fff; top:40px; left:292px;} From 9cc749bd57dbd97558d549aae8bf3331ec149f67 Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 30 May 2016 14:38:57 +0800 Subject: [PATCH 021/126] =?UTF-8?q?=E9=97=A8=E6=88=B7=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=EF=BC=8C=E9=98=B2=E6=AD=A2=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_org_custom.html.erb | 2 +- .../organizations/_org_custom_header.html.erb | 2 +- public/stylesheets/org_custom.css | 25 ------------------- public/stylesheets/public.css | 4 ++- 4 files changed, 5 insertions(+), 28 deletions(-) diff --git a/app/views/layouts/base_org_custom.html.erb b/app/views/layouts/base_org_custom.html.erb index 4a9ba4dce..4742eab4f 100644 --- a/app/views/layouts/base_org_custom.html.erb +++ b/app/views/layouts/base_org_custom.html.erb @@ -15,7 +15,7 @@ <%=render :partial => "math_js" %> - + <% update_visiti_count @organization %>
    <%= render :partial => 'org_custom_header' %> diff --git a/app/views/organizations/_org_custom_header.html.erb b/app/views/organizations/_org_custom_header.html.erb index 027e4e8ec..349aef8c6 100644 --- a/app/views/organizations/_org_custom_header.html.erb +++ b/app/views/organizations/_org_custom_header.html.erb @@ -43,7 +43,7 @@
  • 学生英雄榜
  • 学生英雄榜
  • - 配置 + 配置
    diff --git a/public/stylesheets/org_custom.css b/public/stylesheets/org_custom.css index ce4bff32f..85f056438 100644 --- a/public/stylesheets/org_custom.css +++ b/public/stylesheets/org_custom.css @@ -1,28 +1,3 @@ -/* 门户样式重置 */ -body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;} -body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:12px;line-height:1.5; background:#fff;} -div,img,tr,td,table{ border:0;} -table,tr,td{border:0;cellspacing:0; cellpadding:0;} -ol,ul,li{ list-style-type:none} -a:link,a:visited{color:#000;text-decoration:none;} -a:hover,a:active{color:#3b94d6;} - -/* 公共 */ -.clear:after {content:".";height:0;visibility:hidden;display:block;clear:both;} -.fl{ float:left;} -.fr{ float:right;} -.cl{ clear:both; overflow:hidden;} -.mt5{ margin-top:5px;} -.mt10{ margin-top:10px;} -.mb5{ margin-bottom:5px;} -.mb10{ margin-bottom:10px;} -.ml5{ margin-left:5px;} -.ml10{ margin-left:10px;} -.ml15{ margin-left:15px;} -.mr5{ margin-right:5px;} -.mr10{ margin-right:15px;} -.mr15{ margin-right:10px;} - /* 门户首页 */ #por_header{ width:100%; } .por_header_top{ width:100%; height:70px; background:#3b94d6; } diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 2ca221d5c..115e48223 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -270,6 +270,8 @@ a.linkGrey6 {color:#484848 !important;} a.linkGrey6:hover {color:#ffffff !important;} a.linkGrey7 {color:#888888;} a.linkGrey7:hover {color:#269ac9;} +a.link-black {color:#000;} +a.link-black:hover {color:#3b94d6;} a.bBlue {background-color:#3498db;} a.bBlue:hover {background-color:#297fb8;} a.submit_btn {border:1px solid #3498db; padding:3px 10px; border-radius:3px; color:#3498db;} @@ -1139,4 +1141,4 @@ a.st_down{ display: block; width:8px; float:left; height:13px; background:url(.. .likeNum{color: #7f7f7f} /*弹框*/ -.apply_content{ border:1px solid #ddd;line-height: 16px; height:80px;width:420px; background:#fff; margin-bottom:10px;} +.apply_content{ border:1px solid #ddd;line-height: 16px; height:80px;width:420px; background:#fff; margin-bottom:10px;} From 698e4bd7b3a1a5c855e6aafd6a0dc11368098bf2 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 30 May 2016 14:41:53 +0800 Subject: [PATCH 022/126] header --- app/views/layouts/base_org_custom.html.erb | 2 +- .../organizations/_org_custom_header.html.erb | 52 ++++++++++++++----- 2 files changed, 39 insertions(+), 15 deletions(-) diff --git a/app/views/layouts/base_org_custom.html.erb b/app/views/layouts/base_org_custom.html.erb index 4a9ba4dce..355ec23ec 100644 --- a/app/views/layouts/base_org_custom.html.erb +++ b/app/views/layouts/base_org_custom.html.erb @@ -18,7 +18,7 @@ <% update_visiti_count @organization %>
    - <%= render :partial => 'org_custom_header' %> + <%= render :partial => 'org_custom_header', :locals => {:subfield_content => @subfield_content} %>
    diff --git a/app/views/organizations/_org_custom_header.html.erb b/app/views/organizations/_org_custom_header.html.erb index 027e4e8ec..4be46e789 100644 --- a/app/views/organizations/_org_custom_header.html.erb +++ b/app/views/organizations/_org_custom_header.html.erb @@ -30,20 +30,45 @@
    - 配置 + <% if User.current.admin_of_org?(@organization) %> + 配置 + <% end %>
    @@ -57,7 +82,6 @@ $("#homepageProfileMenuIcon").removeClass("homepageProfileMenuIconhover"); $("#topnav_login_list").hide(); }); - function signout(){ $.post( '<%= signout_path%>', From d4c0e9754ac6332a5af1fd5d2c7e5d8b0f153ff8 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 30 May 2016 14:51:54 +0800 Subject: [PATCH 023/126] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E5=B1=95=E5=BC=80=E5=90=8E=E5=BA=94=E6=98=BE=E7=A4=BA=E2=80=9C?= =?UTF-8?q?=E6=94=B6=E8=B5=B7=E6=8F=8F=E8=BF=B0=E4=BF=A1=E6=81=AF=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_courses.html.erb | 4 ++-- public/javascripts/course.js | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index a9e859448..c3f3a4a60 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -157,9 +157,9 @@
    - <%= l(:label_expend_information)%> + - +
    diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 7cfad6005..73ab065ea 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -475,6 +475,19 @@ function submitMemberSerch(content) function show_more_msg() { $("#course_description").toggleClass("course_description_none"); + var information = $("#expend_more_information"); + var arrow = $("#arrow"); + var val = information.attr("value"); + if (val == "show_more") { + $("#expend_more_information").text("收起描述信息"); + information.attr("value", "hide_more"); + arrow.attr("src", "/images/jiantouup.jpg") + } + else { + $("#expend_more_information").text("展开更多信息"); + information.attr("value", "show_more"); + arrow.attr("src", "/images/jiantou.jpg") + } } //作业描述显示更多信息 function news_show_more_des(id) From 471ed7cbd230355be723404a01ea9540826c7a9a Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 30 May 2016 14:58:46 +0800 Subject: [PATCH 024/126] =?UTF-8?q?=E7=BB=84=E7=BB=87logo=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=EF=BC=8C=E6=B7=BB=E5=8A=A0=E6=A0=B7=E5=BC=8F=E5=9B=BE?= =?UTF-8?q?=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organizations/_org_custom_header.html.erb | 2 +- public/images/org_custom/homepageImage.jpg | Bin 0 -> 2756 bytes public/images/org_custom/icons_por.png | Bin 0 -> 19736 bytes public/images/org_custom/por_img.jpg | Bin 0 -> 39793 bytes public/images/org_custom/porlogo.png | Bin 0 -> 21343 bytes public/stylesheets/org_custom.css | 10 +++++----- 6 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 public/images/org_custom/homepageImage.jpg create mode 100644 public/images/org_custom/icons_por.png create mode 100644 public/images/org_custom/por_img.jpg create mode 100644 public/images/org_custom/porlogo.png diff --git a/app/views/organizations/_org_custom_header.html.erb b/app/views/organizations/_org_custom_header.html.erb index 166b4991e..4d00550a8 100644 --- a/app/views/organizations/_org_custom_header.html.erb +++ b/app/views/organizations/_org_custom_header.html.erb @@ -1,6 +1,6 @@
    - + <%= image_tag(url_to_avatar(@organization), width:"67", height: "61", :id => 'nh_user_tx', :class => "por_logo fl ", :target => "_blank") %> <% if User.current.logged? %> diff --git a/app/views/organizations/_org_students_list.html.erb b/app/views/organizations/_org_students_list.html.erb new file mode 100644 index 000000000..4f768d29f --- /dev/null +++ b/app/views/organizations/_org_students_list.html.erb @@ -0,0 +1,45 @@ +<% org_students.each do |org_student| %> + <% school = School.where("id =?", org_student.school_id).first %> +
    +
    +
    + <%= link_to image_tag(url_to_avatar(org_student), :width => "90", :height => "90"), user_url_in_org(org_student), :alt => "用户头像" %> +
    +
    +
    <%=link_to org_student.try(:realname).nil? ? org_student.try(:login) : org_student.try(:realname), user_url_in_org(org_student) %> + <% unless school.nil? %> + <%= school.name %> + <% end %> +
    +
    +
    <%= org_student.courses.count %>
    +
    课程数
    +
    +
    +
    +
    <%= org_teacher_resource_count(org_student) %>
    +
    资源数
    +
    +
    + <% if User.current.admin_of_org?(@organization) %> + <%= org_student.excellent_student ==0 ? "设为学霸" : "取消设置" %> + <% end %> +
    +
    +
    +<% end %> + + \ No newline at end of file diff --git a/app/views/organizations/_setting_excellent_students.html.erb b/app/views/organizations/_setting_excellent_students.html.erb new file mode 100644 index 000000000..696d85378 --- /dev/null +++ b/app/views/organizations/_setting_excellent_students.html.erb @@ -0,0 +1,12 @@ +<% if @organization.allow_set_teachers && !org_subfield_had_created?(@organization, "Comptec") %> +
  • + + +
  • +<% end %> +<% if User.current.admin? && !org_subfield_had_created?(@organization, "Compstu") %> +
  • + + +
  • +<% end %> \ No newline at end of file diff --git a/app/views/organizations/_subfield_list.html.erb b/app/views/organizations/_subfield_list.html.erb index f16e53b0e..9307f3eb0 100644 --- a/app/views/organizations/_subfield_list.html.erb +++ b/app/views/organizations/_subfield_list.html.erb @@ -92,7 +92,7 @@ <%= link_to "删除", org_subfield_path(field), :method => 'delete', :remote => true, :confirm => "您确定删除吗?", :class => "linkGrey fr ml5 mr5" %> | 编辑 - <% unless field.field_type == "Resource" || field.field_type == "Comptec" %> + <% unless field.field_type == "Resource" || field.field_type == "Comptec" || field.field_type == "Compstu" %> | diff --git a/app/views/organizations/reset_excellent_teacher.js.erb b/app/views/organizations/reset_excellent_teacher.js.erb index fdf160bc4..8b7c6cc71 100644 --- a/app/views/organizations/reset_excellent_teacher.js.erb +++ b/app/views/organizations/reset_excellent_teacher.js.erb @@ -1 +1 @@ -$("#hide_<%= @ex_teacher.id %>").text("设为名师"); \ No newline at end of file +$("#hide_<%= @ex_teacher.id %>").text(<%= params[:type]== "student" ? "设为学霸" : "设为名师"%>); \ No newline at end of file diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb index 0c8af8471..1920213cb 100644 --- a/app/views/organizations/setting.html.erb +++ b/app/views/organizations/setting.html.erb @@ -87,11 +87,11 @@  允许游客下载 <%= @organization.is_public? ? "" : "(私有组织不允许游客下载资源)" %> - <% if User.current.admin? %> -
    允许设置名师榜 : - class="ml3" /> -
    - <% end %> + + + + + 保存 <% end %> @@ -162,8 +162,8 @@ -
    - <%= render :partial => 'organizations/setting_excellent_teachers' %> +
    + <%= render :partial => 'organizations/org_custom_admin' %>
  • 新增
  • diff --git a/app/views/organizations/students.html.erb b/app/views/organizations/students.html.erb new file mode 100644 index 000000000..770967210 --- /dev/null +++ b/app/views/organizations/students.html.erb @@ -0,0 +1,30 @@ +
    +
    + <% if @type == "famous" %> + 学霸列表 + <% else %> + <%= @field.name %> + <% end %> +
    +
    +
    + +
    + <%=render 'organizations/org_students_list', :org_students => @org_students %> +
    +
    +
      + <%= pagination_links_full @atta_pages, @students_count, :per_page_links => false, :flag => true %> +
    +
    +
    \ No newline at end of file diff --git a/app/views/organizations/students.js.erb b/app/views/organizations/students.js.erb new file mode 100644 index 000000000..c65f8f861 --- /dev/null +++ b/app/views/organizations/students.js.erb @@ -0,0 +1,3 @@ +$("#org_students_list").html('<%= escape_javascript( render :partial => 'organizations/org_students_list', :locals => {:org_students => @org_students})%>'); +$("#pages").html('<%= pagination_links_full @atta_pages, @students_count, :per_page_links => false, :remote => @is_remote, :flag => true %>'); +$("#org_student_search").attr('href','<%= students_organization_path(@organization, :type => @type) %>'); \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 2863d49a4..71b8f298e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -77,6 +77,7 @@ RedmineApp::Application.routes.draw do get 'more_org_courses' get 'search_courses' get 'teachers' + get 'students' post 'join_course_menu' post 'join_courses' get 'search_projects' @@ -94,7 +95,9 @@ RedmineApp::Application.routes.draw do post 'hide_org_subfield' post 'show_org_subfield' post 'set_excellent_teacher' + post 'set_excellent_student' post 'reset_excellent_teacher' + post 'reset_excellent_student' post 'agree_apply_subdomain' end end diff --git a/db/migrate/20160531021244_add_excellent_student_to_user.rb b/db/migrate/20160531021244_add_excellent_student_to_user.rb new file mode 100644 index 000000000..08378bca5 --- /dev/null +++ b/db/migrate/20160531021244_add_excellent_student_to_user.rb @@ -0,0 +1,5 @@ +class AddExcellentStudentToUser < ActiveRecord::Migration + def change + add_column :users, :excellent_student, :integer, :default => false + end +end diff --git a/db/schema.rb b/db/schema.rb index 7462c304e..f7d61f57c 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 => 20160523085440) do +ActiveRecord::Schema.define(:version => 20160531021244) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -2426,6 +2426,7 @@ ActiveRecord::Schema.define(:version => 20160523085440) do t.integer "gid" t.integer "visits", :default => 0 t.integer "excellent_teacher", :default => 0 + t.integer "excellent_student", :default => 0 end add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id" From 19de82359a7db0686cbea05a16a0418860885a3b Mon Sep 17 00:00:00 2001 From: txz Date: Tue, 31 May 2016 10:53:11 +0800 Subject: [PATCH 031/126] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E8=BF=9B=E5=85=A5?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E6=98=BE=E7=A4=BA=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/blog_detail.html | 1 + public/assets/wechat/course_discussion.html | 1 + public/assets/wechat/course_notice.html | 1 + public/assets/wechat/homework_detail.html | 1 + public/assets/wechat/issue_detail.html | 1 + public/assets/wechat/jour_message_detail.html | 1 + public/assets/wechat/project_discussion.html | 1 + 7 files changed, 7 insertions(+) diff --git a/public/assets/wechat/blog_detail.html b/public/assets/wechat/blog_detail.html index fa3a9f341..bd398c988 100644 --- a/public/assets/wechat/blog_detail.html +++ b/public/assets/wechat/blog_detail.html @@ -1,5 +1,6 @@ +
    diff --git a/public/assets/wechat/course_discussion.html b/public/assets/wechat/course_discussion.html index d1b65e629..46ef95cfa 100644 --- a/public/assets/wechat/course_discussion.html +++ b/public/assets/wechat/course_discussion.html @@ -1,5 +1,6 @@ +
    diff --git a/public/assets/wechat/course_notice.html b/public/assets/wechat/course_notice.html index c10763bf8..a4bca9809 100644 --- a/public/assets/wechat/course_notice.html +++ b/public/assets/wechat/course_notice.html @@ -1,5 +1,6 @@ +
    diff --git a/public/assets/wechat/homework_detail.html b/public/assets/wechat/homework_detail.html index 2783bd317..0671da049 100644 --- a/public/assets/wechat/homework_detail.html +++ b/public/assets/wechat/homework_detail.html @@ -1,5 +1,6 @@ +
    diff --git a/public/assets/wechat/issue_detail.html b/public/assets/wechat/issue_detail.html index 035a7c98d..0be7ba5ac 100644 --- a/public/assets/wechat/issue_detail.html +++ b/public/assets/wechat/issue_detail.html @@ -1,5 +1,6 @@ +
    diff --git a/public/assets/wechat/jour_message_detail.html b/public/assets/wechat/jour_message_detail.html index 5ccbf6248..9b1494abe 100644 --- a/public/assets/wechat/jour_message_detail.html +++ b/public/assets/wechat/jour_message_detail.html @@ -1,4 +1,5 @@ +
    diff --git a/public/assets/wechat/project_discussion.html b/public/assets/wechat/project_discussion.html index be639c1a0..69625c0c5 100644 --- a/public/assets/wechat/project_discussion.html +++ b/public/assets/wechat/project_discussion.html @@ -1,5 +1,6 @@ +
    From 79c106a1c6bd5f0e3d9e698304749d58a0315f16 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 31 May 2016 11:04:20 +0800 Subject: [PATCH 032/126] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E7=9A=84=E7=BC=BA=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/apis/activities.rb | 20 ++------------------ public/assets/wechat/activities.html | 2 +- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/app/api/mobile/apis/activities.rb b/app/api/mobile/apis/activities.rb index 2275a550e..af17e0f44 100644 --- a/app/api/mobile/apis/activities.rb +++ b/app/api/mobile/apis/activities.rb @@ -13,28 +13,12 @@ module Mobile end post do user = UserWechat.find_by_openid(params[:openid]).user -=begin - shield_project_ids = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project'").map(&:shield_id) - shield_course_ids = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Course'").map(&:shield_id) - page = params[:page] ? params[:page] : 0 - user_project_ids = (user.projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (user.projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")" - user_course_ids = (user.courses.visible.map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (user.courses.visible.map{|course| course.id}-shield_course_ids).join(",") + ")" - course_types = "('Message','News','HomeworkCommon','Poll','Course')" - project_types = "('Message','Issue','ProjectCreateInfo')" - principal_types = "JournalsForMessage" - - blog_ids = "("+user.blog.id.to_s+","+((User.watched_by(user.id).count == 0 )? '0' :User.watched_by(user.id).map{|u| u.blog.id}.join(','))+")" - activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" + - "or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+ - "or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{user.id}) " + - "or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})").order('updated_at desc') -=end shield_project_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{user.id} and shield_type='Project'").map(&:shield_id) shield_course_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{user.id} and shield_type='Course'").map(&:shield_id) page = params[:page] ? params[:page] : 0 - user_project_ids = (user.projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (user.projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")" - user_course_ids = (user.courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (user.courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).join(",") + ")" + user_project_ids = (user.projects.where("status = 1").map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (user.projects.where("status = 1").map{|project| project.id}-shield_project_ids).join(",") + ")" + user_course_ids = (user.courses.where("is_delete = 0").map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (user.courses.where("is_delete = 0").map{|course| course.id}-shield_course_ids).join(",") + ")" course_types = "('Message','News','HomeworkCommon','Poll','Course')" project_types = "('Message','Issue','Project')" principal_types = "JournalsForMessage" diff --git a/public/assets/wechat/activities.html b/public/assets/wechat/activities.html index 1bab8dfb4..30b4dafaa 100644 --- a/public/assets/wechat/activities.html +++ b/public/assets/wechat/activities.html @@ -175,7 +175,7 @@
    -
    +
    From c369b271a0d967dd2edb309ddbf91d27930c8f3f Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 31 May 2016 11:24:47 +0800 Subject: [PATCH 033/126] =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E9=85=8D=E7=BD=AE=E5=90=8E=E7=9A=84=E6=9D=83=E9=99=90?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=8F=8A=E5=B1=80=E9=83=A8=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/organizations_helper.rb | 8 ++++++++ app/views/org_subfields/create.js.erb | 3 +-- app/views/org_subfields/destroy.js.erb | 5 ++--- app/views/org_subfields/update.js.erb | 3 ++- app/views/org_subfields/update_priority.js.erb | 4 ++-- app/views/organizations/_org_left_subfield_list.html.erb | 8 +++++--- app/views/organizations/setting.html.erb | 2 +- app/views/sub_domains/create.js.erb | 2 +- app/views/sub_domains/destroy.js.erb | 2 +- app/views/sub_domains/domain_update_priority.js.erb | 2 +- app/views/sub_domains/update.js.erb | 3 ++- 11 files changed, 26 insertions(+), 16 deletions(-) diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index 7298841b1..4a712c0f0 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -132,6 +132,14 @@ module OrganizationsHelper end end + # 系统栏目只有管理员才能看到 + def subfield_to_addmin?(org) + if User.current.admin? + @organization.org_subfields.order("priority") + else + @organization.org_subfields.select { |os| (os.field_type != "Comptec" && os.field_type != "Compstu") }.sort_by {|os| os.priority} + end + end def get_subfield_acts field org_subfield = OrgSubfield.find(field.id) diff --git a/app/views/org_subfields/create.js.erb b/app/views/org_subfields/create.js.erb index f1661ba87..952ed7b2c 100644 --- a/app/views/org_subfields/create.js.erb +++ b/app/views/org_subfields/create.js.erb @@ -1,7 +1,6 @@ <% if @res %> $("#org_subfield_list").html(""); - $("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', - :locals => {:subfields => @organization.org_subfields.order("priority") }) %>"); + $("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)}) %>"); $("#sub_field_left_lists").html(""); $("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>"); $("#org_custom_admin").html("<%= escape_javascript(render :partial => 'organizations/org_custom_admin') %>"); diff --git a/app/views/org_subfields/destroy.js.erb b/app/views/org_subfields/destroy.js.erb index 60ce47fe6..f61e1c100 100644 --- a/app/views/org_subfields/destroy.js.erb +++ b/app/views/org_subfields/destroy.js.erb @@ -1,6 +1,5 @@ $("#org_subfield_list").html(""); -$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', - :locals => {:subfields => @organization.org_subfields.order("priority") }) %>"); +$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)}) %>"); $("#sub_field_left_lists").html(""); $("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>"); -$("#org_custom_admin").html("<%= escape_javascript(render :partial => 'organizations/org_custom_admin') %>"); \ No newline at end of file +$("#org_custom_admin").html("<%= escape_javascript(render :partial => 'organizations/org_custom_admin') %>"); diff --git a/app/views/org_subfields/update.js.erb b/app/views/org_subfields/update.js.erb index 06982ccfc..c030b7767 100644 --- a/app/views/org_subfields/update.js.erb +++ b/app/views/org_subfields/update.js.erb @@ -1,3 +1,4 @@ $("#subfield_show_<%= @subfield.id %>").html("<%= @subfield.name %>"); $("#sub_field_left_lists").html(""); -$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>"); \ No newline at end of file +$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>"); +$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)}) %>"); \ No newline at end of file diff --git a/app/views/org_subfields/update_priority.js.erb b/app/views/org_subfields/update_priority.js.erb index 475649aac..043e8acbd 100644 --- a/app/views/org_subfields/update_priority.js.erb +++ b/app/views/org_subfields/update_priority.js.erb @@ -1,2 +1,2 @@ -$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list',:locals => {:subfields => @organization.org_subfields.order("priority")}) %>"); -$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>"); \ No newline at end of file +$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)}) %>"); +$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>"); diff --git a/app/views/organizations/_org_left_subfield_list.html.erb b/app/views/organizations/_org_left_subfield_list.html.erb index 4340213a4..12edd4201 100644 --- a/app/views/organizations/_org_left_subfield_list.html.erb +++ b/app/views/organizations/_org_left_subfield_list.html.erb @@ -101,13 +101,15 @@ <%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %> <% end %> <% else %> - <% if field.field_type == "Comptec" %> + <% if field.field_type == "Comptec" && User.current.admin? %> <%= link_to "#{field.name}", teachers_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %> - <% else %> + <% elsif field.field_type == "Compstu" && User.current.admin? %> + <%= link_to "#{field.name}", students_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %> + <% elsif field.field_type != "Comptec" && field.field_type != "Compstu" %> <%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %> <% end %> <% end %> - <% if User.current.logged? and User.current.admin_of_org?(organization) && field.field_type != "Comptec" %> + <% if User.current.logged? and User.current.admin_of_org?(organization) && field.field_type != "Comptec" && field.field_type != "Compstu" %> <%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子" %> <% end %>
    diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb index 1920213cb..06420363a 100644 --- a/app/views/organizations/setting.html.erb +++ b/app/views/organizations/setting.html.erb @@ -172,7 +172,7 @@
    - <%= render :partial => 'organizations/subfield_list', :locals => {:subfields => @organization.org_subfields.order("priority")} %> + <%= render :partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)} %>
    diff --git a/app/views/sub_domains/create.js.erb b/app/views/sub_domains/create.js.erb index 0990e35de..d793efd6e 100644 --- a/app/views/sub_domains/create.js.erb +++ b/app/views/sub_domains/create.js.erb @@ -1,6 +1,6 @@ <% if @res %> $("#org_subfield_list").html(""); -$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', :locals => {:subfields => @organization.org_subfields.order("priority") }) %>"); +$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)}) %>"); $("#sub_field_left_lists").html(""); $("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>"); <% end %> diff --git a/app/views/sub_domains/destroy.js.erb b/app/views/sub_domains/destroy.js.erb index 913c400f7..4d8ef21de 100644 --- a/app/views/sub_domains/destroy.js.erb +++ b/app/views/sub_domains/destroy.js.erb @@ -1,4 +1,4 @@ $("#org_subfield_list").html(""); -$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', :locals => {:subfields => @organization.org_subfields.order("priority") }) %>"); +$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)}) %>"); $("#sub_field_left_lists").html(""); $("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>"); \ No newline at end of file diff --git a/app/views/sub_domains/domain_update_priority.js.erb b/app/views/sub_domains/domain_update_priority.js.erb index 475649aac..e4de7c931 100644 --- a/app/views/sub_domains/domain_update_priority.js.erb +++ b/app/views/sub_domains/domain_update_priority.js.erb @@ -1,2 +1,2 @@ -$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list',:locals => {:subfields => @organization.org_subfields.order("priority")}) %>"); +$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)}) %>"); $("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>"); \ No newline at end of file diff --git a/app/views/sub_domains/update.js.erb b/app/views/sub_domains/update.js.erb index 02810eee7..2c0af9c42 100644 --- a/app/views/sub_domains/update.js.erb +++ b/app/views/sub_domains/update.js.erb @@ -1,3 +1,4 @@ $("#subsubdomain_show_<%= @subdomain.id %>").html("<%= @subdomain.name %>"); $("#sub_field_left_lists").html(""); -$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>"); \ No newline at end of file +$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>"); +$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)}) %>"); \ No newline at end of file From 8f897cbf89a5395727e985628d7346c3f77dc096 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 31 May 2016 13:47:05 +0800 Subject: [PATCH 034/126] =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E6=A8=A1=E5=BC=8F=EF=BC=8C=E4=BA=8C=E7=BA=A7=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E5=B1=80=E9=83=A8=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/sub_domains_controller.rb | 3 ++ .../_org_left_subfield_list.html.erb | 29 ++++++++++++++++++- app/views/organizations/setting.html.erb | 2 +- app/views/sub_domains/_new.html.erb | 9 ------ app/views/sub_domains/create.js.erb | 3 -- 5 files changed, 32 insertions(+), 14 deletions(-) diff --git a/app/controllers/sub_domains_controller.rb b/app/controllers/sub_domains_controller.rb index e32935789..438b67eec 100644 --- a/app/controllers/sub_domains_controller.rb +++ b/app/controllers/sub_domains_controller.rb @@ -18,6 +18,9 @@ class SubDomainsController < ApplicationController else @res = false end + respond_to do |format| + format.js + end end def update diff --git a/app/views/organizations/_org_left_subfield_list.html.erb b/app/views/organizations/_org_left_subfield_list.html.erb index 12edd4201..b51b57afb 100644 --- a/app/views/organizations/_org_left_subfield_list.html.erb +++ b/app/views/organizations/_org_left_subfield_list.html.erb @@ -91,7 +91,34 @@ <% end %> <% else %>
    - <% if field.field_type == "Post" || field.field_type == "Complex" || field.field_type == "Compstu" || field.field_type == "Comptec" %> + <% if field.field_type == "Post" || field.field_type == "Complex" %> +
    + + <% if !field.subfield_subdomain_dir.nil? %> + <% if !request.local? and Secdomain.where("sub_type=2 and pid=?", organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", organization.id).map(&:subname).include?(request.subdomain) %> + <%= link_to "#{field.name}", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %> + <% else %> + <%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %> + <% end %> + <% else %> + <%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %> + <% end %> + <% if User.current.logged? and User.current.admin_of_org?(organization) %> + <%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子" %> + <% end %> +
    + + + <% unless (field.sub_domains.count == 0 || !if_hidden_subdomain(field)) %> +
  • + +
  • + <% end %> + <% elsif field.field_type == "Comptec" %>
    <% if !field.subfield_subdomain_dir.nil? %> diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb index 06420363a..775bc7e6a 100644 --- a/app/views/organizations/setting.html.erb +++ b/app/views/organizations/setting.html.erb @@ -184,7 +184,7 @@ function add_org_subfield_subdomain(){ if ($("#subfield_name_subdomain").val().trim() != "") $("#add_subfield_form_subdomain").submit(); - $("#org_subfield_list").html('<%= escape_javascript(render(:partial => 'organizations/subfield_list', :locals => {:subfields => @organization.org_subfields.order("priority")} )) %>'); + $("#org_subfield_list").html('<%= escape_javascript(render(:partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)})) %>'); } var $is_exist = false; function apply_subdomain(id, domain){ diff --git a/app/views/sub_domains/_new.html.erb b/app/views/sub_domains/_new.html.erb index 25b660750..865eae785 100644 --- a/app/views/sub_domains/_new.html.erb +++ b/app/views/sub_domains/_new.html.erb @@ -9,10 +9,6 @@ - - - -
  • @@ -20,8 +16,3 @@ <% end %>
    - - - \ No newline at end of file diff --git a/app/views/sub_domains/create.js.erb b/app/views/sub_domains/create.js.erb index d793efd6e..8c7b7f64a 100644 --- a/app/views/sub_domains/create.js.erb +++ b/app/views/sub_domains/create.js.erb @@ -1,8 +1,5 @@ <% if @res %> -$("#org_subfield_list").html(""); $("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)}) %>"); $("#sub_field_left_lists").html(""); $("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>"); <% end %> -$("#subfield_name").val(""); -$("#sub_dir").val(""); \ No newline at end of file From f166a951f3665c7edbdaed54927f341f258a1ba8 Mon Sep 17 00:00:00 2001 From: txz Date: Tue, 31 May 2016 13:49:39 +0800 Subject: [PATCH 035/126] =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=96=87=E5=AD=97=E6=A0=BC=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/blog_detail.html | 4 +--- public/assets/wechat/course_discussion.html | 4 +--- public/assets/wechat/course_notice.html | 4 +--- public/assets/wechat/homework_detail.html | 12 +++++------- public/assets/wechat/issue_detail.html | 12 +++++------- public/assets/wechat/jour_message_detail.html | 4 +--- public/assets/wechat/project_discussion.html | 4 +--- 7 files changed, 15 insertions(+), 29 deletions(-) diff --git a/public/assets/wechat/blog_detail.html b/public/assets/wechat/blog_detail.html index bd398c988..4e0fb3577 100644 --- a/public/assets/wechat/blog_detail.html +++ b/public/assets/wechat/blog_detail.html @@ -8,9 +8,7 @@
    {{blog.title}}
    {{blog.user.realname}}发表博客
    -
    -
    -
    +
    {{blog.created_at}}
    diff --git a/public/assets/wechat/course_discussion.html b/public/assets/wechat/course_discussion.html index 46ef95cfa..0d7beb9e6 100644 --- a/public/assets/wechat/course_discussion.html +++ b/public/assets/wechat/course_discussion.html @@ -15,9 +15,7 @@ 来   源: {{discussion.course_project_name}}  |  课程问答区 -
    -
    -
    +
    {{discussion.created_on}}
    diff --git a/public/assets/wechat/course_notice.html b/public/assets/wechat/course_notice.html index a4bca9809..22906af39 100644 --- a/public/assets/wechat/course_notice.html +++ b/public/assets/wechat/course_notice.html @@ -14,9 +14,7 @@ 来   源: {{news.course_name}}  |  课程通知 -
    -
    -
    +
    {{news.created_on}}
    diff --git a/public/assets/wechat/homework_detail.html b/public/assets/wechat/homework_detail.html index 0671da049..b822f9866 100644 --- a/public/assets/wechat/homework_detail.html +++ b/public/assets/wechat/homework_detail.html @@ -16,13 +16,11 @@ 来   源: {{homework.course_name}}  |  课程作业 -
    -
    - 迟交扣分:{{homework.late_penalty}}分
    - 缺评扣分:{{homework.absence_penalty}}分/作品
    - 匿评开启时间:{{homework.evaluation_start}}
    - 匿评关闭时间:{{homework.evaluation_end}} -
    +
    + 迟交扣分:{{homework.late_penalty}}分
    + 缺评扣分:{{homework.absence_penalty}}分/作品
    + 匿评开启时间:{{homework.evaluation_start}}
    + 匿评关闭时间:{{homework.evaluation_end}}
    {{homework.publish_time}}
    diff --git a/public/assets/wechat/issue_detail.html b/public/assets/wechat/issue_detail.html index 0be7ba5ac..28b02c5aa 100644 --- a/public/assets/wechat/issue_detail.html +++ b/public/assets/wechat/issue_detail.html @@ -14,13 +14,11 @@ 来   源: {{issue.project_name}}  |  项目问题 -
    -
    - 状   态:{{issue.issue_status}}
    - 优先级:{{issue.issue_priority}}
    - 指派给:{{issue.issue_assigned_to}}
    - 完成度:{{issue.done_ratio}}%
    -
    +
    + 状   态:{{issue.issue_status}}
    + 优先级:{{issue.issue_priority}}
    + 指派给:{{issue.issue_assigned_to}}
    + 完成度:{{issue.done_ratio}}%
    {{issue.created_on}}
    diff --git a/public/assets/wechat/jour_message_detail.html b/public/assets/wechat/jour_message_detail.html index 9b1494abe..a4ad7a0dd 100644 --- a/public/assets/wechat/jour_message_detail.html +++ b/public/assets/wechat/jour_message_detail.html @@ -7,9 +7,7 @@
    {{message.user.realname}}给您留言了
    {{message.created_on}}
    -
    -
    -
    +
    diff --git a/public/assets/wechat/project_discussion.html b/public/assets/wechat/project_discussion.html index 69625c0c5..4b86eaf28 100644 --- a/public/assets/wechat/project_discussion.html +++ b/public/assets/wechat/project_discussion.html @@ -14,9 +14,7 @@ 来   源: {{discussion.course_project_name}}  |  项目讨论区 -
    -
    -
    +
    {{discussion.created_on}}
    From 6bfe344cbf8cfe0cf6b72af36590173f7a391c0b Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 31 May 2016 13:59:29 +0800 Subject: [PATCH 036/126] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E4=B8=80=E5=B7=A6=E4=BE=A7=E6=9D=83=E9=99=90=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_org_left_subfield_list.html.erb | 38 +++---------------- 1 file changed, 6 insertions(+), 32 deletions(-) diff --git a/app/views/organizations/_org_left_subfield_list.html.erb b/app/views/organizations/_org_left_subfield_list.html.erb index b51b57afb..e621df8bd 100644 --- a/app/views/organizations/_org_left_subfield_list.html.erb +++ b/app/views/organizations/_org_left_subfield_list.html.erb @@ -112,46 +112,20 @@ <%= render :partial => 'organizations/org_subdomain',:locals=>{:subdomains => field.sub_domains.reorder('priority').uniq, :org_subfield_id => field.id} %>
    - <% unless (field.sub_domains.count == 0 || !if_hidden_subdomain(field)) %>
  • <% end %> - <% elsif field.field_type == "Comptec" %> + <% elsif field.field_type == "Comptec" && User.current.admin? %>
    - - <% if !field.subfield_subdomain_dir.nil? %> - <% if !request.local? and Secdomain.where("sub_type=2 and pid=?", organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", organization.id).map(&:subname).include?(request.subdomain) %> - <%= link_to "#{field.name}", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %> - <% else %> - <%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %> - <% end %> - <% else %> - <% if field.field_type == "Comptec" && User.current.admin? %> - <%= link_to "#{field.name}", teachers_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %> - <% elsif field.field_type == "Compstu" && User.current.admin? %> - <%= link_to "#{field.name}", students_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %> - <% elsif field.field_type != "Comptec" && field.field_type != "Compstu" %> - <%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %> - <% end %> - <% end %> - <% if User.current.logged? and User.current.admin_of_org?(organization) && field.field_type != "Comptec" && field.field_type != "Compstu" %> - <%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子" %> - <% end %> + <%= link_to "#{field.name}", teachers_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
    -
    diff --git a/public/assets/wechat/course_discussion.html b/public/assets/wechat/course_discussion.html index 0d7beb9e6..f02c01ff6 100644 --- a/public/assets/wechat/course_discussion.html +++ b/public/assets/wechat/course_discussion.html @@ -46,7 +46,8 @@
    - + +
    diff --git a/public/assets/wechat/course_notice.html b/public/assets/wechat/course_notice.html index 22906af39..0a85ed089 100644 --- a/public/assets/wechat/course_notice.html +++ b/public/assets/wechat/course_notice.html @@ -45,7 +45,8 @@
    - + +
    diff --git a/public/assets/wechat/homework_detail.html b/public/assets/wechat/homework_detail.html index b822f9866..e416b7313 100644 --- a/public/assets/wechat/homework_detail.html +++ b/public/assets/wechat/homework_detail.html @@ -51,7 +51,8 @@
    - + +
    diff --git a/public/assets/wechat/issue_detail.html b/public/assets/wechat/issue_detail.html index 28b02c5aa..7b5db0afa 100644 --- a/public/assets/wechat/issue_detail.html +++ b/public/assets/wechat/issue_detail.html @@ -49,8 +49,9 @@
    - -
    + + +
    diff --git a/public/assets/wechat/jour_message_detail.html b/public/assets/wechat/jour_message_detail.html index a4ad7a0dd..fada796f8 100644 --- a/public/assets/wechat/jour_message_detail.html +++ b/public/assets/wechat/jour_message_detail.html @@ -37,7 +37,8 @@
    - + +
    diff --git a/public/assets/wechat/project_discussion.html b/public/assets/wechat/project_discussion.html index 4b86eaf28..bd863f5ed 100644 --- a/public/assets/wechat/project_discussion.html +++ b/public/assets/wechat/project_discussion.html @@ -45,7 +45,8 @@
    - + +
    diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 8f00a2b96..267fefb43 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -1,10 +1,10 @@ var app = angular.module('wechat', ['ngRoute','ngCookies']); var apiUrl = '/api/v1/'; -var debug = false; //调试标志,如果在本地请置为true +var debug = true; //调试标志,如果在本地请置为true if(debug===true){ - //apiUrl = 'http://localhost:3000/api/v1/'; - apiUrl = 'https://www.trustie.net/api/v1/'; + apiUrl = 'http://localhost:3000/api/v1/'; + //apiUrl = 'https://www.trustie.net/api/v1/'; } app.factory('auth', function($http,$routeParams, $cookies, $q){ diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index ba3eac3df..b09c54109 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -84,3 +84,5 @@ a.underline {text-decoration:underline;} /*帖子锁定样式*/ .locked_btn_cir {background: url("/images/locked.png") 0 0 no-repeat; cursor: default;} + +.bg-grey {background-color:#c1c1c1;} From 80452ceef92553d98fbaf6cc288e7fb29a2ec701 Mon Sep 17 00:00:00 2001 From: txz Date: Tue, 31 May 2016 14:38:55 +0800 Subject: [PATCH 039/126] =?UTF-8?q?app.js=E6=96=87=E4=BB=B6=E6=9B=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 267fefb43..8f00a2b96 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -1,10 +1,10 @@ var app = angular.module('wechat', ['ngRoute','ngCookies']); var apiUrl = '/api/v1/'; -var debug = true; //调试标志,如果在本地请置为true +var debug = false; //调试标志,如果在本地请置为true if(debug===true){ - apiUrl = 'http://localhost:3000/api/v1/'; - //apiUrl = 'https://www.trustie.net/api/v1/'; + //apiUrl = 'http://localhost:3000/api/v1/'; + apiUrl = 'https://www.trustie.net/api/v1/'; } app.factory('auth', function($http,$routeParams, $cookies, $q){ From bb7204846fff4a57a66c8a69eec9c761dd689767 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 31 May 2016 14:41:50 +0800 Subject: [PATCH 040/126] =?UTF-8?q?=E6=96=B0=E7=89=88=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=AE=9A=E5=88=B6=E6=A8=A1=E5=BC=8F6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/organizations_helper.rb | 5 +- .../organizations/_org_custom_right3.html.erb | 233 +++++++++++------- 2 files changed, 146 insertions(+), 92 deletions(-) diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index 4a712c0f0..cd3322283 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -44,9 +44,8 @@ module OrganizationsHelper def get_attach_org2(field) org_attachments = field.attachments - attachments = User.current.admin? ? org_attachments : visable_attachemnts(org_attachments) - return attachments.sort_by{|x| x.created_on}.reverse.first(6) - # Attachment.find_by_sql("SELECT * FROM `attachments` where container_id =#{field_id} and container_type = 'OrgSubfield' and is_public =1 order by created_on limit 6;") + attachments = User.current.admin? ? org_attachments.first(5) : visable_attachemnts(org_attachments).first(5) + attachments.sort_by{|x| x.created_on}.reverse end # 从内容中获取路径 diff --git a/app/views/organizations/_org_custom_right3.html.erb b/app/views/organizations/_org_custom_right3.html.erb index 698a2ea25..c29097400 100644 --- a/app/views/organizations/_org_custom_right3.html.erb +++ b/app/views/organizations/_org_custom_right3.html.erb @@ -1,91 +1,146 @@ -
    - -
    -
      -
    • - -
      - 张晓华张晓华张晓华张晓华 -

      国防科学技术大学学技术大学学技术大学学技术大学学技术大学

      -
      -

      博客20 课程20学生 20

      -
      +<% if field.field_type == "Resource" %> +
      +

      <%= field.name %><%= link_to "更多", org_subfield_files_path(field), :target => "_blank", :class => "por_more_index fr" %>

      +
      +
        + <% get_attach_org2(field).each do |attach| %> +
      • + <%= link_to image_tag(url_to_avatar(attach.author),:width => "43", :height => "43", :class => "por_teachers_img fl mr15"), user_path(attach.author), :target => "_blank", :class => "fl" %> + +
        + <%= link_to attach.author, user_path(attach.author), :class => " por_teachers_name fl", :target => "_blank" %> +

        + <%= link_to truncate(attach.filename,length: 20, omission: '...'), + download_named_attachment_path(attach.id, attach.filename), + :title => attach.filename+"\n"+attach.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %> +

        +
        +

        + 类型:<%= attach.tag_list[0] %> + 下载:<%= attach.downloads %> + 引用:<%= attach.quotes.nil? ? 0 : attach.quotes %> +

        +
        +
        +
      • + <% end %> +
      +
      +
      + +
      +
      +<% else %> +
      + +
      + -
      -
      - -
      -
      \ No newline at end of file +
    +
    +
    + +
    +
    +<% end %> From e121d7d9270cdffefab90a1b154e0da97e280cfe Mon Sep 17 00:00:00 2001 From: txz Date: Tue, 31 May 2016 14:55:25 +0800 Subject: [PATCH 041/126] =?UTF-8?q?=E4=BA=8C=E7=BA=A7=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=BE=B9=E6=A1=86=E5=8C=BA=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/app.js | 6 +++--- public/stylesheets/weui/weixin.css | 10 ++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 8f00a2b96..267fefb43 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -1,10 +1,10 @@ var app = angular.module('wechat', ['ngRoute','ngCookies']); var apiUrl = '/api/v1/'; -var debug = false; //调试标志,如果在本地请置为true +var debug = true; //调试标志,如果在本地请置为true if(debug===true){ - //apiUrl = 'http://localhost:3000/api/v1/'; - apiUrl = 'https://www.trustie.net/api/v1/'; + apiUrl = 'http://localhost:3000/api/v1/'; + //apiUrl = 'https://www.trustie.net/api/v1/'; } app.factory('auth', function($http,$routeParams, $cookies, $q){ diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index b09c54109..4a88f9705 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -4,6 +4,16 @@ /*基本样式*/ body,table,input,textarea,select,button { font-family: "微软雅黑","宋体";} h1,h2,h3,h4,h5,p,pre {padding:0px; margin:0px;} +blockquote { + border:1px solid #d4d4d4; + padding: 0.6em; + margin-left: 1.4em; + margin-right: 0.4em; + border-radius: 4px; + font-family: "Microsoft YaHei"; + background-size: 100% 100%; + margin-top:5px; +} .f12 {font-size:12px;} .f13 {font-size:13px;} .f15 {font-size:15px;} From 7e93518d4149548b49663dbc6e23bb96f4948c14 Mon Sep 17 00:00:00 2001 From: txz Date: Tue, 31 May 2016 14:56:24 +0800 Subject: [PATCH 042/126] =?UTF-8?q?app.js=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 267fefb43..8f00a2b96 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -1,10 +1,10 @@ var app = angular.module('wechat', ['ngRoute','ngCookies']); var apiUrl = '/api/v1/'; -var debug = true; //调试标志,如果在本地请置为true +var debug = false; //调试标志,如果在本地请置为true if(debug===true){ - apiUrl = 'http://localhost:3000/api/v1/'; - //apiUrl = 'https://www.trustie.net/api/v1/'; + //apiUrl = 'http://localhost:3000/api/v1/'; + apiUrl = 'https://www.trustie.net/api/v1/'; } app.factory('auth', function($http,$routeParams, $cookies, $q){ From 8d56d8556fb7cca93362e2be6464d6dd2ab5e1bb Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 31 May 2016 16:03:48 +0800 Subject: [PATCH 043/126] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=A8=A1=E5=BC=8F6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/organizations_helper.rb | 18 ++ .../organizations/_org_custom_right3.html.erb | 165 +++++++----------- app/views/organizations/_show_custom.html.erb | 8 +- 3 files changed, 85 insertions(+), 106 deletions(-) diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index cd3322283..4d704ba5f 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -42,6 +42,11 @@ module OrganizationsHelper Attachment.find_by_sql("SELECT * FROM `attachments` where container_id =#{field_id} and container_type = 'OrgSubfield' and is_public =1 order by created_on limit 6;") end + # 获取两种类型的隐藏状态,数量大于0说明是可见 + def double_field_show org + OrgSubfield.find_by_sql("SELECT * FROM `org_subfields` where organization_id = #{org.id} and (field_type = 'Compstu' or field_type = 'Comptec') and hide = 0;").count + end + def get_attach_org2(field) org_attachments = field.attachments attachments = User.current.admin? ? org_attachments.first(5) : visable_attachemnts(org_attachments).first(5) @@ -189,4 +194,17 @@ module OrganizationsHelper from users u, user_extensions ue where u.id = ue.user_id and ue.identity=0 and u.excellent_teacher =1 order by course_count desc").first(5) end + def excellent_students + User.find_by_sql("select u.*, ue.technical_title, ue.school_id,(select count(*) from courses where courses.tea_id = u.id) as course_count + from users u, user_extensions ue where u.id = ue.user_id and ue.identity = 1 and u.excellent_student = 1 order by course_count desc").first(5) + end + + def excellent_teachers_hide? org + org.org_subfields.where(:field_type => "Comptec").first.hide + end + + def excellent_students_hide? org + org.org_subfields.where(:field_type => "Compstu").first.hide + end + end diff --git a/app/views/organizations/_org_custom_right3.html.erb b/app/views/organizations/_org_custom_right3.html.erb index c29097400..34612a8ee 100644 --- a/app/views/organizations/_org_custom_right3.html.erb +++ b/app/views/organizations/_org_custom_right3.html.erb @@ -1,7 +1,7 @@ <% if field.field_type == "Resource" %> -
    -

    <%= field.name %><%= link_to "更多", org_subfield_files_path(field), :target => "_blank", :class => "por_more_index fr" %>

    -
    +
    +

    <%= field.name %><%= link_to "更多>", org_subfield_files_path(field), :target => "_blank", :class => "por_more_index fr" %>

    +
      <% get_attach_org2(field).each do |attach| %>
    • @@ -26,121 +26,80 @@ <% end %>
    -
    - -
    -<% else %> +<% elsif field.field_type == "Comptec" || field.field_type == "Compstu" %>
    -
    +
      -
    • - -
      - 张晓华张晓华张晓华张晓华 -

      国防科学技术大学学技术大学学技术大学学技术大学学技术大学

      -
      -

      博客20 课程20学生 20

      -
      -
      -
    • -
    • - -
      - 张晓华 -

      国防科学技术大学

      -
      -

      博客20 课程20学生 20

      -
      -
      -
    • -
    • - -
      - 张晓华 -

      国防科学技术大学

      -
      -

      博客20 课程20学生 20

      -
      -
      -
    • -
    • - -
      - 张晓华 -

      国防科学技术大学

      -
      -

      博客20 课程20学生 20

      -
      -
      -
    • -
    • - -
      - 张晓华 -

      国防科学技术大学

      -
      -

      博客20 课程20学生 20

      -
      -
      -
    • - + <% excellent_teachers.each do |teacher| %> +
    • + <%= link_to image_tag(url_to_avatar(teacher), :width => "43", :height => "43", :class => "por_teachers_img fl mr15"), user_path(teacher), :alt => "用户头像", :target => '_blank', :class => "fl" %> +
      + <%=link_to teacher.try(:realname) ? teacher.try(:realname) :teacher.try(:login), user_path(teacher), :class => "por_teachers_name fl", :target => '_blank' %> +

      <%= teacher.my_workplace %>

      +
      +

      + <% unless teacher.my_blogs_count == 0 %> + 博客 <%= teacher.my_blogs_count %> + <% end %> + <% unless teacher.courses.count == 0 %> + 课程 <%= teacher.courses.count %> + <% end %> + <% unless teacher.my_students == 0 %> + 学生 <%= teacher.my_students %> + <% end %> +

      +
      +
      +
    • + <% end %>
      -
    • - -
      - 张晓华张晓华张晓华张晓华 -

      国防科学技术大学学技术大学学技术大学学技术大学学技术大学

      -
      -

      博客20 课程20学生 20

      -
      -
      -
    • -
    • - -
      - 张晓华 -

      国防科学技术大学

      -
      -

      博客20 课程20学生 20

      -
      -
      -
    • + <% excellent_students.each do |student| %> +
    • + <%= link_to image_tag(url_to_avatar(student), :width => "43", :height => "43", :class => "por_teachers_img fl mr15"), user_path(student), :alt => "用户头像", :target => '_blank', :class => "fl" %> +
      + <%=link_to student.try(:realname) ? student.try(:realname) :student.try(:login), user_path(student), :class => "por_teachers_name fl", :target => '_blank' %> +

      <%= student.my_workplace %>

      +
      +

      + <% unless student.my_blogs_count == 0 %> + 博客 <%= student.my_blogs_count %> + <% end %> + <% unless student.courses.count == 0 %> + 课程 <%= student.courses.count %> + <% end %> +

      +
      +
      +
    • + <% end %>
    + + <% end %> diff --git a/app/views/organizations/_show_custom.html.erb b/app/views/organizations/_show_custom.html.erb index fbcc0c5f3..4d0d6470f 100644 --- a/app/views/organizations/_show_custom.html.erb +++ b/app/views/organizations/_show_custom.html.erb @@ -22,9 +22,11 @@ <% elsif field.status.to_i == 5 %> <%= render :partial => 'organizations/org_custom_right2', :locals => {:field => field} %> <% elsif field.status.to_i == 6 %> - <%= render :partial => 'organizations/org_custom_right3', :locals => {:field => field} %> - <%# elsif field.status.to_i == 23 %> - <%#= render :partial => 'organizations/org_subfield_rightM2', :locals => {:field => field} %> + <% if field.field_type == "Resource" %> + <%= render :partial => 'organizations/org_custom_right3', :locals => {:field => field} %> + <% else %> <%# 只允许显示一个模块 %> + <%= render :partial => 'organizations/org_custom_right3', :locals => {:field => field} %> + <% end %> <% end %> <% end %>
    From ed84783f260306c7f97ef0b57e33412c806cd73b Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 31 May 2016 17:03:50 +0800 Subject: [PATCH 044/126] =?UTF-8?q?=E7=A7=81=E6=9C=89=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=9A=84=E5=85=AC=E5=BC=80=E4=BD=9C=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 4 ++-- .../_alert_open_student_works.html.erb | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index dd178a1ce..10431f01a 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -390,7 +390,7 @@ class StudentWorkController < ApplicationController student_in_group = '(' + group_students.map{|user| user.id}.join(',') + ')' end #开放作品 || 老师 || 超级管理员 || 禁用匿评&&作业截止&&已提交作品 显示所有列表 - if @homework.is_open == 1 || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.where(:user_id => User.current.id).empty?) + if (@homework.is_open == 1 && @course.is_public == 1) || (@homework.is_open == 1 && @course.is_public == 0 && User.current.member_of_course?(@course)) || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.where(:user_id => User.current.id).empty?) if @order == 'lastname' @stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name elsif @order == 'student_id' @@ -456,7 +456,7 @@ class StudentWorkController < ApplicationController @student_work_count = (search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name).count else - if @homework.is_open == 1 || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.where(:user_id => User.current.id).empty?) + if (@homework.is_open == 1 &&@course.is_public == 1) || (@homework.is_open == 1 && @course.is_public == 0 && User.current.member_of_course?(@course)) || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.where(:user_id => User.current.id).empty?) if @order == 'lastname' @stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name elsif @order == 'student_id' diff --git a/app/views/homework_common/_alert_open_student_works.html.erb b/app/views/homework_common/_alert_open_student_works.html.erb index ef8fe3d08..73c7f0b47 100644 --- a/app/views/homework_common/_alert_open_student_works.html.erb +++ b/app/views/homework_common/_alert_open_student_works.html.erb @@ -1,10 +1,20 @@
    - <% if @homework.is_open == 0 %> + <% if @homework.is_open == 0 && @homework.course.is_public == 1 %>

    公开作品

    本次作业的所有作品将对Trustie平台所有注册用户开放,请问是否确定公开作品?

    + <% elsif @homework.is_open == 0 && @homework.course.is_public == 0 %> +

    公开作品

    +

    + 该作业是私有课程的作业,公开作品后本次作业的所有作品将对课程内的所有学生开放,请问是否确定公开作品? +

    + <% elsif @homework.is_open == 1 && @homework.course.is_public == 0 %> +

    取消公开作品

    +

    + 您将取消“公开作品”的功能,该私有作业的作品将只在作业截止后对已提交作品的学生开放,请问是否确定? +

    <% else %>

    取消公开作品

    From 8540b48091997f29509e2ca9da2bea3adaccf9d8 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 31 May 2016 17:34:56 +0800 Subject: [PATCH 045/126] =?UTF-8?q?=E6=9C=AA=E7=BB=91=E5=AE=9A=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E8=B4=A6=E5=8F=B7=E6=97=B6=E7=82=B9=E5=87=BB=E2=80=9C?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E5=8A=A8=E6=80=81=E2=80=9D=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/app.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 8f00a2b96..1149ea131 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -1,10 +1,10 @@ var app = angular.module('wechat', ['ngRoute','ngCookies']); var apiUrl = '/api/v1/'; -var debug = false; //调试标志,如果在本地请置为true +var debug = true; //调试标志,如果在本地请置为true if(debug===true){ - //apiUrl = 'http://localhost:3000/api/v1/'; - apiUrl = 'https://www.trustie.net/api/v1/'; + apiUrl = 'http://localhost:3000/api/v1/'; + //apiUrl = 'https://www.trustie.net/api/v1/'; } app.factory('auth', function($http,$routeParams, $cookies, $q){ @@ -78,6 +78,9 @@ app.controller('ActivityController',function($scope, $http, auth, rms, common){ url: apiUrl+ "activities", data: {openid: auth.openid(), page: page} }).then(function successCallback(response) { + if(response.data.message == "undefined method `user' for nil:NilClass"){ + alert("请先绑定确实的用户账号"); + } $scope.current_page = 0; console.log($scope.current_page); console.log(response.data.page); From a96fafd704284eeea52872105f6967bb447ec45b Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 31 May 2016 18:37:21 +0800 Subject: [PATCH 046/126] =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=B8=89=EF=BC=88?= =?UTF-8?q?=E6=9C=AA=E5=AE=8C=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/organizations_helper.rb | 1 - .../_link_subfield_more.html.erb | 6 +- .../organizations/_org_custom_left3.html.erb | 235 +++++++++++++++--- app/views/organizations/_show_custom.html.erb | 15 +- 4 files changed, 205 insertions(+), 52 deletions(-) diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index 4d704ba5f..437014528 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -149,7 +149,6 @@ module OrganizationsHelper org_subfield = OrgSubfield.find(field.id) org_subfield_ids = org_subfield.org_document_comments.map(&:id) << 0 org_acts = OrgActivity.where("(org_act_type='OrgDocumentComment'and org_act_id in (#{org_subfield_ids.join(",")})) || (container_type='OrgSubfield' and container_id=#{org_subfield.id})").order('updated_at desc') - org_acts end def allow_to_create?(org, type) diff --git a/app/views/organizations/_link_subfield_more.html.erb b/app/views/organizations/_link_subfield_more.html.erb index cb4a82ed1..59c12f1a1 100644 --- a/app/views/organizations/_link_subfield_more.html.erb +++ b/app/views/organizations/_link_subfield_more.html.erb @@ -1,9 +1,9 @@ <% if !field.subfield_subdomain_dir.nil? %> <% if !request.local? and Secdomain.where("sub_type=2 and pid=?", @organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", @organization.id).map(&:subname).include?(request.subdomain) %> - <%= link_to "更多", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "more" , :target => "_blank" %> + <%= link_to "更多", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "por_more_index fr" , :target => "_blank" %> <% else %> - <%= link_to "更多", show_org_subfield_organization_path(:id => @organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "more" , :target => "_blank" %> + <%= link_to "更多", show_org_subfield_organization_path(:id => @organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "por_more_index fr" , :target => "_blank" %> <% end %> <% else %> - <%= link_to "更多", organization_path(@organization, :org_subfield_id => field.id), :class => "more" , :target => "_blank" %> + <%= link_to "更多", organization_path(@organization, :org_subfield_id => field.id), :class => "por_more_index fr" , :target => "_blank" %> <% end %> \ No newline at end of file diff --git a/app/views/organizations/_org_custom_left3.html.erb b/app/views/organizations/_org_custom_left3.html.erb index db20d42a1..adc1840fb 100644 --- a/app/views/organizations/_org_custom_left3.html.erb +++ b/app/views/organizations/_org_custom_left3.html.erb @@ -1,37 +1,200 @@ -

    -

    精华帖子更多>

    -
    -
    - - 阿里前副总裁里前副总裁:里前副总裁:里前副总裁::阿里巴巴给我上的10 -

    1分钟前 窦豆

    -

    本文选自阿本文选自阿里本文选自阿里本文选自阿里本文选自阿里本文选自阿里里巴巴前副总裁、首任美籍高管波特·埃里斯曼《阿里传》在这本书里,波特概括了他在阿里巴巴任职的8年中,学到的40堂课这40堂课简单明了地概括了马云的经营理念,以及阿里终成帝国的必

    -
    - -
    -
    - -
    -
    +
    + <% if acts.blank? %> +

    <%= field.name %>

    +

    该模块暂时没有发布内容

    + <% else %> +

    <%= field.name %> + <%= render :partial => 'organizations/link_subfield_more', :locals => {:field => field} %> +

    + <% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %> + <% document = activity.org_act %> + <% org_subfield_id = params[:org_subfield_id] %> + <% flag = 2 %> + <% iamge_path = get_image_path_from_content(document.content) %> +
    +
    + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "299", :height => "246"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "299", :height => "246"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %> + <% end %> + <%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "por_post_title" %> +

    + <%= time_from_now(document.created_at) %> + <%= link_to document.creator, user_path(document.creator), :class => "por_hot_name", :target => "_blank" %> +

    +

    + <%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => document.id, :content=> document.content, :maxheight => 40, :maxwordsnum => 60} %> + 本文选自阿本文选自阿里本文选自阿里本文选自阿里本文选自阿里本文选自阿里里巴巴前副总裁、首任美籍高管波特·埃里斯曼《阿里传》在这本书里,波特概括了他在阿里巴巴任职的8年中,学到的40堂课这40堂课简单明了地概括了马云的经营理念,以及阿里终成帝国的必

    +
    + +
    + + + + +
    + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "185", :height => "125"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-resourcesimg" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-resourcesimg" %> + <% end %> +

    + <%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "resources-title sn-hidden" %> +

    +
    + <%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => document.id, :content=> document.content, :maxheight=>54, :maxwordsnum => 28} %> + <%#= link_to document.content.to_s.html_safe, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "resources-tag" %> +
    + <%#= link_to "更多", org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :class => "more-btn", :target => "_blank" %> + +
    + <% else activity.container_type == 'OrgSubfield' %> + <% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %> + <% message = Message.find(activity.org_act_id) %> + <% if message.parent_id.nil? %> + <% content = message.content%> + <% else %> + <% content = message.parent.content%> + <% end %> + <% iamge_path = get_image_path_from_content(content) %> + <% if message.board.org_subfield_id %> +
    +
    + + 阿里前副总裁里前副总裁:里前副总裁:里前副总裁::阿里巴巴给我上的10 +

    1分钟前 窦豆

    +

    本文选自阿本文选自阿里本文选自阿里本文选自阿里本文选自阿里本文选自阿里里巴巴前副总裁、首任美籍高管波特·埃里斯曼《阿里传》在这本书里,波特概括了他在阿里巴巴任职的8年中,学到的40堂课这40堂课简单明了地概括了马云的经营理念,以及阿里终成帝国的必

    +
    + +
    + + + + + +
    + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "185", :height => "125"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-resourcesimg" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-resourcesimg" %> + <% end %> +

    + <% if message.parent_id.nil? %> + <%= link_to message.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "resources-title sn-hidden" %> + <% else %> + <%= link_to message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "resources-title sn-hidden" %> + <% end %> +

    +
    + <%= render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => message.id, :content=> content, :maxheight=>54, :maxwordsnum => 28} %> + <%#= link_to content.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-tag" %> +
    + <%#= link_to "更多", board_message_url_in_org(message.board.id,message.id), :class => "more-btn", :target => "_blank" %> +
    + <% else %> +
    +
    + + 阿里前副总裁里前副总裁:里前副总裁:里前副总裁::阿里巴巴给我上的10 +

    1分钟前 窦豆

    +

    本文选自阿本文选自阿里本文选自阿里本文选自阿里本文选自阿里本文选自阿里里巴巴前副总裁、首任美籍高管波特·埃里斯曼《阿里传》在这本书里,波特概括了他在阿里巴巴任职的8年中,学到的40堂课这40堂课简单明了地概括了马云的经营理念,以及阿里终成帝国的必

    +
    + +
    + + + + + + +
    + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "185", :height => "125"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-resourcesimg" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-resourcesimg" %> + <% end %> +

    + <% if message.parent_id.nil? %> + <%= link_to message.subject.to_s.html_safe, board_message_path(message.board,message), :target => '_blank', :class => "resources-title sn-hidden" %> + <% else %> + <%= link_to message.parent.subject.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "resources-title sn-hidden" %> + <% end %> +

    +
    + <%= render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => message.id, :content=> content, :maxheight=>54, :maxwordsnum => 28} %> + <%#= link_to content.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "resources-tag" %> +
    + <%#= link_to "更多", board_message_path(message.board,activity), :class => "more-btn", :target => "_blank" %> +
    + <% end %> + <% end %> + <% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %> + <% news = News.find(activity.org_act_id) %> + <% iamge_path = get_image_path_from_content(news.description) %> +
    +
    + + 阿里前副总裁里前副总裁:里前副总裁:里前副总裁::阿里巴巴给我上的10 +

    1分钟前 窦豆

    +

    本文选自阿本文选自阿里本文选自阿里本文选自阿里本文选自阿里本文选自阿里里巴巴前副总裁、首任美籍高管波特·埃里斯曼《阿里传》在这本书里,波特概括了他在阿里巴巴任职的8年中,学到的40堂课这40堂课简单明了地概括了马云的经营理念,以及阿里终成帝国的必

    +
    + +
    + + + + + +
    + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "185", :height => "125"), news_path(news), :target => "_blank", :class =>"sn-resourcesimg" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), news_path(news), :target => "_blank", :class =>"sn-resourcesimg" %> + <% end %> +

    + <%= link_to news.title.to_s, news_path(news), :target => '_blank', :class => "resources-title sn-hidden" %> +

    +
    + <%#= link_to news.description.to_s.html_safe, news_path(news), :target => '_blank', :class => "resources-tag" %> + <%= render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => news.id, :content=> news.description, :maxheight=>54, :maxwordsnum => 28, :maxwordsnum => 28} %> +
    + <%#= link_to "更多", news_path(news), :class => "more-btn", :target => "_blank" %> +
    + <% end %> + <% end %> + + + + + + + + +
    + <% end %>
    \ No newline at end of file diff --git a/app/views/organizations/_show_custom.html.erb b/app/views/organizations/_show_custom.html.erb index 4d0d6470f..6f5c64379 100644 --- a/app/views/organizations/_show_custom.html.erb +++ b/app/views/organizations/_show_custom.html.erb @@ -2,15 +2,10 @@ <% @subfield_content.each do |field| %> <% if field.status.to_i == 1 %> <%= render :partial => 'organizations/org_custom_left1', :locals => {:field => field} %> - <% elsif field.status.to_i == 3 %> - <%#= render :partial => 'organizations/org_subfield_leftM', :locals => {:field => field} %> -
    - <%#= render :partial => 'organizations/org_subfield_leftM1', :locals => {:field => field} %> - <%= render :partial => 'organizations/org_custom_left3', :locals => {:field => field} %> -
    -
    <% elsif field.status.to_i == 2 %> <%= render :partial => 'organizations/org_custom_left2', :locals => {:field => field} %> + <% elsif field.status.to_i == 3 %> + <%= render :partial => 'organizations/org_custom_left3', :locals => {:field => field, :acts => get_subfield_acts(field) }%> <% end %> <% end %>
    @@ -22,11 +17,7 @@ <% elsif field.status.to_i == 5 %> <%= render :partial => 'organizations/org_custom_right2', :locals => {:field => field} %> <% elsif field.status.to_i == 6 %> - <% if field.field_type == "Resource" %> - <%= render :partial => 'organizations/org_custom_right3', :locals => {:field => field} %> - <% else %> <%# 只允许显示一个模块 %> - <%= render :partial => 'organizations/org_custom_right3', :locals => {:field => field} %> - <% end %> + <%= render :partial => 'organizations/org_custom_right3', :locals => {:field => field} %> <% end %> <% end %>
    From 7f811d7551b2be4660021e9fbcd40f7a4ea6edc0 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 19:20:15 +0800 Subject: [PATCH 047/126] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89=E7=BB=91=E5=AE=9A=E5=88=99?= =?UTF-8?q?=E8=B7=B3=E5=88=B0=E7=BB=91=E5=AE=9A=E9=A1=B5=E9=9D=A2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wechats_controller.rb | 45 +++++++-------------------- config/menu.yml | 2 +- config/routes.rb | 1 + 3 files changed, 13 insertions(+), 35 deletions(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 4bf95fdbd..d4758283a 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -154,12 +154,7 @@ class WechatsController < ActionController::Base end end - - - ### controller method - - module Controllers def get_open_id begin @@ -228,37 +223,19 @@ class WechatsController < ActionController::Base uw = UserWechat.where(openid: openid).first end - def user_activity(user) - @user = user - shield_project_ids = ShieldActivity.where("container_type='User' and container_id=#{@user.id} and shield_type='Project'").map(&:shield_id) - shield_course_ids = ShieldActivity.where("container_type='User' and container_id=#{@user.id} and shield_type='Course'").map(&:shield_id) - @page = params[:page] ? params[:page].to_i + 1 : 0 - user_project_ids = (@user.projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")" - user_course_ids = (@user.courses.visible.map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (@user.courses.visible.map{|course| course.id}-shield_course_ids).join(",") + ")" - course_types = "('Message','News','HomeworkCommon','Poll','Course')" - project_types = "('Message','Issue','Project')" - principal_types = "JournalsForMessage" - - blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")" - @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" + - "or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+ - "or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " + - "or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})").order('updated_at desc').limit(10).offset(@page * 10) - - - end - - def process_activity(user_activity) - act= user_activity.act - case user_activity.container_type.to_s - when 'Course' - when 'Project' - case user_activity.act_type.to_s - when 'Issue' - [act.project.name.to_s+" | 项目问题", act.subject.to_s, url_to_avatar(act.author),"http://wechat.trustie.net/app.html#/issue/#{act.id}"] - end + def user_activities + session[:wechat_code] = params[:code] if params[:code] + code = params[:code] || session[:wechat_code] + openid = get_openid_from_code(code) + @wechat_user = user_binded?(openid) + unless @wechat_user + redirect_to :login + return end + + render File.join(Rails.root, "public/wechat/app.html"), layout: nil end + end diff --git a/config/menu.yml b/config/menu.yml index de1952503..ab6ae89ac 100644 --- a/config/menu.yml +++ b/config/menu.yml @@ -2,7 +2,7 @@ button: - type: "view" name: "最新动态" - url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://test.course.trustie.net/assets/wechat/app.html#/activities?response_type=code&scope=snsapi_base&state=123#wechat_redirect" + url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://wechat.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect" - type: "click" name: "意见反馈" diff --git a/config/routes.rb b/config/routes.rb index 2863d49a4..9abaef0ae 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1237,6 +1237,7 @@ RedmineApp::Application.routes.draw do resource :wechat, only:[:show, :create] do collection do get :login + get :user_activities post :bind post :get_open_id end From 7b5a7a93f535555d72b83a475a7228f62a182cee Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 19:40:54 +0800 Subject: [PATCH 048/126] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89=E7=BB=91=E5=AE=9A=E5=88=99?= =?UTF-8?q?=E8=B7=B3=E5=88=B0=E7=BB=91=E5=AE=9A=E9=A1=B5=E9=9D=A2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wechats_controller.rb | 24 +++++++++++++----------- config/menu.yml | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index d4758283a..1e87c7b96 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -202,6 +202,19 @@ class WechatsController < ActionController::Base render 'wechats/login', layout: 'base_wechat' end + def user_activities + session[:wechat_code] = params[:code] if params[:code] + code = params[:code] || session[:wechat_code] + openid = get_openid_from_code(code) + @wechat_user = user_binded?(openid) + unless @wechat_user + redirect_to :login + return + end + + render File.join(Rails.root, "public/wechat/app.html"), layout: nil + end + private def get_openid_from_code(code) openid = session[:wechat_openid] @@ -223,18 +236,7 @@ class WechatsController < ActionController::Base uw = UserWechat.where(openid: openid).first end - def user_activities - session[:wechat_code] = params[:code] if params[:code] - code = params[:code] || session[:wechat_code] - openid = get_openid_from_code(code) - @wechat_user = user_binded?(openid) - unless @wechat_user - redirect_to :login - return - end - render File.join(Rails.root, "public/wechat/app.html"), layout: nil - end end diff --git a/config/menu.yml b/config/menu.yml index ab6ae89ac..3671ebb1b 100644 --- a/config/menu.yml +++ b/config/menu.yml @@ -2,7 +2,7 @@ button: - type: "view" name: "最新动态" - url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://wechat.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect" + url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=http://wechat.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect" - type: "click" name: "意见反馈" From e73c94680660701db79ea2059d290432b40bf957 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 19:43:27 +0800 Subject: [PATCH 049/126] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89=E7=BB=91=E5=AE=9A=E5=88=99?= =?UTF-8?q?=E8=B7=B3=E5=88=B0=E7=BB=91=E5=AE=9A=E9=A1=B5=E9=9D=A2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wechats_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 1e87c7b96..b0901efd4 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -208,7 +208,7 @@ class WechatsController < ActionController::Base openid = get_openid_from_code(code) @wechat_user = user_binded?(openid) unless @wechat_user - redirect_to :login + redirect_to login_wechat_path return end From 49a1a9de325b679579d9d01f3c12af6d27e37d63 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 19:46:30 +0800 Subject: [PATCH 050/126] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89=E7=BB=91=E5=AE=9A=E5=88=99?= =?UTF-8?q?=E8=B7=B3=E5=88=B0=E7=BB=91=E5=AE=9A=E9=A1=B5=E9=9D=A2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wechats_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index b0901efd4..1074ebc3f 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -212,7 +212,7 @@ class WechatsController < ActionController::Base return end - render File.join(Rails.root, "public/wechat/app.html"), layout: nil + render template: File.join(Rails.root, "public/wechat/app.html"), layout: nil end private From 1c5a31e8f1a1970619f3b2974f7d74543514363d Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 19:49:57 +0800 Subject: [PATCH 051/126] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89=E7=BB=91=E5=AE=9A=E5=88=99?= =?UTF-8?q?=E8=B7=B3=E5=88=B0=E7=BB=91=E5=AE=9A=E9=A1=B5=E9=9D=A2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wechats_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 1074ebc3f..d5dfb88f7 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -212,7 +212,7 @@ class WechatsController < ActionController::Base return end - render template: File.join(Rails.root, "public/wechat/app.html"), layout: nil + render file: File.join(Rails.root, "public/wechat/app.html") end private From ac5d91a428981e7bd2ad5381bf8336585726993e Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 19:51:38 +0800 Subject: [PATCH 052/126] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89=E7=BB=91=E5=AE=9A=E5=88=99?= =?UTF-8?q?=E8=B7=B3=E5=88=B0=E7=BB=91=E5=AE=9A=E9=A1=B5=E9=9D=A2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wechats_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index d5dfb88f7..9c6ab33f6 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -212,7 +212,7 @@ class WechatsController < ActionController::Base return end - render file: File.join(Rails.root, "public/wechat/app.html") + render template: File.join(Rails.root, "public/assets/wechat/app.html"), layout: nil end private From e01da32c75a64f58a5b921366a7ae53d76e55a6a Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 19:54:45 +0800 Subject: [PATCH 053/126] tempate=>file --- app/controllers/wechats_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 9c6ab33f6..e47c99cbd 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -212,7 +212,7 @@ class WechatsController < ActionController::Base return end - render template: File.join(Rails.root, "public/assets/wechat/app.html"), layout: nil + render file: File.join(Rails.root, "public/assets/wechat/app.html"), layout: nil end private From 4815dc3c7b3c6dc3e5ce2f804f8a4d5c7e163bae Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 19:59:34 +0800 Subject: [PATCH 054/126] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89=E7=BB=91=E5=AE=9A=E5=88=99?= =?UTF-8?q?=E8=B7=B3=E5=88=B0=E7=BB=91=E5=AE=9A=E9=A1=B5=E9=9D=A2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 8f00a2b96..f0881486e 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -482,7 +482,7 @@ app.directive('loadingSpinner', function ($http) { app.config(['$routeProvider',"$httpProvider",function ($routeProvider, $httpProvider) { $routeProvider .when('/activities', { - templateUrl: 'activities.html', + templateUrl: '/public/assets/wechat/activities.html', controller: 'ActivityController' }) .when('/issues/:id', { From 13d11e223934bac22a7b38975dc8a91f3d276a13 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 20:01:41 +0800 Subject: [PATCH 055/126] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89=E7=BB=91=E5=AE=9A=E5=88=99?= =?UTF-8?q?=E8=B7=B3=E5=88=B0=E7=BB=91=E5=AE=9A=E9=A1=B5=E9=9D=A2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/app.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index f0881486e..d18719cfe 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -480,37 +480,39 @@ app.directive('loadingSpinner', function ($http) { }); app.config(['$routeProvider',"$httpProvider",function ($routeProvider, $httpProvider) { + var rootPath = '/assets/wechat/' + $routeProvider .when('/activities', { - templateUrl: '/public/assets/wechat/activities.html', + templateUrl: rootPath + 'activities.html', controller: 'ActivityController' }) .when('/issues/:id', { - templateUrl: 'issue_detail.html', + templateUrl: rootPath + 'issue_detail.html', controller: 'IssueController' }) .when('/project_discussion/:id', { - templateUrl: 'project_discussion.html', + templateUrl: rootPath + 'project_discussion.html', controller: 'DiscussionController' }) .when('/homework/:id', { - templateUrl: 'homework_detail.html', + templateUrl: rootPath + 'homework_detail.html', controller: 'HomeworkController' }) .when('/course_notice/:id', { - templateUrl: 'course_notice.html', + templateUrl: rootPath + 'course_notice.html', controller: 'CourseNoticeController' }) .when('/course_discussion/:id', { - templateUrl: 'course_discussion.html', + templateUrl: rootPath + 'course_discussion.html', controller: 'DiscussionController' }) .when('/journal_for_message/:id', { - templateUrl: 'jour_message_detail.html', + templateUrl: rootPath + 'jour_message_detail.html', controller: 'JournalsController' }) .when('/blog_comment/:id', { - templateUrl: 'blog_detail.html', + templateUrl: rootPath + 'blog_detail.html', controller: 'BlogController' }) .otherwise({ From 814fde878e5743013963e9111eb232cf85ea9000 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 20:19:45 +0800 Subject: [PATCH 056/126] =?UTF-8?q?=E4=BB=8E=E5=90=8E=E5=8F=B0=E8=8E=B7?= =?UTF-8?q?=E5=8F=96openid=E5=8D=B3=E5=8F=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wechats_controller.rb | 2 +- app/views/wechats/user_activities.html.erb | 30 ++++++++++++++++++++++ config/menu.yml | 2 +- public/javascripts/wechat/app.js | 4 +++ 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 app/views/wechats/user_activities.html.erb diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index e47c99cbd..ea230abe5 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -212,7 +212,7 @@ class WechatsController < ActionController::Base return end - render file: File.join(Rails.root, "public/assets/wechat/app.html"), layout: nil + render 'wechats/user_activities', layout: nil end private diff --git a/app/views/wechats/user_activities.html.erb b/app/views/wechats/user_activities.html.erb new file mode 100644 index 000000000..b45587ae0 --- /dev/null +++ b/app/views/wechats/user_activities.html.erb @@ -0,0 +1,30 @@ + + + + 最新动态 + + + + + + + + + + + +
    +
    + + + + + + + + + + + \ No newline at end of file diff --git a/config/menu.yml b/config/menu.yml index 3671ebb1b..83b892037 100644 --- a/config/menu.yml +++ b/config/menu.yml @@ -2,7 +2,7 @@ button: - type: "view" name: "最新动态" - url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=http://wechat.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect" + url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf694495398c7d470&redirect_uri=http://wechat.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect" - type: "click" name: "意见反馈" diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index d18719cfe..59605271c 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -10,6 +10,10 @@ if(debug===true){ app.factory('auth', function($http,$routeParams, $cookies, $q){ var _openid = ''; + if(typeof g_openid !== 'undefined'){ + _openid = g_openid; + } + if(debug===true){ _openid = "1"; } From 9ecdf0892b370bc9837fa87f9395362d6d3d3622 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 31 May 2016 20:45:54 +0800 Subject: [PATCH 057/126] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=B7=A6=E4=B8=89?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E7=9A=84=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organizations/_org_custom_left3.html.erb | 332 ++++++++---------- .../_organization_content_extension.html.erb | 23 ++ 2 files changed, 172 insertions(+), 183 deletions(-) create mode 100644 app/views/organizations/_organization_content_extension.html.erb diff --git a/app/views/organizations/_org_custom_left3.html.erb b/app/views/organizations/_org_custom_left3.html.erb index adc1840fb..fdf06a023 100644 --- a/app/views/organizations/_org_custom_left3.html.erb +++ b/app/views/organizations/_org_custom_left3.html.erb @@ -6,195 +6,161 @@

    <%= field.name %> <%= render :partial => 'organizations/link_subfield_more', :locals => {:field => field} %>

    - <% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %> - <% document = activity.org_act %> - <% org_subfield_id = params[:org_subfield_id] %> - <% flag = 2 %> - <% iamge_path = get_image_path_from_content(document.content) %> -
    -
    - <% if iamge_path.nil? %> - <%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "299", :height => "246"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %> - <% else %> - <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "299", :height => "246"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %> +
    +
    + <% activity = acts.first %> + <% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %> + <% document = activity.org_act %> + <% if get_image_path_from_content(acts.first.org_act.content).nil? %> + <%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "299", :height => "246"), org_document_comment_path(:id => acts.first.org_act.id, :organization_id => acts.first.org_act.organization.id), :target => "_blank" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{get_image_path_from_content(acts.first.org_act.content)}", :width => "299", :height => "246"), org_document_comment_path(:id => acts.first.org_act.id, :organization_id => acts.first.org_act.organization.id), :target => "_blank" %> + <% end %> + <%= link_to acts.first.org_act.title, org_document_comment_path(:id => acts.first.org_act.id, :organization_id => acts.first.org_act.organization.id), :target => '_blank', :class => "por_post_title" %> +

    + <%= time_from_now(acts.first.org_act.created_at) %> + <%= link_to acts.first.org_act.creator, user_path(acts.first.org_act.creator), :class => "por_hot_name", :target => "_blank" %> +

    +
    + <%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => acts.first.org_act.id, :content=> acts.first.org_act.content, :maxheight => 40, :maxwordsnum => 60, :maxwidth => 0} %> +
    + <% else activity.container_type == 'OrgSubfield' %> + <% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %> + <% message = Message.find(activity.org_act_id) %> + <% content = message.parent_id.nil? ? message.content : message.parent.content %> + <% iamge_path = get_image_path_from_content(content) %> + <% if message.board.org_subfield_id %> + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "299", :height => "246"), board_message_url_in_org(message.board.id,message.id), :target => "_blank" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "299", :height => "246"), board_message_url_in_org(message.board.id,message.id), :target => "_blank" %> + <% end %> + <% if message.parent_id.nil? %> + <%= link_to message.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "por_post_title" %> + <% else %> + <%= link_to message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "por_post_title" %> + <% end %> +

    + <%= time_from_now(message.created_on) %> + <%= link_to message.author, user_path(message.author), :class => "por_hot_name", :target => "_blank" %> +

    +
    + <%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> message.content, :maxheight => 40, :maxwordsnum => 60, :maxwidth => 0} %> +
    + <% else %> + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "299", :height => "246"), board_message_path(message.board, message), :target => "_blank" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "299", :height => "246"), board_message_path(message.board, message), :target => "_blank" %> + <% end %> + <% if message.parent_id.nil? %> + <%= link_to message.subject.to_s.html_safe, board_message_path(message.board, message), :target => '_blank', :class => "por_post_title" %> + <% else %> + <%= link_to message.parent.subject.to_s.html_safe, board_message_path(message.board, message), :target => '_blank', :class => "por_post_title" %> + <% end %> +

    + <%= time_from_now(message.created_on) %> + <%= link_to message.author, user_path(message.author), :class => "por_hot_name", :target => "_blank" %> +

    +
    + <%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> message.content, :maxheight => 40, :maxwordsnum => 60, :maxwidth => 0} %> +
    + <% end %> + <% end %> + <% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %> + <% news = News.find(activity.org_act_id) %> + <% iamge_path = get_image_path_from_content(news.description) %> + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "299", :height => "246"), news_path(news), :target => "_blank" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "299", :height => "246"), news_path(news), :target => "_blank" %> + <% end %> + <%= link_to news.title.to_s, news_path(news), :target => '_blank', :class => "por_post_title" %> +

    + <%= time_from_now(news.created_on) %> + <%= link_to news.author, user_path(news.author), :class => "por_hot_name", :target => "_blank" %> +

    +
    + <%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => news.id, :content=> news.description, :maxheight => 40, :maxwordsnum => 60, :maxwidth => 0} %> +
    + <% end %> <% end %> - <%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "por_post_title" %> -

    - <%= time_from_now(document.created_at) %> - <%= link_to document.creator, user_path(document.creator), :class => "por_hot_name", :target => "_blank" %> -

    -

    - <%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => document.id, :content=> document.content, :maxheight => 40, :maxwordsnum => 60} %> - 本文选自阿本文选自阿里本文选自阿里本文选自阿里本文选自阿里本文选自阿里里巴巴前副总裁、首任美籍高管波特·埃里斯曼《阿里传》在这本书里,波特概括了他在阿里巴巴任职的8年中,学到的40堂课这40堂课简单明了地概括了马云的经营理念,以及阿里终成帝国的必

    -
    - -
    + + + <% unless acts[1..5].nil? %> + <% acts[1..5].each do |activity| %> + <% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %> + <% document = activity.org_act %> +
      +
    • <%= link_to "#{document.title}".html_safe, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), class: 'por_hidden_w390', :target => "_blank" %>
    • +
    + <% else activity.container_type == 'OrgSubfield' %> + <% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %> + <% message = Message.find(activity.org_act_id) %> + <% if message.board.org_subfield_id %> +
      + <% if message.parent_id.nil? %> +
    • <%= link_to "#{message.subject}".html_safe, board_message_url_in_org(message.board.id, message.id), class: 'por_hidden_w390', :target => "_blank" %>
    • + <% else %> +
    • <%= link_to "#{message.parent.subject}".html_safe, board_message_url_in_org(message.board.id, message.id), class: 'por_hidden_w390', :target => "_blank" %>
    • + <% end %> +
    + <% else %> +
      + <% if message.parent_id.nil? %> +
    • <%= link_to "#{message.subject}".html_safe, board_message_path(message.board,message), class: 'por_hidden_w390', :target => "_blank" %>
    • + <% else %> +
    • <%= link_to "#{message.parent.subject}".html_safe, board_message_path(message.board, message), class: 'por_hidden_w390', :target => "_blank" %>
    • + <% end %> +
    + <% end %> + <% end %> + <% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %> + <% news = News.find(activity.org_act_id) %> + <% iamge_path = get_image_path_from_content(news.description) %> +
      +
    • <%= link_to "#{news.title}".html_safe, news_path(news), class: 'por_hidden_w390', :target => "_blank" %>
    • +
    + <% end %> + <% end %> + <% end %> + <% end %> +
    +
    + <% unless acts[6..19].nil? %>
      -
    • 谷歌、Facebook等超过8ook等超过80%ook等超过80%ook等超过80%0%的企业都为开源做贡献贡献贡
    • + <% acts[6..19].each do |activity| %> + <% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %> + <% document = activity.org_act %> +
    • <%= link_to "#{document.title}".html_safe, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), class: 'por_hidden_w270', :target => "_blank" %>
    • + <% else activity.container_type == 'OrgSubfield' %> + <% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %> + <% message = Message.find(activity.org_act_id) %> + <% if message.board.org_subfield_id %> + <% if message.parent_id.nil? %> +
    • <%= link_to "#{message.subject}".html_safe, board_message_url_in_org(message.board.id, message.id), class: 'por_hidden_w270', :target => "_blank" %>
    • + <% else %> +
    • <%= link_to "#{message.parent.subject}".html_safe, board_message_url_in_org(message.board.id, message.id), class: 'por_hidden_w270', :target => "_blank" %>
    • + <% end %> + <% else %> + <% if message.parent_id.nil? %> +
    • <%= link_to "#{message.subject}".html_safe, board_message_path(message.board,message), class: 'por_hidden_w270', :target => "_blank" %>
    • + <% else %> +
    • <%= link_to "#{message.parent.subject}".html_safe, board_message_path(message.board, message), class: 'por_hidden_w270', :target => "_blank" %>
    • + <% end %> + <% end %> + <% end %> + <% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %> + <% news = News.find(activity.org_act_id) %> + <% iamge_path = get_image_path_from_content(news.description) %> +
    • <%= link_to "#{news.title}".html_safe, news_path(news), class: 'por_hidden_w270', :target => "_blank" %>
    • + <% end %> + <% end %> + <% end %>
    - - - -
    - <% if iamge_path.nil? %> - <%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "185", :height => "125"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-resourcesimg" %> - <% else %> - <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-resourcesimg" %> - <% end %> -

    - <%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "resources-title sn-hidden" %> -

    -
    - <%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => document.id, :content=> document.content, :maxheight=>54, :maxwordsnum => 28} %> - <%#= link_to document.content.to_s.html_safe, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "resources-tag" %> -
    - <%#= link_to "更多", org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :class => "more-btn", :target => "_blank" %> - -
    - <% else activity.container_type == 'OrgSubfield' %> - <% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %> - <% message = Message.find(activity.org_act_id) %> - <% if message.parent_id.nil? %> - <% content = message.content%> - <% else %> - <% content = message.parent.content%> - <% end %> - <% iamge_path = get_image_path_from_content(content) %> - <% if message.board.org_subfield_id %> -
    -
    - - 阿里前副总裁里前副总裁:里前副总裁:里前副总裁::阿里巴巴给我上的10 -

    1分钟前 窦豆

    -

    本文选自阿本文选自阿里本文选自阿里本文选自阿里本文选自阿里本文选自阿里里巴巴前副总裁、首任美籍高管波特·埃里斯曼《阿里传》在这本书里,波特概括了他在阿里巴巴任职的8年中,学到的40堂课这40堂课简单明了地概括了马云的经营理念,以及阿里终成帝国的必

    -
    - -
    - - - - - -
    - <% if iamge_path.nil? %> - <%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "185", :height => "125"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-resourcesimg" %> - <% else %> - <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-resourcesimg" %> - <% end %> -

    - <% if message.parent_id.nil? %> - <%= link_to message.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "resources-title sn-hidden" %> - <% else %> - <%= link_to message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "resources-title sn-hidden" %> - <% end %> -

    -
    - <%= render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => message.id, :content=> content, :maxheight=>54, :maxwordsnum => 28} %> - <%#= link_to content.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-tag" %> -
    - <%#= link_to "更多", board_message_url_in_org(message.board.id,message.id), :class => "more-btn", :target => "_blank" %> -
    - <% else %> -
    -
    - - 阿里前副总裁里前副总裁:里前副总裁:里前副总裁::阿里巴巴给我上的10 -

    1分钟前 窦豆

    -

    本文选自阿本文选自阿里本文选自阿里本文选自阿里本文选自阿里本文选自阿里里巴巴前副总裁、首任美籍高管波特·埃里斯曼《阿里传》在这本书里,波特概括了他在阿里巴巴任职的8年中,学到的40堂课这40堂课简单明了地概括了马云的经营理念,以及阿里终成帝国的必

    -
    - -
    - - - - - - -
    - <% if iamge_path.nil? %> - <%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "185", :height => "125"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-resourcesimg" %> - <% else %> - <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-resourcesimg" %> - <% end %> -

    - <% if message.parent_id.nil? %> - <%= link_to message.subject.to_s.html_safe, board_message_path(message.board,message), :target => '_blank', :class => "resources-title sn-hidden" %> - <% else %> - <%= link_to message.parent.subject.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "resources-title sn-hidden" %> - <% end %> -

    -
    - <%= render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => message.id, :content=> content, :maxheight=>54, :maxwordsnum => 28} %> - <%#= link_to content.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "resources-tag" %> -
    - <%#= link_to "更多", board_message_path(message.board,activity), :class => "more-btn", :target => "_blank" %> -
    - <% end %> - <% end %> - <% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %> - <% news = News.find(activity.org_act_id) %> - <% iamge_path = get_image_path_from_content(news.description) %> -
    -
    - - 阿里前副总裁里前副总裁:里前副总裁:里前副总裁::阿里巴巴给我上的10 -

    1分钟前 窦豆

    -

    本文选自阿本文选自阿里本文选自阿里本文选自阿里本文选自阿里本文选自阿里里巴巴前副总裁、首任美籍高管波特·埃里斯曼《阿里传》在这本书里,波特概括了他在阿里巴巴任职的8年中,学到的40堂课这40堂课简单明了地概括了马云的经营理念,以及阿里终成帝国的必

    -
    - -
    - - - - - -
    - <% if iamge_path.nil? %> - <%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "185", :height => "125"), news_path(news), :target => "_blank", :class =>"sn-resourcesimg" %> - <% else %> - <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), news_path(news), :target => "_blank", :class =>"sn-resourcesimg" %> - <% end %> -

    - <%= link_to news.title.to_s, news_path(news), :target => '_blank', :class => "resources-title sn-hidden" %> -

    -
    - <%#= link_to news.description.to_s.html_safe, news_path(news), :target => '_blank', :class => "resources-tag" %> - <%= render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => news.id, :content=> news.description, :maxheight=>54, :maxwordsnum => 28, :maxwordsnum => 28} %> -
    - <%#= link_to "更多", news_path(news), :class => "more-btn", :target => "_blank" %> -
    - <% end %> <% end %> - - - - - - - -
    <% end %>
    \ No newline at end of file diff --git a/app/views/organizations/_organization_content_extension.html.erb b/app/views/organizations/_organization_content_extension.html.erb new file mode 100644 index 000000000..c63011586 --- /dev/null +++ b/app/views/organizations/_organization_content_extension.html.erb @@ -0,0 +1,23 @@ +

    +

    + <%= content.to_s.html_safe%> +
    +

    + + \ No newline at end of file From 48b36e5d169e1ca519df54bccc7482c47a8a7351 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 20:46:46 +0800 Subject: [PATCH 058/126] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/activities.html | 2 +- public/javascripts/wechat/app.js | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/public/assets/wechat/activities.html b/public/assets/wechat/activities.html index 30b4dafaa..ab0e85faf 100644 --- a/public/assets/wechat/activities.html +++ b/public/assets/wechat/activities.html @@ -118,7 +118,7 @@
    -
    +
    diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 59605271c..4c17027e0 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -7,6 +7,7 @@ if(debug===true){ apiUrl = 'https://www.trustie.net/api/v1/'; } + app.factory('auth', function($http,$routeParams, $cookies, $q){ var _openid = ''; @@ -66,7 +67,7 @@ app.factory('rms', function(){ return {save: save, get: get}; }); -app.controller('ActivityController',function($scope, $http, auth, rms, common){ +app.controller('ActivityController',function($anchorScroll, $location,$scope, $http, auth, rms, common){ $scope.replaceUrl = function(url){ return url; }; @@ -76,6 +77,12 @@ app.controller('ActivityController',function($scope, $http, auth, rms, common){ $scope.page = 0; var loadActData = function(page){ + if (page <= 0 && $scope.activities.length >0){ + var yOffset = rms.get("yoffset"); + $location.hash(yOffset); + return; + } + $scope.page = page; $http({ method: 'POST', @@ -109,6 +116,12 @@ app.controller('ActivityController',function($scope, $http, auth, rms, common){ $scope.loadActData = loadActData; + //跳到详情页 + $scope.goDetail = function(type, id){ + rms.save("yoffset", id); + $location.path('/'+type+'/'+id); + } + $scope.addPraise = function(act){ common.addCommonPraise(act); }; @@ -117,6 +130,8 @@ app.controller('ActivityController',function($scope, $http, auth, rms, common){ common.decreaseCommonPraise(act); }; + + }); app.factory('common', function($http, auth, $routeParams){ From 32ffd2a5b5372aab6c8d8802b63e0f1763de5ae7 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 20:55:46 +0800 Subject: [PATCH 059/126] =?UTF-8?q?=E8=BF=94=E5=9B=9E=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/entities/activity.rb | 1 + public/assets/wechat/activities.html | 2 +- public/javascripts/wechat/app.js | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/api/mobile/entities/activity.rb b/app/api/mobile/entities/activity.rb index a90ff323d..9e2a39a5a 100644 --- a/app/api/mobile/entities/activity.rb +++ b/app/api/mobile/entities/activity.rb @@ -98,6 +98,7 @@ module Mobile end expose :act_type #缺陷/作业/讨论区/留言等类型 expose :act_id + expose :id expose :container_type #课程/项目/博客/个人 expose :author, using: Mobile::Entities::User do |a, opt| #用户信息 if a.is_a? ::UserActivity diff --git a/public/assets/wechat/activities.html b/public/assets/wechat/activities.html index ab0e85faf..85cfad7e4 100644 --- a/public/assets/wechat/activities.html +++ b/public/assets/wechat/activities.html @@ -118,7 +118,7 @@
    -
    +
    diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 4c17027e0..51c91d152 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -117,9 +117,9 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h $scope.loadActData = loadActData; //跳到详情页 - $scope.goDetail = function(type, id){ - rms.save("yoffset", id); - $location.path('/'+type+'/'+id); + $scope.goDetail = function(type, act_id,id){ + rms.save("yoffset", 'act_'+id); + $location.path('/'+type+'/'+act_id); } $scope.addPraise = function(act){ From c9eddad45d8b3036e9dec1be6ec0ffa222132f9c Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 21:09:47 +0800 Subject: [PATCH 060/126] =?UTF-8?q?=E6=9B=B4=E5=A4=9A=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/activities.html | 4 ++-- public/javascripts/wechat/app.js | 36 ++++++++++++++++++++++++---- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/public/assets/wechat/activities.html b/public/assets/wechat/activities.html index 85cfad7e4..c610a9839 100644 --- a/public/assets/wechat/activities.html +++ b/public/assets/wechat/activities.html @@ -249,8 +249,8 @@
    -
    -
    更多
    +
    +
    更多
    diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 51c91d152..a129a795c 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -73,11 +73,35 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h }; console.log("ActivityController load"); - $scope.activities = rms.get("activities") || []; + $scope.page = 0; + $scope.activities = rms.get("activities") || []; + + var savePageConfig = function(){ + rms.save('current_page', $scope.current_page); + rms.save('has_more', $scope.has_more); + rms.save('activities', $scope.activities); + } + + var loadPageConfig = function(){ + var current_page = rms.get('current_page'); + var has_more = rms.get('has_more'); + var activities = rms.get('activities'); + + if(typeof current_page !== 'undefined'){ + $scope.page = current_page; + } + if(typeof has_more !== 'undefined'){ + $scope.has_more = has_more; + } + if(typeof activities !== 'undefined'){ + $scope.activities = activities; + } + } var loadActData = function(page){ - if (page <= 0 && $scope.activities.length >0){ + if (page <= 0 && $scope.activities.length >0){ //应该是返回过来的 + loadPageConfig(); var yOffset = rms.get("yoffset"); $location.hash(yOffset); return; @@ -97,10 +121,12 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h } else { $scope.activities = response.data.data; } - $scope.current_page = response.data.page; - $scope.all_count = response.data.all_count; - $scope.count = response.data.count; + $scope.has_more = (response.data.count + response.data.page * 10) < response.data.all_count; + console.log(response.data); + + rms.save('current_page', $scope.page); + rms.save('has_more', $scope.has_more); rms.save('activities', $scope.activities); }, function errorCallback(response) { }); From c26d544772370e6b18b8e29830b99909d73764a3 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 21:15:31 +0800 Subject: [PATCH 061/126] =?UTF-8?q?=E6=9B=B4=E5=A4=9A=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index a129a795c..82c41a53c 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -103,7 +103,7 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h if (page <= 0 && $scope.activities.length >0){ //应该是返回过来的 loadPageConfig(); var yOffset = rms.get("yoffset"); - $location.hash(yOffset); + $location.yOffset = yOffset; return; } @@ -144,7 +144,9 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h //跳到详情页 $scope.goDetail = function(type, act_id,id){ - rms.save("yoffset", 'act_'+id); + console.log($anchorScroll.yOffset); + rms.save("yoffset", $anchorScroll.yOffset); + $location.path('/'+type+'/'+act_id); } From 553a02c89dbbba10ce7cb69cb5c9a269eb5961cc Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 21:22:44 +0800 Subject: [PATCH 062/126] =?UTF-8?q?=E6=9B=B4=E5=A4=9A=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 82c41a53c..5232b91c4 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -103,7 +103,7 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h if (page <= 0 && $scope.activities.length >0){ //应该是返回过来的 loadPageConfig(); var yOffset = rms.get("yoffset"); - $location.yOffset = yOffset; + $location.hash(yOffset); return; } @@ -144,8 +144,8 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h //跳到详情页 $scope.goDetail = function(type, act_id,id){ - console.log($anchorScroll.yOffset); - rms.save("yoffset", $anchorScroll.yOffset); + console.log($anchorScroll()); + rms.save("yoffset", $anchorScroll()); $location.path('/'+type+'/'+act_id); } From 03357388bdda524c1951eb661af3c0586191e74c Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 21:26:31 +0800 Subject: [PATCH 063/126] =?UTF-8?q?=E6=9B=B4=E5=A4=9A=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/app.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 5232b91c4..e0e436fda 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -103,7 +103,7 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h if (page <= 0 && $scope.activities.length >0){ //应该是返回过来的 loadPageConfig(); var yOffset = rms.get("yoffset"); - $location.hash(yOffset); + $location.yOffset = yOffset; return; } @@ -144,9 +144,7 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h //跳到详情页 $scope.goDetail = function(type, act_id,id){ - console.log($anchorScroll()); - rms.save("yoffset", $anchorScroll()); - + rms.save("yoffset",'act_'+id); $location.path('/'+type+'/'+act_id); } From ceffa6c2c82c74e60982838041ffb5863abdb8ca Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 21:27:00 +0800 Subject: [PATCH 064/126] =?UTF-8?q?=E6=9B=B4=E5=A4=9A=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index e0e436fda..8cc3d053a 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -103,7 +103,7 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h if (page <= 0 && $scope.activities.length >0){ //应该是返回过来的 loadPageConfig(); var yOffset = rms.get("yoffset"); - $location.yOffset = yOffset; + $location.hash(yOffset); return; } From 51d3fc3aad760b2113b78f7d1b0aa9aad1311bd8 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 21:31:36 +0800 Subject: [PATCH 065/126] =?UTF-8?q?=E6=9B=B4=E5=A4=9A=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/app.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 8cc3d053a..641e95bed 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -94,9 +94,7 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h if(typeof has_more !== 'undefined'){ $scope.has_more = has_more; } - if(typeof activities !== 'undefined'){ - $scope.activities = activities; - } + } var loadActData = function(page){ From 0cc8cb9928a1ade5d069a2ca7897901160e2769c Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 1 Jun 2016 08:57:27 +0800 Subject: [PATCH 066/126] =?UTF-8?q?=E5=88=9A=E6=8F=90=E4=BA=A4=E7=9A=84?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E6=97=B6=E9=97=B4=E6=98=BE=E7=A4=BA=E4=B8=BA?= =?UTF-8?q?=E2=80=9C=E5=88=9A=E5=88=9A=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/api_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/api_helper.rb b/app/helpers/api_helper.rb index 3f7adcfa6..fb1231287 100644 --- a/app/helpers/api_helper.rb +++ b/app/helpers/api_helper.rb @@ -182,7 +182,7 @@ module ApiHelper timeIntoFormat = 0 updateAtValue = "" if timePassed < 0 - updateAtValue = "1分钟前" + updateAtValue = "刚刚" elsif timePassed < ONE_MINUTE updateAtValue = "1分钟前" elsif timePassed < ONE_HOUR From 5c27aee2bd0ac8f2d53ed58c7db2546b4445fb9f Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 1 Jun 2016 09:08:08 +0800 Subject: [PATCH 067/126] =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=BA=8C=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E6=A8=A1=E5=9D=97=20=20=20=E5=AE=9A=E4=B9=89=E5=85=AC?= =?UTF-8?q?=E5=85=B1=E6=96=B9=E6=B3=95=EF=BC=88=E6=98=BE=E7=A4=BA=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0=E5=86=85=E5=AE=B9=E4=BB=A5=E7=9C=81=E7=95=A5=E5=8F=B7?= =?UTF-8?q?=E7=BB=93=E6=9D=9F=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organizations/_org_custom_left2.html.erb | 300 ++++++++++++++++-- .../organizations/_org_custom_left3.html.erb | 19 +- .../_organization_content_extension.html.erb | 6 +- 3 files changed, 289 insertions(+), 36 deletions(-) diff --git a/app/views/organizations/_org_custom_left2.html.erb b/app/views/organizations/_org_custom_left2.html.erb index 649a1dd55..6dd7e0e66 100644 --- a/app/views/organizations/_org_custom_left2.html.erb +++ b/app/views/organizations/_org_custom_left2.html.erb @@ -1,4 +1,282 @@ -
    +
    +<% if is_default_field?(field) %> + <% case field.name %> + <% when 'course' %> +

    课程动态

    + <% if @course_acts.blank? %> +

    该模块暂时没有相关内容

    + <% else %> + <% @course_acts.first(4).each do |act| %> + <% if act.org_act_type == "HomeworkCommon" %> + <% activity = act.org_act %> + <% iamge_path = get_image_path_from_content(activity.description) %> +
    + <%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "por_course_title", :title => activity.name.to_s %> + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "140", :height => "100"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"fl" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "140", :height => "100"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"fl" %> + <% end %> + + <%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => activity.id, :content=> activity.description, :maxheight => 80, :maxwordsnum => 56, :maxwidth => 0, :cl => "por_course_txt fl"} %> + + <%= time_from_now(activity.updated_at) %> +
    + <% elsif act.org_act_type == "Message" %> + <% activity = act.org_act %> + <% iamge_path = get_image_path_from_content(activity.content) %> +
    + <%= link_to activity.parent_id.nil? ? activity.subject : activity.parent.subject, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "por_course_title" %> + +

    学习程序设计,要学习语言的语法更重要的是求解问题的算法思想。语法的学习需要多尝试,算法的算机程序设计(Z2班)算机程序设计(Z2班)算机程序设计(Z2班)学习需要多思考。学习程序设计

    + 2016春季学期 +
    + + + +
    + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "380", :height => "165"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %> + <% end %> +

    + <%= link_to activity.parent_id.nil? ? activity.subject.to_s.html_safe : activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h3-title" %> +

    + <%= format_date activity.updated_on %> +
    +
    <%= activity.content.to_s.html_safe %>
    +
    +
    <%=link_to "查看全文>>", board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
    +
    + <% elsif act.org_act_type == "News" %> + <% activity = News.find(act.org_act_id) %> + <% iamge_path = get_image_path_from_content(activity.description) %> +
    + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "380", :height => "165"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %> + <% end %> +

    + <%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "h3-title" %> +

    + <%= format_date activity.created_on %> +
    +
    <%= activity.description.to_s.html_safe %>
    +
    + +
    <%=link_to "查看全文>>", news_url_in_org(activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
    +
    + <% elsif act.org_act_type == "Poll" %> + <% activity = Poll.find(act.org_act_id) %> + <% has_commit = has_commit_poll?(activity.id ,User.current)%> + <% poll_name = activity.polls_name.empty? ? l(:label_poll_new) : activity.polls_name%> + <% iamge_path = get_image_path_from_content(activity.polls_description) %> + <% if ( activity.polls_status==2) %> +
    + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "380", :height => "165"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %> + <% end %> +

    + <% if has_commit %> + <%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "h3-title" %> + <% else %> + <%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "h3-title" %> + <% end %> +

    + <%= format_date activity.published_at %> +
    +
    <%= activity.polls_description.to_s.html_safe %>
    +
    +
    <%=link_to "查看全文>>", Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
    +
    + <% end %> + <% end %> + <% end %> + <% end %> + <% when 'project' %> + <% if @project_acts.blank? %> +

    项目动态

    +

    该模块暂时没有相关内容

    + <% else %> +

    项目动态

    +
    + <% @project_acts.first(1).each do |act| %> + <% if act.org_act_type == "Issue" %> + <% activity = Issue.find(act.org_act_id) %> + <% iamge_path = get_image_path_from_content(activity.description) %> +
    + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "380", :height => "165"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %> + <% end %> +

    + <%= link_to activity.subject.to_s, issue_url_in_org(activity.id), :target => '_blank', :class => "h3-title" %> +

    + <%= format_date activity.updated_on %> +
    +
    <%= activity.description.to_s.html_safe %>
    +
    +
    <%=link_to "查看全文>>", issue_url_in_org(activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
    +
    + <% elsif act.org_act_type == "Message" %> + <% activity = Message.find(act.org_act_id) %> + <% iamge_path = get_image_path_from_content(activity.content) %> +
    + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "380", :height => "165"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %> + <% end %> +

    + <%= link_to activity.parent_id.nil? ? activity.subject.to_s.html_safe : activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h3-title" %> +

    + <%= format_date activity.updated_on %> +
    +
    <%= activity.content.to_s.html_safe %>
    +
    +
    <%=link_to "查看全文>>", board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
    +
    + <% elsif act.org_act_type == "News" %> + <% activity = News.find(act.org_act_id) %> + <% iamge_path = get_image_path_from_content(activity.description) %> +
    + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "380", :height => "165"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %> + <% end %> +

    + <%= link_to activity.description.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "h3-title" %> +

    + 2016-04-08 +
    +
    <%= activity.description.to_s.html_safe %>
    +
    +
    <%=link_to "查看全文>>", news_url_in_org(activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
    +
    + <% end %> + <% end %> + <% end %> + <% end %> +<% else %> + <% if field.field_type == "Post" %> + <% org_acts = get_subfield_acts field %> + <% if org_acts.blank? %> +

    <%= field.name %>

    +
    + <%= render :partial => 'organizations/org_subfield_leftM1_default', :locals => {:field => field} %> + <% else %> +

    <%= field.name %> + <%= render :partial => 'organizations/link_subfield_more', :locals => {:field => field} %> +

    +
    + <% org_acts.first(1).each do |activity| %> + <% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %> + <% document = activity.org_act %> + <% org_subfield_id = params[:org_subfield_id] %> + <% flag = 2 %> + <% iamge_path = get_image_path_from_content(document.content) %> +
    + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "380", :height => "165"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %> + <% end %> +

    + <%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "h3-title" %> +

    + <%= format_date document.created_at %> +
    +
    <%= document.content.to_s.html_safe %>
    +
    +
    <%=link_to "查看全文>>", org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
    +
    + <% else activity.container_type == 'OrgSubfield' %> + <% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %> + <% message = Message.find(activity.org_act_id) %> + <% if message.parent_id.nil? %> + <% content = message.content%> + <% else %> + <% content = message.parent.content%> + <% end %> + <% iamge_path = get_image_path_from_content(content) %> + <% if message.board.org_subfield_id %> +
    + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "380", :height => "165"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %> + <% end %> +

    + <%= link_to message.parent_id.nil? ? message.subject.to_s.html_safe : message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "h3-title" %> +

    + <%= format_date message.created_on %> +
    +
    <%= content.to_s.html_safe %>
    +
    +
    <%=link_to "查看全文>>", board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
    +
    + <% else %> +
    + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "380", :height => "165"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %> + <% end %> +

    + <% if message.parent_id.nil? %> + <%= link_to message.subject.to_s.html_safe, board_message_path(message.board,message), :target => '_blank', :class => "h3-title" %> + <% else %> + <%= link_to message.parent.subject.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "h3-title" %> + <% end %> +

    + <%= format_date message.created_on %> +
    +
    <%= content.to_s.html_safe %>
    +
    +
    + <% if message.parent_id.nil? %> + <%=link_to "查看全文>>", board_message_path(message.board,message), :target => "_blank", :class => "sn-link-grey2 sn-fr" %> + <% else %> + <%=link_to "查看全文>>", board_message_path(message.board,activity), :target => "_blank", :class => "sn-link-grey2 sn-fr" %> + <% end %> +
    +
    + <% end %> + <% end %> + <% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %> + <% news = News.find(activity.org_act_id) %> + <% iamge_path = get_image_path_from_content(news.description) %> +
    + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "380", :height => "165"), news_path(news), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), news_path(news), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %> + <% end %> +

    + <%= link_to news.title.to_s, news_path(news), :target => '_blank', :class => "h3-title" %> +

    + <%= format_date news.created_on %> +
    +
    <%= news.description.to_s.html_safe %>
    +
    +
    <%=link_to "查看全文>>", news_path(news), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
    +
    + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> +<% end %> + + + +

    精品课程更多>

    2016春计算机程序设计(Z2算机程序设计(Z2班)算机程序设计(Z2班)班) @@ -6,23 +284,7 @@

    学习程序设计,要学习语言的语法更重要的是求解问题的算法思想。语法的学习需要多尝试,算法的算机程序设计(Z2班)算机程序设计(Z2班)算机程序设计(Z2班)学习需要多思考。学习程序设计

    2016春季学期
    -
    - 2016春计算机程序设计(Z2班) - -

    学习程序设计,要学习语言的语法更重要的是求解问题的算法思想。语法的学习需要多尝试,算法的学习需要多思考。学习程序设计

    - 2016春季学期 -
    -
    - 2016春计算机程序设计(Z2班) - -

    学习程序设计,要学习语言的语法更重要的是求解问题的算法思想。语法的学习需要多尝试,算法的学习需要多思考。学习程序设计

    - 2016春季学期 -
    -
    - 2016春计算机程序设计(Z2班) - -

    学习程序设计,要学习语言的语法更重要的是求解问题的算法思想。语法的学习需要多尝试,算法的学习需要多思考。学习程序设计

    - 2016春季学期 -
    + +
    \ No newline at end of file diff --git a/app/views/organizations/_org_custom_left3.html.erb b/app/views/organizations/_org_custom_left3.html.erb index fdf06a023..63cb584cc 100644 --- a/app/views/organizations/_org_custom_left3.html.erb +++ b/app/views/organizations/_org_custom_left3.html.erb @@ -1,7 +1,7 @@
    <% if acts.blank? %>

    <%= field.name %>

    -

    该模块暂时没有发布内容

    +

    该模块暂时没有相关内容

    <% else %>

    <%= field.name %> <%= render :partial => 'organizations/link_subfield_more', :locals => {:field => field} %> @@ -21,9 +21,7 @@ <%= time_from_now(acts.first.org_act.created_at) %> <%= link_to acts.first.org_act.creator, user_path(acts.first.org_act.creator), :class => "por_hot_name", :target => "_blank" %>

    -
    - <%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => acts.first.org_act.id, :content=> acts.first.org_act.content, :maxheight => 40, :maxwordsnum => 60, :maxwidth => 0} %> -
    + <%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => acts.first.org_act.id, :content=> acts.first.org_act.content, :maxheight => 40, :maxwordsnum => 60, :maxwidth => 0, :cl => "por_post_txt"} %> <% else activity.container_type == 'OrgSubfield' %> <% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %> <% message = Message.find(activity.org_act_id) %> @@ -44,9 +42,7 @@ <%= time_from_now(message.created_on) %> <%= link_to message.author, user_path(message.author), :class => "por_hot_name", :target => "_blank" %>

    -
    - <%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> message.content, :maxheight => 40, :maxwordsnum => 60, :maxwidth => 0} %> -
    + <%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> message.content, :maxheight => 40, :maxwordsnum => 60, :maxwidth => 0, :cl => "por_post_txt"} %> <% else %> <% if iamge_path.nil? %> <%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "299", :height => "246"), board_message_path(message.board, message), :target => "_blank" %> @@ -62,9 +58,7 @@ <%= time_from_now(message.created_on) %> <%= link_to message.author, user_path(message.author), :class => "por_hot_name", :target => "_blank" %>

    -
    - <%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> message.content, :maxheight => 40, :maxwordsnum => 60, :maxwidth => 0} %> -
    + <%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> message.content, :maxheight => 40, :maxwordsnum => 60, :maxwidth => 0, :cl => "por_post_txt"} %> <% end %> <% end %> <% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %> @@ -80,12 +74,9 @@ <%= time_from_now(news.created_on) %> <%= link_to news.author, user_path(news.author), :class => "por_hot_name", :target => "_blank" %>

    -
    - <%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => news.id, :content=> news.description, :maxheight => 40, :maxwordsnum => 60, :maxwidth => 0} %> -
    + <%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => news.id, :content=> news.description, :maxheight => 40, :maxwordsnum => 60, :maxwidth => 0, :cl => "por_post_txt"} %> <% end %> <% end %> - <% unless acts[1..5].nil? %> <% acts[1..5].each do |activity| %> diff --git a/app/views/organizations/_organization_content_extension.html.erb b/app/views/organizations/_organization_content_extension.html.erb index c63011586..a486edd65 100644 --- a/app/views/organizations/_organization_content_extension.html.erb +++ b/app/views/organizations/_organization_content_extension.html.erb @@ -1,7 +1,7 @@ -

    -

    +

    + <%= content.to_s.html_safe%> -

    +

    \ No newline at end of file diff --git a/app/views/organizations/_org_custom_admin.html.erb b/app/views/organizations/_org_custom_admin.html.erb index 559b52b63..2f454819c 100644 --- a/app/views/organizations/_org_custom_admin.html.erb +++ b/app/views/organizations/_org_custom_admin.html.erb @@ -9,4 +9,22 @@ +<% end %> +<% if allow_to_create?(@organization, "Comppro") %> +
  • + + +
  • +<% end %> +<% if allow_to_create?(@organization, "Compcou") %> +
  • + + +
  • +<% end %> +<% if allow_to_create?(@organization, "Compact") %> +
  • + + +
  • <% end %> \ No newline at end of file diff --git a/app/views/organizations/_org_left_subfield_list.html.erb b/app/views/organizations/_org_left_subfield_list.html.erb index e621df8bd..30234c300 100644 --- a/app/views/organizations/_org_left_subfield_list.html.erb +++ b/app/views/organizations/_org_left_subfield_list.html.erb @@ -125,6 +125,22 @@
    <%= link_to "#{field.name}", students_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
    + <% elsif field.field_type == "Compstu" && User.current.admin? %> +
    + <%= link_to "#{field.name}", students_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %> +
    + <% elsif field.field_type == "Comppro" && User.current.admin? %> +
    + <%= link_to "#{field.name}", projects_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %> +
    + <% elsif field.field_type == "Compcou" && User.current.admin? %> +
    + <%= link_to "#{field.name}", courses_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %> +
    + <% elsif field.field_type == "Compact" && User.current.admin? %> +
    + <%= link_to "#{field.name}", acts_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %> +
    <% elsif field.field_type == "Resource" %>
    <% if !field.subfield_subdomain_dir.nil? %> diff --git a/app/views/organizations/courses.html.erb b/app/views/organizations/courses.html.erb new file mode 100644 index 000000000..875fc3340 --- /dev/null +++ b/app/views/organizations/courses.html.erb @@ -0,0 +1,30 @@ +
    +
    + <% if @type == "famous" %> + 精品课程 + <% else %> + <%= @field.name %> + <% end %> +
    +
    +
    + +
    + <%=render 'organizations/org_container', :containers => @containers %> +
    +
    +
      + <%= pagination_links_full @atta_pages, @containers_count, :per_page_links => false, :flag => true %> +
    +
    +
    \ No newline at end of file diff --git a/app/views/organizations/courses.js.erb b/app/views/organizations/courses.js.erb new file mode 100644 index 000000000..dc42c115c --- /dev/null +++ b/app/views/organizations/courses.js.erb @@ -0,0 +1,3 @@ +$("#org_container_list").html('<%= escape_javascript( render :partial => 'organizations/org_container', :locals => {:containers => @containers})%>'); +$("#pages").html('<%= pagination_links_full @atta_pages, @container_count, :per_page_links => false, :remote => @is_remote, :flag => true %>'); +$("#org_student_search").attr('href','<%= courses_organization_path(@organization, :type => @type) %>'); \ No newline at end of file diff --git a/app/views/organizations/projects.html.erb b/app/views/organizations/projects.html.erb new file mode 100644 index 000000000..1c6cfa1d1 --- /dev/null +++ b/app/views/organizations/projects.html.erb @@ -0,0 +1,30 @@ +
    +
    + <% if @type == "famous" %> + 热门项目 + <% else %> + <%= @field.name %> + <% end %> +
    +
    +
    + +
    + <%=render 'organizations/org_container', :containers => @containers %> +
    +
    +
      + <%= pagination_links_full @atta_pages, @containers_count, :per_page_links => false, :flag => true %> +
    +
    +
    \ No newline at end of file diff --git a/app/views/organizations/projects.js.erb b/app/views/organizations/projects.js.erb new file mode 100644 index 000000000..e8d4f244a --- /dev/null +++ b/app/views/organizations/projects.js.erb @@ -0,0 +1,3 @@ +$("#org_container_list").html('<%= escape_javascript( render :partial => 'organizations/org_container', :locals => {:containers => @containers})%>'); +$("#pages").html('<%= pagination_links_full @atta_pages, @container_count, :per_page_links => false, :remote => @is_remote, :flag => true %>'); +$("#org_student_search").attr('href','<%= projects_organization_path(@organization, :type => @type) %>'); \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 71b8f298e..0349fc122 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -78,6 +78,9 @@ RedmineApp::Application.routes.draw do get 'search_courses' get 'teachers' get 'students' + get 'projects' + get 'courses' + get 'acts' post 'join_course_menu' post 'join_courses' get 'search_projects' @@ -99,6 +102,8 @@ RedmineApp::Application.routes.draw do post 'reset_excellent_teacher' post 'reset_excellent_student' post 'agree_apply_subdomain' + post 'update_field_by_admin' + post 'reset_update_field_by_admin' end end diff --git a/db/migrate/20160601073753_add_hot_to_project.rb b/db/migrate/20160601073753_add_hot_to_project.rb new file mode 100644 index 000000000..f35afa97f --- /dev/null +++ b/db/migrate/20160601073753_add_hot_to_project.rb @@ -0,0 +1,5 @@ +class AddHotToProject < ActiveRecord::Migration + def change + add_column :projects, :hot, :integer, :default => false + end +end diff --git a/db/schema.rb b/db/schema.rb index f7d61f57c..05a6f4e22 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 => 20160531021244) do +ActiveRecord::Schema.define(:version => 20160601073753) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -1810,6 +1810,7 @@ ActiveRecord::Schema.define(:version => 20160531021244) do t.integer "journals_count", :default => 0 t.integer "boards_reply_count", :default => 0 t.integer "visits", :default => 0 + t.integer "hot", :default => 0 end add_index "projects", ["lft"], :name => "index_projects_on_lft" diff --git a/public/javascripts/org.js b/public/javascripts/org.js index 5b18372ed..05ae5e717 100644 --- a/public/javascripts/org.js +++ b/public/javascripts/org.js @@ -108,4 +108,23 @@ function chooseTeacherType(org_id){ } } lastSendType = sendType; +} + +//修改状态 +function admin_hide_org(content, id){ + if (content.text() == '设为热门') + $.ajax({ + url: "/organizations/update_field_by_admin?user=" + id + "&type=project", + type: "post" + }); + else if (content.text() == '设为精品') + $.ajax({ + url: "/organizations/update_field_by_admin?user=" + id + "&type=course", + type: "post" + }); + else if (content.text() == '取消设置') + $.ajax({ + url: "/organizations/reset_update_field_by_admin?user=" + id + "&type=student", + type: "post" + }); } \ No newline at end of file From e5eeba90f634634381e1da7df239155e8992049c Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 2 Jun 2016 09:52:06 +0800 Subject: [PATCH 074/126] =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=B2=BE=E5=93=81?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=EF=BC=8C=E7=83=AD=E9=97=A8=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 25 ++++++++++--------- .../organizations/_org_container.html.erb | 17 +------------ .../update_field_by_admin.js.erb | 5 ++++ public/javascripts/org.js | 21 +++++++++++----- 4 files changed, 34 insertions(+), 34 deletions(-) create mode 100644 app/views/organizations/update_field_by_admin.js.erb diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 1b328ad7e..c63cf8c7f 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -238,23 +238,12 @@ class OrganizationsController < ApplicationController if @type.nil? @containers = Course.find_by_sql("SELECT * FROM `courses` where is_delete = 0 and is_public = 1 and name like '%#{q}%' order by updated_at desc;") elsif @type == "famous" - @containers = Course.find_by_sql("SELECT * FROM `courses` where is_delete = 0 and is_public = 1 and hot = 1 and name like '%#{q}%' order by updated_at desc;") + @containers = Course.find_by_sql("SELECT * FROM `courses` where is_delete = 0 and is_public = 1 and is_excellent = 1 and name like '%#{q}%' order by updated_at desc;") end atta_page_public @containers end def acts - q = params[:search].nil? ? "" : "#{params[:search].strip}" - @field = params[:org_subfield_id].nil? ? OrgSubfield.where("organization_id =? and field_type =?", params[:id].to_i, "Compstu").first : OrgSubfield.find(params[:org_subfield_id]) - @type = params[:type] - if @type == "courses" || @type.nil? - @org_students = User.find_by_sql("select u.*, ue.student_id, ue.school_id,(select count(*) from courses where courses.tea_id = u.id) as course_count - from users u, user_extensions ue where u.id = ue.user_id and ue.identity= 1 and concat(lastname,firstname,login) like '%#{q}%' order by course_count desc") - elsif @type == "famous" - @org_students = User.find_by_sql("select u.*, ue.student_id, ue.school_id,(select count(*) from courses where courses.tea_id = u.id) as course_count - from users u, user_extensions ue where u.id = ue.user_id and ue.identity= 1 and u.excellent_student =1 and concat(lastname,firstname,login) like '%#{q}%' order by course_count desc") - end - atta_page_public container @containers end def searchmember_by_name members, name @@ -543,6 +532,18 @@ class OrganizationsController < ApplicationController end end + def update_field_by_admin + @type = params[:type] + @status = params[:status] + if @type == "project" + @container = Project.find(params[:container]) + @status == "reset" ? @container.update_column(:hot, 0) : @container.update_column(:hot, 1) + else + @container = Course.find(params[:container]) + @status == "reset" ? @container.update_column(:is_excellent, 0) : @container.update_column(:is_excellent, 1) + end + end + # 设置为名师 def set_excellent_teacher @ex_teacher = User.find(params[:user]) diff --git a/app/views/organizations/_org_container.html.erb b/app/views/organizations/_org_container.html.erb index 42c216879..59ac4d95c 100644 --- a/app/views/organizations/_org_container.html.erb +++ b/app/views/organizations/_org_container.html.erb @@ -16,24 +16,9 @@
    资源

    - - <%= (container.class == Course ? container.is_excellent == 0 : container.hot ==0) ? "设为热门" : "取消设置" %> + <%= container.class == Course ? (container.is_excellent == 0 ? "设为精品" : "取消精品") : (container.hot ==0 ? "设为热门" : "取消热门") %>
    <% end %> - \ No newline at end of file diff --git a/app/views/organizations/update_field_by_admin.js.erb b/app/views/organizations/update_field_by_admin.js.erb new file mode 100644 index 000000000..ba218c746 --- /dev/null +++ b/app/views/organizations/update_field_by_admin.js.erb @@ -0,0 +1,5 @@ +<% if @type == "course" %> +$("#hide_<%= @container.id %>").text("<%= (@status == 'reset' ? '设为精品' : '取消精品') %>"); +<% elsif @type == "project" %> +$("#hide_<%= @container.id %>").text("<%= (@status == 'reset' ? '设为热门' : '取消热门') %>"); +<% end %> diff --git a/public/javascripts/org.js b/public/javascripts/org.js index 05ae5e717..a2b2bd361 100644 --- a/public/javascripts/org.js +++ b/public/javascripts/org.js @@ -112,19 +112,28 @@ function chooseTeacherType(org_id){ //修改状态 function admin_hide_org(content, id){ - if (content.text() == '设为热门') + if (content.text() == '设为热门'){ $.ajax({ - url: "/organizations/update_field_by_admin?user=" + id + "&type=project", + url: "/organizations/update_field_by_admin?container=" + id + "&type=project", type: "post" }); - else if (content.text() == '设为精品') + } + else if (content.text() == '设为精品'){ $.ajax({ - url: "/organizations/update_field_by_admin?user=" + id + "&type=course", + url: "/organizations/update_field_by_admin?container=" + id + "&type=course", type: "post" }); - else if (content.text() == '取消设置') + } + else if (content.text() == '取消热门'){ $.ajax({ - url: "/organizations/reset_update_field_by_admin?user=" + id + "&type=student", + url: "/organizations/update_field_by_admin?container=" + id + "&type=project" + "&status=reset", type: "post" }); + } + else if (content.text() == '取消精品'){ + $.ajax({ + url: "/organizations/update_field_by_admin?container=" + id + "&type=course" + "&status=reset", + type: "post" + }); + } } \ No newline at end of file From b72ad364db9e2cac67c5b8af1d10c70bf1aade4d Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 2 Jun 2016 10:39:11 +0800 Subject: [PATCH 075/126] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E6=B6=88=E6=81=AF=EF=BC=9A=E7=94=A8=E6=88=B7=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E3=80=81=E4=BD=9C=E4=B8=9A=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E3=80=81=E4=B8=AA=E4=BA=BA=E7=95=99=E8=A8=80=E3=80=81=E7=8F=AD?= =?UTF-8?q?=E7=BA=A7=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 - app/controllers/wechats_controller.rb | 2 + app/models/blog_comment.rb | 24 ++--- app/models/comment.rb | 12 +-- app/models/homework_common.rb | 20 ++-- app/models/issue.rb | 42 ++++---- app/models/journal.rb | 14 +-- app/models/journals_for_message.rb | 34 +++---- app/models/message.rb | 42 ++++---- app/models/news.rb | 2 +- app/services/wechat_service.rb | 140 ++++++++++++++++++++++++++ config/locales/zh.yml | 2 +- config/wechat.yml | 6 ++ 13 files changed, 244 insertions(+), 98 deletions(-) diff --git a/.gitignore b/.gitignore index 38f29a661..0727a920a 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,4 @@ vendor/cache /public/files /tags /config/initializers/gitlab_config.rb -/config/wechat.yml -/config/menu.yml 1234567 diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 4bf95fdbd..679b6382f 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -193,6 +193,8 @@ class WechatsController < ActionController::Base openid: openid, user: user ) + ws = WechatService.new + ws.binding_succ_notice(user.id, "您已成功绑定Trustie平台", user.login, format_time(Time.now)) render :json => {status:0, msg: "绑定成功"} rescue Exception=>e render :json => {status: -1, msg: e.message} diff --git a/app/models/blog_comment.rb b/app/models/blog_comment.rb index af21b4f69..255410a89 100644 --- a/app/models/blog_comment.rb +++ b/app/models/blog_comment.rb @@ -77,16 +77,16 @@ class BlogComment < ActiveRecord::Base end #博客回复微信模板消息 - def blog_wechat_message - ws = WechatService.new - if self.parent_id.nil? - self.author.watcher_users.each do |watcher| - content = strip_html self.author.try(:realname) + " 发表了博客:" + self.title.html_safe, 200 - ws.message_update_template watcher.id, "blog_comment", self.id, "#{l(:label_new_blog_template)}", content, format_time(self.created_at) - end - else - content = strip_html self.content.html_safe, 200 - ws.comment_template self.parent.author_id, "blog_comment", self.parent_id, "#{l(:label_blog_comment_template)}", self.author.try(:realname), format_time(self.created_at), content - end - end + # def blog_wechat_message + # ws = WechatService.new + # if self.parent_id.nil? + # self.author.watcher_users.each do |watcher| + # content = strip_html self.author.try(:realname) + " 发表了博客:" + self.title.html_safe, 200 + # ws.message_update_template watcher.id, "blog_comment", self.id, "#{l(:label_new_blog_template)}", content, format_time(self.created_at) + # end + # else + # content = strip_html self.content.html_safe, 200 + # ws.comment_template self.parent.author_id, "blog_comment", self.parent_id, "#{l(:label_blog_comment_template)}", self.author.try(:realname), format_time(self.created_at), content + # end + # end end diff --git a/app/models/comment.rb b/app/models/comment.rb index 8632c243a..edb5e472f 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -41,15 +41,15 @@ class Comment < ActiveRecord::Base after_destroy :down_course_score def act_as_system_message - ws = WechatService.new + #ws = WechatService.new if self.commented.course if self.author_id != self.commented.author_id self.course_messages << CourseMessage.new(:user_id => self.commented.author_id, :course_id => self.commented.course.id, :viewed => false) - count = ShieldWechatMessage.where("container_type='User' and container_id=#{self.commented.author_id} and shield_type='Course' and shield_id=#{self.commented.course.id}").count - if count == 0 - content = strip_html self.comments.html_safe, 200 - ws.comment_template self.commented.author_id, "course_notice", self.id, "#{l(:label_notice_comment_template)}", self.author.try(:realname), format_time(self.created_on), content - end + # count = ShieldWechatMessage.where("container_type='User' and container_id=#{self.commented.author_id} and shield_type='Course' and shield_id=#{self.commented.course.id}").count + # if count == 0 + # content = strip_html self.comments.html_safe, 200 + # ws.comment_template self.commented.author_id, "course_notice", self.id, "#{l(:label_notice_comment_template)}", self.author.try(:realname), format_time(self.created_on), content + # end end else # 项目相关 if self.author_id != self.commented.author_id diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb index e4426e78f..325b599e3 100644 --- a/app/models/homework_common.rb +++ b/app/models/homework_common.rb @@ -63,7 +63,7 @@ class HomeworkCommon < ActiveRecord::Base count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count if count == 0 ws = WechatService.new - ws.homework_template(m.user_id, "homework", self.id, "#{l(:label_new_homework_template)}", self.course.name, self.name.html_safe, self.end_time.to_s + " 23:59:59") + ws.homework_message_notice(m.user_id, "homework", self.id, "#{m.user.show_name},#{l(:label_new_homework_template)}:", self.course.name, "新作业:"+ self.name.html_safe, "作业内容请点击“详情”查看。") end # end end @@ -108,15 +108,15 @@ class HomeworkCommon < ActiveRecord::Base end #修改作业后发送微信模板消息 - def wechat_message - self.course.members.each do |member| - count = ShieldWechatMessage.where("container_type='User' and container_id=#{member.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count - if count == 0 - ws = WechatService.new - ws.homework_template(member.user_id, "homework", self.id, "#{l(:label_update_homework_template)}", self.course.name, self.name.html_safe, self.end_time.to_s + " 23:59:59") - end - end - end + # def wechat_message + # self.course.members.each do |member| + # count = ShieldWechatMessage.where("container_type='User' and container_id=#{member.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count + # if count == 0 + # ws = WechatService.new + # ws.homework_template(member.user_id, "homework", self.id, "#{l(:label_update_homework_template)}", self.course.name, self.name.html_safe, self.end_time.to_s + " 23:59:59") + # end + # end + # end delegate :language_name, :language, :to => :homework_detail_programing diff --git a/app/models/issue.rb b/app/models/issue.rb index b5e87feea..4cfea1f43 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -160,27 +160,27 @@ class Issue < ActiveRecord::Base unless self.author_id == self.assigned_to_id self.forge_messages << ForgeMessage.new(:user_id => self.assigned_to_id, :project_id => self.project_id, :viewed => false) end - self.project.members.each do |m| - count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Project' and shield_id=#{self.project_id}").count - if m.user_id != self.author_id && count == 0 - ws = WechatService.new - str = " 有新缺陷了: " - case self.tracker_id - when 1 - str = " 有新缺陷了: " - when 2 - str = " 有新功能了: " - when 3 - str = " 有新支持了: " - when 4 - str = " 有新任务了: " - when 5 - str = " 有新周报了: " - end - content = strip_html self.project.name + str + self.subject.html_safe, 200 - ws.message_update_template m.user_id, "issues", self.id, "#{l(:label_new_issue_template)}", content, format_time(self.created_on) - end - end + # self.project.members.each do |m| + # count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Project' and shield_id=#{self.project_id}").count + # if m.user_id != self.author_id && count == 0 + # ws = WechatService.new + # str = " 有新缺陷了: " + # case self.tracker_id + # when 1 + # str = " 有新缺陷了: " + # when 2 + # str = " 有新功能了: " + # when 3 + # str = " 有新支持了: " + # when 4 + # str = " 有新任务了: " + # when 5 + # str = " 有新周报了: " + # end + # content = strip_html self.project.name + str + self.subject.html_safe, 200 + # ws.message_update_template m.user_id, "issues", self.id, "#{l(:label_new_issue_template)}", content, format_time(self.created_on) + # end + # end if self.tracker_id == 5 self.project.members.each do |m| if m.roles.first.to_s.include?("Manager") && m.user_id != self.author_id && m.user_id != self.assigned_to_id diff --git a/app/models/journal.rb b/app/models/journal.rb index eeaa17dd6..6d59c7414 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -238,11 +238,11 @@ class Journal < ActiveRecord::Base end #缺陷回复微信模板消息 - def issue_wechat_message - if !self.notes.nil? && self.notes.gsub(' ','') != '' - ws = WechatService.new - content = strip_html self.notes.html_safe, 200 - ws.comment_template self.issue.author_id, "issues", self.journalized_id, "#{l(:label_issue_comment_template)}", self.user.try(:realname), format_time(self.created_on), content - end - end + # def issue_wechat_message + # if !self.notes.nil? && self.notes.gsub(' ','') != '' + # ws = WechatService.new + # content = strip_html self.notes.html_safe, 200 + # ws.comment_template self.issue.author_id, "issues", self.journalized_id, "#{l(:label_issue_comment_template)}", self.user.try(:realname), format_time(self.created_on), content + # end + # end end diff --git a/app/models/journals_for_message.rb b/app/models/journals_for_message.rb index d0113744c..d8819515c 100644 --- a/app/models/journals_for_message.rb +++ b/app/models/journals_for_message.rb @@ -259,24 +259,24 @@ class JournalsForMessage < ActiveRecord::Base if self.m_parent_id.nil? if self.user_id != self.jour.user_id self.course_messages << CourseMessage.new(:user_id => self.jour.user_id,:course_id => self.jour.course.id, :viewed => false) - count = ShieldWechatMessage.where("container_type='User' and container_id=#{self.jour.user_id} and shield_type='Course' and shield_id=#{self.jour.course_id}").count - if count == 0 - ws = WechatService.new - #content = truncate(strip_tags(self.notes.to_s), length: 200) - content = strip_html self.notes.html_safe, 200 - ws.comment_template self.jour.user_id, "homework", self.jour_id, "#{l(:label_homework_comment_template)}", self.user.try(:realname), format_time(self.created_on), content - end + # count = ShieldWechatMessage.where("container_type='User' and container_id=#{self.jour.user_id} and shield_type='Course' and shield_id=#{self.jour.course_id}").count + # if count == 0 + # ws = WechatService.new + # #content = truncate(strip_tags(self.notes.to_s), length: 200) + # content = strip_html self.notes.html_safe, 200 + # ws.comment_template self.jour.user_id, "homework", self.jour_id, "#{l(:label_homework_comment_template)}", self.user.try(:realname), format_time(self.created_on), content + # end end else if self.user_id != self.parent.user_id self.course_messages << CourseMessage.new(:user_id => self.parent.user_id,:course_id => self.jour.course.id, :viewed => false) - count = ShieldWechatMessage.where("container_type='User' and container_id=#{self.parent.user_id} and shield_type='Course' and shield_id=#{self.jour.course_id}").count - if count == 0 - ws = WechatService.new - #content = truncate(strip_tags(self.notes.to_s), length: 200) - content = strip_html self.notes.html_safe, 200 - ws.comment_template self.parent.user_id, "homework", self.jour_id, "#{l(:label_new_second_comment_template)}", self.user.try(:realname), format_time(self.created_on), content - end + # count = ShieldWechatMessage.where("container_type='User' and container_id=#{self.parent.user_id} and shield_type='Course' and shield_id=#{self.jour.course_id}").count + # if count == 0 + # ws = WechatService.new + # #content = truncate(strip_tags(self.notes.to_s), length: 200) + # content = strip_html self.notes.html_safe, 200 + # ws.comment_template self.parent.user_id, "homework", self.jour_id, "#{l(:label_new_second_comment_template)}", self.user.try(:realname), format_time(self.created_on), content + # end end end end @@ -293,7 +293,7 @@ class JournalsForMessage < ActiveRecord::Base if self.user_id != self.jour_id # 过滤自己给自己的留言消息 receivers << self.jour content = strip_html self.notes, 200 - ws.message_update_template self.jour_id, "journal_for_message", self.id, "#{l(:label_new_journals_template)}", content, format_time(self.created_on) + ws.journal_notice self.jour_id, "journal_for_message", self.id, "#{l(:label_new_journals_template)}", self.user.show_name, format_time(self.created_on),content end else # 留言回复 reply_to = User.find(self.reply_id) @@ -303,8 +303,8 @@ class JournalsForMessage < ActiveRecord::Base if self.user_id != self.parent.jour_id && self.reply_id != self.parent.jour_id # 给东家发信息,如果回复的对象是东家则不发 receivers << self.parent.jour end - content = strip_html self.notes, 200 - ws.comment_template self.reply_id, "journal_for_message", self.parent.id, "#{l(:label_journals_comment_template)}", self.user.try(:realname), format_time(self.created_on), content + #content = strip_html self.notes, 200 + #ws.comment_template self.reply_id, "journal_for_message", self.parent.id, "#{l(:label_journals_comment_template)}", self.user.try(:realname), format_time(self.created_on), content end receivers.each do |r| self.user_feedback_messages << UserFeedbackMessage.new(:user_id => r.id, :journals_for_message_id => self.id, :journals_for_message_type => "Principal", :viewed => false) diff --git a/app/models/message.rb b/app/models/message.rb index cf9adab4e..393fd3a60 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -258,28 +258,28 @@ class Message < ActiveRecord::Base # 主贴项目成员都能收到 # 回帖:帖子的发布人收到 def act_as_system_message - ws = WechatService.new + #ws = WechatService.new if self.course if self.parent_id.nil? # 主贴 self.course.members.includes(:user).each do |m| if self.author.allowed_to?(:as_teacher, self.course) && m.user_id != self.author_id # 老师 自己的帖子不给自己发送消息 #self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.board.course_id, :viewed => false) - count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{self.course.id}").count - if count == 0 - content = strip_html self.subject, 200 - ws.topic_publish_template m.user_id, "course_discussion", self.id, "#{l(:label_course_topic_template)}", content, self.author.try(:realname), format_time(self.created_on) - end + # count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{self.course.id}").count + # if count == 0 + # content = strip_html self.subject, 200 + # ws.topic_publish_template m.user_id, "course_discussion", self.id, "#{l(:label_course_topic_template)}", content, self.author.try(:realname), format_time(self.created_on) + # end end end else # 回帖 parent_author_id = Message.find(self.parent_id).author_id if parent_author_id != self.author_id # 只针对主贴回复,回复自己的帖子不发消息 self.course_messages << CourseMessage.new(:user_id => parent_author_id, :course_id => self.board.course_id, :viewed => false) - count = ShieldWechatMessage.where("container_type='User' and container_id=#{parent_author_id} and shield_type='Course' and shield_id=#{self.board.course_id}").count - if count == 0 - content = strip_html self.content.html_safe, 200 - ws.comment_template parent_author_id, "course_discussion", self.parent_id, "#{l(:label_topic_comment_template)}", self.author.try(:realname), format_time(self.created_on), content - end + # count = ShieldWechatMessage.where("container_type='User' and container_id=#{parent_author_id} and shield_type='Course' and shield_id=#{self.board.course_id}").count + # if count == 0 + # content = strip_html self.content.html_safe, 200 + # ws.comment_template parent_author_id, "course_discussion", self.parent_id, "#{l(:label_topic_comment_template)}", self.author.try(:realname), format_time(self.created_on), content + # end end end elsif self.project # 项目相关 @@ -287,22 +287,22 @@ class Message < ActiveRecord::Base self.project.members.includes(:user).each do |m| if m.user_id != self.author_id #self.forge_messages << ForgeMessage.new(:user_id => m.user_id, :project_id => self.board.project_id, :viewed => false) - count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Project' and shield_id=#{self.project.id}").count - if count == 0 - content = strip_html self.subject, 200 - ws.topic_publish_template m.user_id, "project_discussion", self.id, "#{l(:label_project_topic_template)}", content, self.author.try(:realname), format_time(self.created_on) - end + # count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Project' and shield_id=#{self.project.id}").count + # if count == 0 + # content = strip_html self.subject, 200 + # ws.topic_publish_template m.user_id, "project_discussion", self.id, "#{l(:label_project_topic_template)}", content, self.author.try(:realname), format_time(self.created_on) + # end end end else # 回帖 parent_author_id = Message.find(self.parent_id).author_id if parent_author_id != self.author_id # 只针对主贴回复,回复自己的帖子不发消息 self.forge_messages << ForgeMessage.new(:user_id => parent_author_id, :project_id => self.board.project_id, :viewed => false) - count = ShieldWechatMessage.where("container_type='User' and container_id=#{parent_author_id} and shield_type='Project' and shield_id=#{self.board.project_id}").count - if count == 0 - content = strip_html self.content.html_safe, 200 - ws.comment_template parent_author_id, "project_discussion", self.parent_id, "#{l(:label_topic_comment_template)}", self.author.try(:realname), format_time(self.created_on), content - end + # count = ShieldWechatMessage.where("container_type='User' and container_id=#{parent_author_id} and shield_type='Project' and shield_id=#{self.board.project_id}").count + # if count == 0 + # content = strip_html self.content.html_safe, 200 + # ws.comment_template parent_author_id, "project_discussion", self.parent_id, "#{l(:label_topic_comment_template)}", self.author.try(:realname), format_time(self.created_on), content + # end end end end diff --git a/app/models/news.rb b/app/models/news.rb index 0b03dcc48..54f6fce08 100644 --- a/app/models/news.rb +++ b/app/models/news.rb @@ -174,7 +174,7 @@ class News < ActiveRecord::Base if count == 0 ws = WechatService.new content = strip_html self.author.try(:realname) + " 发布了通知:" + self.title.html_safe, 200 - ws.message_update_template m.user_id, "course_notice", self.id, "#{l(:label_new_notice_template)}", content, format_time(self.created_on) + ws.class_notice m.user_id, "course_notice", self.id, "#{l(:label_new_notice_template)}", self.course.name, self.author.show_name, format_time(self.created_on), content, "点击查看通知详情" end end end diff --git a/app/services/wechat_service.rb b/app/services/wechat_service.rb index 6d8c0f234..e0c7811fd 100644 --- a/app/services/wechat_service.rb +++ b/app/services/wechat_service.rb @@ -110,4 +110,144 @@ class WechatService Rails.logger.info "send over. #{req}" end end + + def two_keys_template(openid, template_id, type, id, first, key1, key2, remark="") + data = { + touser:openid, + template_id:template_id, + url:"https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{Setting.protocol}://#{Setting.host_name}/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect", + topcolor:"#FF0000", + data:{ + first: { + value:first, + color:"#707070" + }, + keyword1:{ + value:key1, + color:"#707070" + }, + keyword2:{ + value:key2, + color:"#707070" + }, + remark:{ + value:remark, + color:"#707070" + } + } + } + data + end + + def four_keys_template(openid, template_id, type, id, first, key1, key2, key3, key4, remark="") + data = { + touser:openid, + template_id:template_id, + url:"https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{Setting.protocol}://#{Setting.host_name}/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect", + topcolor:"#FF0000", + data:{ + first: { + value:first, + color:"#707070" + }, + keyword1:{ + value:key1, + color:"#707070" + }, + keyword2:{ + value:key2, + color:"#707070" + }, + keyword3:{ + value:key3, + color:"#707070" + }, + keyword4:{ + value:key4, + color:"#707070" + }, + remark:{ + value:remark, + color:"#707070" + } + } + } + data + end + + def binding_succ_notice(user_id, first, key1, key2) + uw = UserWechat.where(user_id: user_id).first + unless uw.nil? + data = { + touser:uw.openid, + template_id:Wechat.config.binding_succ_notice, + url:"https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{Setting.protocol}://#{Setting.host_name}/assets/wechat/app.html#/activities?response_type=code&scope=snsapi_base&state=123#wechat_redirect", + topcolor:"#FF0000", + data:{ + first: { + value:first, + color:"#707070" + }, + keyword1:{ + value:key1, + color:"#707070" + }, + keyword2:{ + value:key2, + color:"#707070" + }, + remark:{ + value:"绑定成功后可使用微信查看Trustie平台最新动态", + color:"#707070" + } + } + } + begin + req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data) + rescue Exception => e + Rails.logger.error "[homework] ===> #{e}" + end + Rails.logger.info "send over. #{req}" + end + end + + def journal_notice(user_id, type, id, first, key1, key2, remark="") + uw = UserWechat.where(user_id: user_id).first + unless uw.nil? + data = two_keys_template uw.openid,Wechat.config.journal_notice, type, id, first, key1, key2, remark + begin + req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data) + rescue Exception => e + Rails.logger.error "[homework] ===> #{e}" + end + Rails.logger.info "send over. #{req}" + end + end + + def homework_message_notice(user_id, type, id, first, key1, key2, remark="") + uw = UserWechat.where(user_id: user_id).first + unless uw.nil? + data = two_keys_template uw.openid,Wechat.config.homework_message_notice, type, id, first, key1, key2, remark + begin + req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data) + rescue Exception => e + Rails.logger.error "[homework] ===> #{e}" + end + Rails.logger.info "send over. #{req}" + end + end + + def class_notice(user_id, type, id, first, key1, key2, key3, key4, remark="") + uw = UserWechat.where(user_id: user_id).first + unless uw.nil? + data = four_keys_template uw.openid,Wechat.config.class_notice, type, id, first, key1, key2, key3, key4, remark + begin + req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data) + rescue Exception => e + Rails.logger.error "[homework] ===> #{e}" + end + Rails.logger.info "send over. #{req}" + end + end + end \ No newline at end of file diff --git a/config/locales/zh.yml b/config/locales/zh.yml index a347359bb..94be8af6d 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2128,7 +2128,7 @@ zh: label_resource_belongs_project: 所属项目 #微信模板消息 - label_new_homework_template: 您的课程有新作业了 + label_new_homework_template: 您有新作业了 label_update_homework_template: 您的作业已被修改 label_course_topic_template: 课程问答区有新帖子发布了 label_topic_comment_template: 您的帖子有新回复了 diff --git a/config/wechat.yml b/config/wechat.yml index 5b528487b..3d679c4ce 100644 --- a/config/wechat.yml +++ b/config/wechat.yml @@ -11,6 +11,12 @@ default: &default encoding_aes_key: "QyocNOkRmrT5HzBpCG54EVPUQjk86nJapXNVDQm6Yy6" jsapi_ticket: "C:/Users/[user_name]/wechat_jsapi_ticket" + #template + binding_succ_notice: "n4KLwcWNrIMYkKxWL2hUwzunm5RTT54EbWem2MIUapU" + journal_notice: "XpHHYkqSGkwuF9vHthRdmPQLvCFRQ4_NbRBP12T7ciE" + homework_message_notice: "Kom0TsYYKsNKCS6luweYVRo9z-mH0wRPr24b1clGCPQ" + class_notice: "8LVu33l6bP-56SDomVgHn-yJc57YpCwwJ81rAJgRONk" + production: <<: *default From b20dc06e231a8ce68646b4fd2ce6d483013f0e9f Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 2 Jun 2016 10:56:04 +0800 Subject: [PATCH 076/126] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=89=88=E9=85=8D=E7=BD=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/wechat_service.rb | 2 +- config/menu.yml | 2 +- public/javascripts/wechat/app.js | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/services/wechat_service.rb b/app/services/wechat_service.rb index e0c7811fd..f9a59e080 100644 --- a/app/services/wechat_service.rb +++ b/app/services/wechat_service.rb @@ -181,7 +181,7 @@ class WechatService data = { touser:uw.openid, template_id:Wechat.config.binding_succ_notice, - url:"https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{Setting.protocol}://#{Setting.host_name}/assets/wechat/app.html#/activities?response_type=code&scope=snsapi_base&state=123#wechat_redirect", + url:"https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect", topcolor:"#FF0000", data:{ first: { diff --git a/config/menu.yml b/config/menu.yml index 83b892037..79659fb90 100644 --- a/config/menu.yml +++ b/config/menu.yml @@ -2,7 +2,7 @@ button: - type: "view" name: "最新动态" - url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf694495398c7d470&redirect_uri=http://wechat.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect" + url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://test.course.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect" - type: "click" name: "意见反馈" diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 9d0b045c3..ee849aad8 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -1,10 +1,10 @@ var app = angular.module('wechat', ['ngRoute','ngCookies']); var apiUrl = '/api/v1/'; -var debug = true; //调试标志,如果在本地请置为true +var debug = false; //调试标志,如果在本地请置为true if(debug===true){ - apiUrl = 'http://localhost:3000/api/v1/'; - //apiUrl = 'https://www.trustie.net/api/v1/'; + //apiUrl = 'http://localhost:3000/api/v1/'; + apiUrl = 'https://www.trustie.net/api/v1/'; } From 76732a3034b4ea0b17cf80dfb317986f97f479c3 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 2 Jun 2016 13:17:38 +0800 Subject: [PATCH 077/126] =?UTF-8?q?=E6=96=B0=E6=A8=A1=E5=BC=8F=E6=9C=89?= =?UTF-8?q?=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 33 +++-- app/helpers/organizations_helper.rb | 16 ++- .../organizations/_org_custom_right1.html.erb | 115 +++++++----------- .../_organization_content_extension.html.erb | 18 ++- public/stylesheets/org_custom.css | 2 +- 5 files changed, 94 insertions(+), 90 deletions(-) diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index c63cf8c7f..4021560bf 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -79,19 +79,28 @@ class OrganizationsController < ApplicationController # 组织新类型 show_mode:判断标准 1为新类型,0为旧 if @organization.switch_type && params[:org_subfield_id].nil? && params[:list] .nil? if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization) - # REDO:时间紧,暂时先这样 - @org_logo_attchment = Attachment.find_by_sql("SELECT * from attachments WHERE container_id = #{@organization.id} and container_type = 'Organization' and attachtype = 0 and filename REGEXP '(.jpg|.png|.bmp|.gif|.jpeg)' ORDER BY created_on desc limit 1").first - @org_banner_attchment = Attachment.find_by_sql("SELECT * from attachments WHERE container_id = #{@organization.id} and container_type = 'Organization' and attachtype = 1 and filename REGEXP '(.jpg|.png|.bmp|.gif|.jpeg)' ORDER BY created_on desc limit 1").first - @subfield_content = @organization.org_subfields.order("priority") - @organization = Organization.find(params[:id]) - shield_project_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Project'").map(&:shield_id) - shield_course_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Course'").map(&:shield_id) - project_ids = (@organization.projects.map(&:id)-shield_project_ids) << 0 - course_ids = (@organization.courses.map(&:id)-shield_course_ids) << 0 - course_types = "('Message','News','HomeworkCommon','Poll','Course')" - @project_acts = get_project_activities_org @organization, project_ids - @course_acts = get_course_activities_org @organization, course_ids + shield_project_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Project'").map(&:shield_id) + shield_course_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Course'").map(&:shield_id) + project_ids = (@organization.projects.map(&:id) - shield_project_ids) << 0 + course_ids = (@organization.courses.map(&:id) - shield_course_ids) << 0 + course_types = "('Message','News','HomeworkCommon','Poll','Course')" + @project_acts = get_project_activities_org @organization, project_ids + @course_acts = get_course_activities_org @organization, course_ids + # 精品课程, 不符合条件的组织则不查询 + if @organization.org_subfields.where(:field_type => "Compcou", :hide => 0).count > 0 + @excellent_courses = Course.where(:is_public => true, :is_delete => false, :is_excellent => true) + end + # 热门项目 + if @organization.org_subfields.where(:field_type => "Comppro", :hide => 0).count > 0 + @excellent_courses = Course.where(:is_public => true, :status => true) + end + # 最新动态, 来自我关联的项目和课程 + if @organization.org_subfields.where(:field_type => "Compact", :hide => 0).count > 0 + @acts = UserActivity.find_by_sql("SELECT * FROM `user_activities` where act_type in ('HomeworkCommon', 'News', 'Message', 'Issue') and + ((container_type = 'Course' and container_id in (#{course_ids.join(',')})) or (container_type = 'Project' and container_id in (#{project_ids.join(',')}))) + order by created_at desc limit 6;") + end render :layout => 'base_org_custom' else render_403 diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index 8e75ec5d1..4c6089b51 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -63,6 +63,16 @@ module OrganizationsHelper end end + def org_user_by_type obj + case obj.act_type + when "Message" + when "News" + when "HomeworkCommon" + when "Issue" + end + + end + #排列下拉框 def subfield_status_option type = [] @@ -176,9 +186,9 @@ module OrganizationsHelper end # 获取最新动态 - def get_latest_acts - acts = UserActivity.find_by_sql("SELECT * FROM `user_activities` where act_type in ('HomeworkCommon', 'news', 'message', 'Issue') and (container_type = 'Course' or container_type = 'Project') order by created_at limit 10;") - end + # def get_latest_acts + # acts = UserActivity.find_by_sql("SELECT * FROM `user_activities` where act_type in ('HomeworkCommon', 'news', 'message', 'Issue') and (container_type = 'Course' or container_type = 'Project') order by created_at limit 10;") + # end def org_teacher_resource_count user results = Attachment.find_by_sql("SELECT * FROM attachments where author_id = #{user.id};").count diff --git a/app/views/organizations/_org_custom_right1.html.erb b/app/views/organizations/_org_custom_right1.html.erb index 6fc24555f..4fed81a6b 100644 --- a/app/views/organizations/_org_custom_right1.html.erb +++ b/app/views/organizations/_org_custom_right1.html.erb @@ -1,71 +1,48 @@
    -

    最新动态更多>

    -
      -
    • - -
      -

      - 叮当当  :  - Trustie社区新版上线了必须支持一下,比以前好用很多.... -

      -

      1分钟前 500

      -
      -
      -
    • -
    • - -
      -

      - 叮当叮当叮当叮当  :  - Trustie社区新版上线了必须支持一下,比以前好用很多了。Trustie社区新版上线了必须支持一下,比以前好用很多了... -

      -

      1分钟前 500

      -
      -
      -
    • -
    • - -
      -

      - 叮当叮当叮当叮当  :  - Trustie社区新版上线了必须支持一下,比以前好用很多了。Trustie社区新版上线了必须支持一下,比以前好用很多了... -

      -

      1分钟前 500

      -
      -
      -
    • -
    • - -
      -

      - 当叮当  :  - Trustie社区新版上线了必须支持一下,比以前好用很多了。Trustie社区新版上线了必须支持一下,比以前好用很多了... -

      -

      1分钟前 500

      -
      -
      -
    • -
    • - -
      -

      - 叮当叮当叮当叮当  :  - Trustie社区新版上线了必须支持一下很多了... -

      -

      1分钟前 500

      -
      -
      -
    • -
    • - -
      -

      - 叮当叮当叮当叮当  :  - Trustie社区新版上线了必须支持一下,比以前好用很多了。Trustie社区新版上线了必须支持一下,比以前好用很多了... -

      -

      1分钟前 500

      -
      -
      -
    • -
    +

    <%= field.name %>

    + <% if @acts.blank? %> +

    该模块暂时没有相关内容

    + <% else %> +
      + <% @acts.each do |obj| %> + <% if obj.act_type = "Message" %> + <% user = org_user_by_type(obj) %> + <% title = org_title_by_type(obj) %> + <% content = org_content_by_type(obj) %> + <% message = obj.act %> + <% title = message.parent_id.nil? ? message.subject : message.parent.subject %> +
    • + <%= link_to image_tag(url_to_avatar(user),:width => "43", :height => "43", :class => "por_users_img"), user_path(user), :target => "_blank", :class => "fl" %> +
      +

      + <%= link_to message.author.show_name, user_path(message.author), :class => "por_hot_name fl", :target => "_blank" %> +  :  + <%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> message.content, :maxheight => 40, :maxwordsnum => 28, :maxwidth => 0, :cl => ""} %> +

      +

      <%= time_from_now(message.created_on) %> + +

      +
      +
      +
    • + <% elsif obj.act_type = "News" %> + + <% elsif obj.act_type = "HomeworkCommon" %> + <% elsif obj.act_type = "Issue" %> + <% end %> + <% end %> +
    • + +
      +

      + 叮当当  :  + Trustie社区新版上线了必须支持一下,比以前好用很多.... +

      +

      1分钟前 500

      +
      +
      +
    • + +
    + <% end %>
    \ No newline at end of file diff --git a/app/views/organizations/_organization_content_extension.html.erb b/app/views/organizations/_organization_content_extension.html.erb index a486edd65..be5343d61 100644 --- a/app/views/organizations/_organization_content_extension.html.erb +++ b/app/views/organizations/_organization_content_extension.html.erb @@ -1,8 +1,16 @@ -

    - - <%= content.to_s.html_safe%> - -

    +<% if cl.nil? %> + + + <%= content.to_s.html_safe%> + + +<% else %> +

    + + <%= content.to_s.html_safe%> + +

    +<% end %> -
    +
    <%= form_tag organization_org_document_comments_path(:organization_id => @organization.id), :id => 'new_org_document_form' do |f| %>
    diff --git a/app/views/org_document_comments/show.html.erb b/app/views/org_document_comments/show.html.erb index 3d9527b8b..c7adc39fb 100644 --- a/app/views/org_document_comments/show.html.erb +++ b/app/views/org_document_comments/show.html.erb @@ -5,7 +5,7 @@ showNormalImage('message_description_<%= @document.id %>'); }); -
    +
    <%= link_to image_tag(url_to_avatar(User.find(@document.creator_id)), :width => 45, :heigth => 45), user_url_in_org(@document.creator_id) %> diff --git a/app/views/sub_document_comments/_new.html.erb b/app/views/sub_document_comments/_new.html.erb index c6cc13164..aec91c878 100644 --- a/app/views/sub_document_comments/_new.html.erb +++ b/app/views/sub_document_comments/_new.html.erb @@ -36,7 +36,7 @@ $('#doc_title_hint').hide(); } -
    +
    <%= form_tag org_subfield_sub_domain_sub_document_comments_path(:org_subfield_id => @org_subfield.id, :sub_domain_id => @subdomain.id), :id => 'new_sub_document_form' do |f| %>
    diff --git a/app/views/sub_document_comments/show.html.erb b/app/views/sub_document_comments/show.html.erb index 7050c1c66..f85f3ed25 100644 --- a/app/views/sub_document_comments/show.html.erb +++ b/app/views/sub_document_comments/show.html.erb @@ -8,7 +8,7 @@ showNormalImage('message_description_<%= @document.id %>'); }); -
    +
    <%= link_to image_tag(url_to_avatar(User.find(@document.creator_id)), :width => 45, :heigth => 45), user_url_in_org(@document.creator_id) %> @@ -138,7 +138,7 @@
    <%# end %> - <% if User.current.logged?%> + <%# if User.current.logged?%>
    @@ -151,7 +151,7 @@
    - <% end %> + <%# end %>
    From 0b3ec0322f80c7036a88af1dcc9295491e958a4c Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 2 Jun 2016 18:41:00 +0800 Subject: [PATCH 093/126] =?UTF-8?q?=E5=8F=B3=E4=B8=80=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/organizations_helper.rb | 29 +++++++++ .../organizations/_org_custom_right1.html.erb | 62 ++++++++----------- .../_organization_content_extension.html.erb | 13 +--- 3 files changed, 57 insertions(+), 47 deletions(-) diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index 4c6089b51..a5a3d6aaa 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -66,11 +66,40 @@ module OrganizationsHelper def org_user_by_type obj case obj.act_type when "Message" + user = obj.act.author when "News" + user = obj.act.author when "HomeworkCommon" + user = obj.act.user when "Issue" + user = obj.act.author end + end + def org_title_by_type obj + case obj.act_type + when "Message" + user = obj.act.parent_id.nil? ? obj.act.subject : obj.act.parent.subject + when "News" + user = obj.act.title + when "HomeworkCommon" + user = obj.act.name + when "Issue" + user = obj.act.subject + end + end + + def org_content_by_type obj + case obj.act_type + when "Message" + user = obj.act.parent_id.nil? ? obj.act.content : obj.act.parent.content + when "News" + user = obj.act.description + when "HomeworkCommon" + user = obj.act.description + when "Issue" + user = obj.act.description + end end #排列下拉框 diff --git a/app/views/organizations/_org_custom_right1.html.erb b/app/views/organizations/_org_custom_right1.html.erb index 4fed81a6b..882c994cc 100644 --- a/app/views/organizations/_org_custom_right1.html.erb +++ b/app/views/organizations/_org_custom_right1.html.erb @@ -5,44 +5,32 @@ <% else %>
      <% @acts.each do |obj| %> - <% if obj.act_type = "Message" %> - <% user = org_user_by_type(obj) %> - <% title = org_title_by_type(obj) %> - <% content = org_content_by_type(obj) %> - <% message = obj.act %> - <% title = message.parent_id.nil? ? message.subject : message.parent.subject %> -
    • - <%= link_to image_tag(url_to_avatar(user),:width => "43", :height => "43", :class => "por_users_img"), user_path(user), :target => "_blank", :class => "fl" %> -
      -

      - <%= link_to message.author.show_name, user_path(message.author), :class => "por_hot_name fl", :target => "_blank" %> -  :  - <%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> message.content, :maxheight => 40, :maxwordsnum => 28, :maxwidth => 0, :cl => ""} %> -

      -

      <%= time_from_now(message.created_on) %> - -

      -
      -
      -
    • - <% elsif obj.act_type = "News" %> - - <% elsif obj.act_type = "HomeworkCommon" %> - <% elsif obj.act_type = "Issue" %> - <% end %> + <% user = org_user_by_type(obj) %> + <% title = org_title_by_type(obj) %> + <% content = org_content_by_type(obj) %> +
    • + <%= link_to image_tag(url_to_avatar(user),:width => "43", :height => "43", :class => "por_users_img"), user_path(user), :target => "_blank", :class => "fl" %> +
      +

      + <%= link_to user.show_name, user_path(user), :class => "por_hot_name fl", :target => "_blank" %> +  :  + <% if obj.act_type = "Message" %> + <%= link_to title, board_message_path(obj.act.board.id, obj.act.id) %> + <% elsif obj.act_type = "News" %> + <%= link_to title, news_path(obj.act.id) %> + <% elsif obj.act_type = "HomeworkCommon" %> + <%= link_to title, student_work_index_url_in_org(obj.act.id) %> + <% elsif obj.act_type = "Issue" %> + <%= link_to title, issue_path(obj.act.id) %> + <% end %> +

      +

      <%= time_from_now(obj.act.created_on) %> + +

      +
      +
      +
    • <% end %> -
    • - -
      -

      - 叮当当  :  - Trustie社区新版上线了必须支持一下,比以前好用很多.... -

      -

      1分钟前 500

      -
      -
      -
    • -
    <% end %>
    \ No newline at end of file diff --git a/app/views/organizations/_organization_content_extension.html.erb b/app/views/organizations/_organization_content_extension.html.erb index be5343d61..48abd48b9 100644 --- a/app/views/organizations/_organization_content_extension.html.erb +++ b/app/views/organizations/_organization_content_extension.html.erb @@ -1,16 +1,9 @@ -<% if cl.nil? %> - +

    <%= content.to_s.html_safe%> - -<% else %> -

    - - <%= content.to_s.html_safe%> - -

    -<% end %> +

    + + + + \ No newline at end of file diff --git a/public/plugin_assets/redmine_code_review/stylesheets/window_js/darkX.css b/public/plugin_assets/redmine_code_review/stylesheets/window_js/darkX.css index 2f83cfd46..e3df3e0a4 100644 --- a/public/plugin_assets/redmine_code_review/stylesheets/window_js/darkX.css +++ b/public/plugin_assets/redmine_code_review/stylesheets/window_js/darkX.css @@ -1,121 +1,121 @@ -.overlay_darkX { - background-color: #85BBEF; - filter:alpha(opacity=60); - -moz-opacity: 0.6; - opacity: 0.6; -} - -.darkX_nw { - background: transparent url(darkX/titlebar-left-focused.png) no-repeat 0 0; - width:6px; - height:21px; -} -.darkX_n { - background: transparent url(darkX/titlebar-mid-focused.png) repeat-x 0 0; - height:21px; -} -.darkX_ne { - background: transparent url(darkX/titlebar-right-focused.png) no-repeat 0 0; - width:6px; - height:21px; -} -.darkX_w { - background: transparent url(darkX/frame-left-focused.png) repeat-y top left; - width:3px; -} - -.darkX_e { - background: transparent url(darkX/frame-right-focused.png) repeat-y top right; - width:3px; -} - -.darkX_sw { - background: transparent url(darkX/frame-bottom-left-focused.png) no-repeat 0 0; - width:5px; - height:3px; -} -.darkX_s { - background: transparent url(darkX/frame-bottom-mid-focused.png) repeat-x 0 0; - height:3px; -} -.darkX_se, .darkX_sizer { - background: transparent url(darkX/frame-bottom-right-focused.png) no-repeat 0 0; - width:5px; - height:3px; -} - -.darkX_sizer { - cursor:se-resize; -} - -.darkX_close { - width: 21px; - height: 21px; - background: transparent url(darkX/button-close-focused.png) no-repeat 0 0; - position:absolute; - top:0px; - right:5px; - cursor:pointer; - z-index:1000; -} - -.darkX_minimize { - width: 21px; - height: 21px; - background: transparent url(darkX/button-minimize-focused.png) no-repeat 0 0; - position:absolute; - top:0px; - right:26px; - cursor:pointer; - z-index:1000; -} - -.darkX_maximize { - width: 21px; - height: 21px; - background: transparent url(darkX/button-maximize-focused.png) no-repeat 0 0; - position:absolute; - top:0px; - right:47px; - cursor:pointer; - z-index:1000; -} - - -.darkX_title { - float:left; - height:14px; - font-size:12px; - text-align:center; - margin-top:2px; - width:100%; - color:#FFF; -} - -.darkX_content { - overflow:auto; - color: #E6DF2A; - font-family: Tahoma, Arial, sans-serif; - font-size: 14px; - background:#5E5148; -} - - -/* FOR IE */ -* html .darkX_minimize { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/darkX/button-minimize-focused.png", sizingMethod="crop"); -} - -* html .darkX_maximize { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/darkX/button-maximize-focused.png", sizingMethod="scale"); -} - -* html .darkX_close { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/darkX/button-close-focused.png", sizingMethod="crop"); -} +.overlay_darkX { + background-color: #85BBEF; + filter:alpha(opacity=60); + -moz-opacity: 0.6; + opacity: 0.6; +} + +.darkX_nw { + background: transparent url(darkX/titlebar-left-focused.png) no-repeat 0 0; + width:6px; + height:21px; +} +.darkX_n { + background: transparent url(darkX/titlebar-mid-focused.png) repeat-x 0 0; + height:21px; +} +.darkX_ne { + background: transparent url(darkX/titlebar-right-focused.png) no-repeat 0 0; + width:6px; + height:21px; +} +.darkX_w { + background: transparent url(darkX/frame-left-focused.png) repeat-y top left; + width:3px; +} + +.darkX_e { + background: transparent url(darkX/frame-right-focused.png) repeat-y top right; + width:3px; +} + +.darkX_sw { + background: transparent url(darkX/frame-bottom-left-focused.png) no-repeat 0 0; + width:5px; + height:3px; +} +.darkX_s { + background: transparent url(darkX/frame-bottom-mid-focused.png) repeat-x 0 0; + height:3px; +} +.darkX_se, .darkX_sizer { + background: transparent url(darkX/frame-bottom-right-focused.png) no-repeat 0 0; + width:5px; + height:3px; +} + +.darkX_sizer { + cursor:se-resize; +} + +.darkX_close { + width: 21px; + height: 21px; + background: transparent url(darkX/button-close-focused.png) no-repeat 0 0; + position:absolute; + top:0px; + right:5px; + cursor:pointer; + z-index:1000; +} + +.darkX_minimize { + width: 21px; + height: 21px; + background: transparent url(darkX/button-minimize-focused.png) no-repeat 0 0; + position:absolute; + top:0px; + right:26px; + cursor:pointer; + z-index:1000; +} + +.darkX_maximize { + width: 21px; + height: 21px; + background: transparent url(darkX/button-maximize-focused.png) no-repeat 0 0; + position:absolute; + top:0px; + right:47px; + cursor:pointer; + z-index:1000; +} + + +.darkX_title { + float:left; + height:14px; + font-size:12px; + text-align:center; + margin-top:2px; + width:100%; + color:#FFF; +} + +.darkX_content { + overflow:auto; + color: #E6DF2A; + font-family: Tahoma, Arial, sans-serif; + font-size: 14px; + background:#5E5148; +} + + +/* FOR IE */ +* html .darkX_minimize { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/darkX/button-minimize-focused.png", sizingMethod="crop"); +} + +* html .darkX_maximize { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/darkX/button-maximize-focused.png", sizingMethod="scale"); +} + +* html .darkX_close { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/darkX/button-close-focused.png", sizingMethod="crop"); +} diff --git a/public/plugin_assets/redmine_code_review/stylesheets/window_js/debug.css b/public/plugin_assets/redmine_code_review/stylesheets/window_js/debug.css index 69e3b7fc2..d7981e9ca 100644 --- a/public/plugin_assets/redmine_code_review/stylesheets/window_js/debug.css +++ b/public/plugin_assets/redmine_code_review/stylesheets/window_js/debug.css @@ -1,25 +1,25 @@ -div.inspector div.inspectable { - padding: 0.25em 0 0.25em 1em; - background-color: Gray; - color: white; - border: outset 2px white; - cursor: pointer; -} - -div.inspector div.child { - margin: 0 0 0 1em; -} - -#debug_window_content { /* DIV container for debug sizing*/ - width:250px; - height:100px; - background-color:#000; -} - -#debug { /* DIV container for debug contents*/ - padding:3px; - color:#0f0; - font-family:monaco, Tahoma, Verdana, Arial, Helvetica, sans-serif; - font-size:10px; -} - +div.inspector div.inspectable { + padding: 0.25em 0 0.25em 1em; + background-color: Gray; + color: white; + border: outset 2px white; + cursor: pointer; +} + +div.inspector div.child { + margin: 0 0 0 1em; +} + +#debug_window_content { /* DIV container for debug sizing*/ + width:250px; + height:100px; + background-color:#000; +} + +#debug { /* DIV container for debug contents*/ + padding:3px; + color:#0f0; + font-family:monaco, Tahoma, Verdana, Arial, Helvetica, sans-serif; + font-size:10px; +} + diff --git a/public/plugin_assets/redmine_code_review/stylesheets/window_js/default.css b/public/plugin_assets/redmine_code_review/stylesheets/window_js/default.css index 6ab13789d..591451723 100644 --- a/public/plugin_assets/redmine_code_review/stylesheets/window_js/default.css +++ b/public/plugin_assets/redmine_code_review/stylesheets/window_js/default.css @@ -1,155 +1,155 @@ -.overlay_dialog { - background-color: #666666; - filter:alpha(opacity=60); - -moz-opacity: 0.6; - opacity: 0.6; -} - -.overlay___invisible__ { - background-color: #666666; - filter:alpha(opacity=0); - -moz-opacity: 0; - opacity: 0; -} - -.dialog_nw { - width: 9px; - height: 23px; - background: transparent url(default/top_left.gif) no-repeat 0 0; -} - -.dialog_n { - background: transparent url(default/top_mid.gif) repeat-x 0 0; - height: 23px; -} - -.dialog_ne { - width: 9px; - height: 23px; - background: transparent url(default/top_right.gif) no-repeat 0 0; -} - -.dialog_e { - width: 2px; - background: transparent url(default/center_right.gif) repeat-y 0 0; -} - -.dialog_w { - width: 2px; - background: transparent url(default/center_left.gif) repeat-y 0 0; -} - -.dialog_sw { - width: 9px; - height: 19px; - background: transparent url(default/bottom_left.gif) no-repeat 0 0; -} - -.dialog_s { - background: transparent url(default/bottom_mid.gif) repeat-x 0 0; - height: 19px; -} - -.dialog_se { - width: 9px; - height: 19px; - background: transparent url(default/bottom_right.gif) no-repeat 0 0; -} - -.dialog_sizer { - width: 9px; - height: 19px; - background: transparent url(default/sizer.gif) no-repeat 0 0; - cursor:se-resize; -} - -.dialog_close { - width: 14px; - height: 14px; - background: transparent url(default/close.gif) no-repeat 0 0; - position:absolute; - top:5px; - left:8px; - cursor:pointer; - z-index:2000; -} - -.dialog_minimize { - width: 14px; - height: 15px; - background: transparent url(default/minimize.gif) no-repeat 0 0; - position:absolute; - top:5px; - left:28px; - cursor:pointer; - z-index:2000; -} - -.dialog_maximize { - width: 14px; - height: 15px; - background: transparent url(default/maximize.gif) no-repeat 0 0; - position:absolute; - top:5px; - left:49px; - cursor:pointer; - z-index:2000; -} - -.dialog_title { - float:left; - height:14px; - font-family: Tahoma, Arial, sans-serif; - font-size:12px; - text-align:center; - width:100%; - color:#000; -} - -.dialog_content { - overflow:auto; - color: #DDD; - font-family: Tahoma, Arial, sans-serif; - font-size: 10px; - background-color:#123; -} - -.top_draggable, .bottom_draggable { - cursor:move; -} - -.status_bar { - font-size:12px; -} -.status_bar input{ - font-size:12px; -} - -.wired_frame { - display: block; - position: absolute; - border: 1px #000 dashed; -} - -/* DO NOT CHANGE THESE VALUES*/ -.dialog { - display: block; - position: absolute; -} - -.dialog table.table_window { - border-collapse: collapse; - border-spacing: 0; - width: 100%; - margin: 0px; - padding:0px; -} - -.dialog table.table_window td , .dialog table.table_window th { - padding: 0; -} - -.dialog .title_window { - -moz-user-select:none; -} - +.overlay_dialog { + background-color: #666666; + filter:alpha(opacity=60); + -moz-opacity: 0.6; + opacity: 0.6; +} + +.overlay___invisible__ { + background-color: #666666; + filter:alpha(opacity=0); + -moz-opacity: 0; + opacity: 0; +} + +.dialog_nw { + width: 9px; + height: 23px; + background: transparent url(default/top_left.gif) no-repeat 0 0; +} + +.dialog_n { + background: transparent url(default/top_mid.gif) repeat-x 0 0; + height: 23px; +} + +.dialog_ne { + width: 9px; + height: 23px; + background: transparent url(default/top_right.gif) no-repeat 0 0; +} + +.dialog_e { + width: 2px; + background: transparent url(default/center_right.gif) repeat-y 0 0; +} + +.dialog_w { + width: 2px; + background: transparent url(default/center_left.gif) repeat-y 0 0; +} + +.dialog_sw { + width: 9px; + height: 19px; + background: transparent url(default/bottom_left.gif) no-repeat 0 0; +} + +.dialog_s { + background: transparent url(default/bottom_mid.gif) repeat-x 0 0; + height: 19px; +} + +.dialog_se { + width: 9px; + height: 19px; + background: transparent url(default/bottom_right.gif) no-repeat 0 0; +} + +.dialog_sizer { + width: 9px; + height: 19px; + background: transparent url(default/sizer.gif) no-repeat 0 0; + cursor:se-resize; +} + +.dialog_close { + width: 14px; + height: 14px; + background: transparent url(default/close.gif) no-repeat 0 0; + position:absolute; + top:5px; + left:8px; + cursor:pointer; + z-index:2000; +} + +.dialog_minimize { + width: 14px; + height: 15px; + background: transparent url(default/minimize.gif) no-repeat 0 0; + position:absolute; + top:5px; + left:28px; + cursor:pointer; + z-index:2000; +} + +.dialog_maximize { + width: 14px; + height: 15px; + background: transparent url(default/maximize.gif) no-repeat 0 0; + position:absolute; + top:5px; + left:49px; + cursor:pointer; + z-index:2000; +} + +.dialog_title { + float:left; + height:14px; + font-family: Tahoma, Arial, sans-serif; + font-size:12px; + text-align:center; + width:100%; + color:#000; +} + +.dialog_content { + overflow:auto; + color: #DDD; + font-family: Tahoma, Arial, sans-serif; + font-size: 10px; + background-color:#123; +} + +.top_draggable, .bottom_draggable { + cursor:move; +} + +.status_bar { + font-size:12px; +} +.status_bar input{ + font-size:12px; +} + +.wired_frame { + display: block; + position: absolute; + border: 1px #000 dashed; +} + +/* DO NOT CHANGE THESE VALUES*/ +.dialog { + display: block; + position: absolute; +} + +.dialog table.table_window { + border-collapse: collapse; + border-spacing: 0; + width: 100%; + margin: 0px; + padding:0px; +} + +.dialog table.table_window td , .dialog table.table_window th { + padding: 0; +} + +.dialog .title_window { + -moz-user-select:none; +} + diff --git a/public/plugin_assets/redmine_code_review/stylesheets/window_js/iefix/iepngfix.css b/public/plugin_assets/redmine_code_review/stylesheets/window_js/iefix/iepngfix.css index 257a1b1e3..249388be5 100644 --- a/public/plugin_assets/redmine_code_review/stylesheets/window_js/iefix/iepngfix.css +++ b/public/plugin_assets/redmine_code_review/stylesheets/window_js/iefix/iepngfix.css @@ -1,3 +1,3 @@ -/* PNG fix for all themes that uses PNG images on IE */ -td, div { behavior: url(../themes/iefix/iepngfix.htc) } - +/* PNG fix for all themes that uses PNG images on IE */ +td, div { behavior: url(../themes/iefix/iepngfix.htc) } + diff --git a/public/plugin_assets/redmine_code_review/stylesheets/window_js/iefix/iepngfix.htc b/public/plugin_assets/redmine_code_review/stylesheets/window_js/iefix/iepngfix.htc index a6c683b9f..9a13f32bf 100644 --- a/public/plugin_assets/redmine_code_review/stylesheets/window_js/iefix/iepngfix.htc +++ b/public/plugin_assets/redmine_code_review/stylesheets/window_js/iefix/iepngfix.htc @@ -1,54 +1,54 @@ - - - - + + + + \ No newline at end of file diff --git a/public/plugin_assets/redmine_code_review/stylesheets/window_js/lighting.css b/public/plugin_assets/redmine_code_review/stylesheets/window_js/lighting.css index 95ec287a9..0d955c3d7 100644 --- a/public/plugin_assets/redmine_code_review/stylesheets/window_js/lighting.css +++ b/public/plugin_assets/redmine_code_review/stylesheets/window_js/lighting.css @@ -1,960 +1,960 @@ -.overlay___invisible__ { - background-color: #666; - filter:alpha(opacity=0); - -moz-opacity: 0; - opacity: 0; -} - -.top_draggable, .bottom_draggable { - cursor:move; -} - -.status_bar { - font-size:12px; -} -.status_bar input{ - font-size:12px; -} - -.wired_frame { - display:block; - position:absolute; - border:1px #000 dashed; -} - - - -.overlay_bluelighting { - background-color:#FFF; - filter:alpha(opacity=60); - -moz-opacity:0.6; - opacity:0.6; -} - -.bluelighting_wired_frame { - background:#FFF; - filter:alpha(opacity=60); - -moz-opacity:0.6; - opacity:0.6; -} - -.bluelighting_nw { - background:transparent url(lighting/top-left-blue.png) no-repeat 0 0; - width:9px; - height:28px; -} - -.bluelighting_n { - background:transparent url(lighting/top-middle-blue.png) repeat-x 0 0; - height:28px; -} - -.bluelighting_ne { - background:transparent url(lighting/top-right-blue.png) no-repeat 0 0; - width:15px; - height:28px; -} - -.bluelighting_w { - background:transparent url(lighting/left-blue.png) repeat-y top left; - width:9px; -} - -.bluelighting_e { - background:transparent url(lighting/right-blue.png) repeat-y top right; - width:15px; -} - -.bluelighting_sw { - background:transparent url(lighting/bottom-left-blue.png) no-repeat 0 0; - width:9px; - height:15px; -} - -.bluelighting_s { - background:transparent url(lighting/bottom-middle-blue.png) repeat-x 0 0; - height:15px; -} - -.bluelighting_se, .bluelighting_sizer { - background:transparent url(lighting/bottom-right-blue.png) no-repeat 0 0; - width:15px; - height:15px; -} - -.bluelighting_sizer { - cursor:se-resize; -} - -.bluelighting_close { - width:15px; - height:9px; - background:transparent url(lighting/button-close-blue.png) no-repeat 0 0; - position:absolute; - top:11px; - right:10px; - cursor:pointer; - z-index:1000; -} - -.bluelighting_maximize { - width:15px; - height:9px; - background:transparent url(lighting/button-maximize-blue.png) no-repeat 0 0; - position:absolute; - top:11px; - right:25px; - cursor:pointer; - z-index:1000; -} - -.bluelighting_minimize { - width:15px; - height:9px; - background:transparent url(lighting/button-minimize-blue.png) no-repeat 0 0; - position:absolute; - top:11px; - right:40px; - cursor:pointer; - z-index:1000; -} - -.bluelighting_title { - float:left; - height:14px; - font-size:14px; - font-weight:bold; - font-family:Verdana, Arial, sans-serif; - text-align:center; - margin-top:2px; - width:100%; - color:#17385B; -} - -.bluelighting_content { - overflow:auto; - color:#000; - font-family:Verdana, Arial, sans-serif; - font-size:12px; - background:#BFDBFF; -} - -/* For alert/confirm dialog */ -.bluelighting_window { - border:1px solid #F00; - background:#FFF; - padding:20px; - margin-left:auto; - margin-right:auto; - width:400px; -} - -.bluelighting_message { - font-size:12px; - text-align:center; - width:100%; - padding-bottom:10px; -} - -.bluelighting_buttons { - text-align:center; - width:100%; -} - -.bluelighting_buttons input { - border:1px solid #999; - border-top-color:#CCC; - border-left-color:#CCC; - padding:2px; - background-color:#FFF; - color:#333; - background-image:url(lighting/background_buttons.gif); - background-repeat:repeat-x; - font-family:Verdana, Arial, sans-serif; - font-size:10px; - font-weight:bold; - text-align:center; -} - -.bluelighting_progress { - float:left; - margin:auto; - text-align:center; - width:100%; - height:16px; - background:transparent url('lighting/spinner.gif') no-repeat center center -} - -/* FOR IE */ -* html .bluelighting_nw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-left-blue.png", sizingMethod="crop"); -} - -* html .bluelighting_n { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-middle-blue.png", sizingMethod="scale"); -} - -* html .bluelighting_ne { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-right-blue.png", sizingMethod="crop"); -} - -* html .bluelighting_w { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/left-blue.png", sizingMethod="scale"); -} - -* html .bluelighting_e { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/right-blue.png", sizingMethod="scale"); -} - -* html .bluelighting_sw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-left-blue.png", sizingMethod="crop"); -} - -* html .bluelighting_s { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-middle-blue.png", sizingMethod="scale"); -} - -* html .bluelighting_se, * html .bluelighting_sizer { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-right-blue.png", sizingMethod="crop"); -} - -* html .bluelighting_close { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-close-blue.png", sizingMethod="crop"); -} - -* html .bluelighting_minimize { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-minimize-blue.png", sizingMethod="crop"); -} - -* html .bluelighting_maximize { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-maximize-blue.png", sizingMethod="crop"); -} - -* html .bluelighting_content { - background:#B8D7FF; -} - - - -.overlay_greylighting { - background-color:#FFF; - filter:alpha(opacity=60); - -moz-opacity:0.6; - opacity:0.6; -} - -.greylighting_wired_frame { - background:#FFF; - filter:alpha(opacity=60); - -moz-opacity:0.6; - opacity:0.6; -} - -.greylighting_nw { - background:transparent url(lighting/top-left-grey.png) no-repeat 0 0; - width:9px; - height:28px; -} - -.greylighting_n { - background:transparent url(lighting/top-middle-grey.png) repeat-x 0 0; - height:28px; -} - -.greylighting_ne { - background:transparent url(lighting/top-right-grey.png) no-repeat 0 0; - width:15px; - height:28px; -} - -.greylighting_w { - background:transparent url(lighting/left-grey.png) repeat-y top left; - width:9px; -} - -.greylighting_e { - background:transparent url(lighting/right-grey.png) repeat-y top right; - width:15px; -} - -.greylighting_sw { - background:transparent url(lighting/bottom-left-grey.png) no-repeat 0 0; - width:9px; - height:15px; -} - -.greylighting_s { - background:transparent url(lighting/bottom-middle-grey.png) repeat-x 0 0; - height:15px; -} - -.greylighting_se, .greylighting_sizer { - background:transparent url(lighting/bottom-right-grey.png) no-repeat 0 0; - width:15px; - height:15px; -} - -.greylighting_sizer { - cursor:se-resize; -} - -.greylighting_close { - width:15px; - height:9px; - background:transparent url(lighting/button-close-grey.png) no-repeat 0 0; - position:absolute; - top:11px; - right:10px; - cursor:pointer; - z-index:1000; -} - -.greylighting_maximize { - width:15px; - height:9px; - background:transparent url(lighting/button-maximize-grey.png) no-repeat 0 0; - position:absolute; - top:11px; - right:25px; - cursor:pointer; - z-index:1000; -} - -.greylighting_minimize { - width:15px; - height:9px; - background:transparent url(lighting/button-minimize-grey.png) no-repeat 0 0; - position:absolute; - top:11px; - right:40px; - cursor:pointer; - z-index:1000; -} - -.greylighting_title { - float:left; - height:14px; - font-size:14px; - font-weight:bold; - font-family:Verdana, Arial, sans-serif; - text-align:center; - margin-top:2px; - width:100%; - color:#525252; -} - -.greylighting_content { - overflow:auto; - color:#000; - font-family:Verdana, Arial, sans-serif; - font-size:12px; - background:#CDCDCD; -} - -/* For alert/confirm dialog */ -.greylighting_window { - border:1px solid #F00; - background:#FFF; - padding:20px; - margin-left:auto; - margin-right:auto; - width:400px; -} - -.greylighting_message { - font-size:12px; - text-align:center; - width:100%; - padding-bottom:10px; -} - -.greylighting_buttons { - text-align:center; - width:100%; -} - -.greylighting_buttons input { - border:1px solid #999; - border-top-color:#CCC; - border-left-color:#CCC; - padding:2px; - background-color:#FFF; - color:#333; - background-image:url(lighting/background_buttons.gif); - background-repeat:repeat-x; - font-family:Verdana, Arial, sans-serif; - font-size:10px; - font-weight:bold; - text-align:center; -} - -.greylighting_progress { - float:left; - margin:auto; - text-align:center; - width:100%; - height:16px; - background:transparent url('lighting/spinner.gif') no-repeat center center -} - -/* FOR IE */ -* html .greylighting_nw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-left-grey.png", sizingMethod="crop"); -} - -* html .greylighting_n { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-middle-grey.png", sizingMethod="scale"); -} - -* html .greylighting_ne { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-right-grey.png", sizingMethod="crop"); -} - -* html .greylighting_w { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/left-grey.png", sizingMethod="scale"); -} - -* html .greylighting_e { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/right-grey.png", sizingMethod="scale"); -} - -* html .greylighting_sw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-left-grey.png", sizingMethod="crop"); -} - -* html .greylighting_s { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-middle-grey.png", sizingMethod="scale"); -} - -* html greylighting_se, * html .greylighting_sizer { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-right-grey.png", sizingMethod="crop"); -} - -* html .greylighting_close { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-close-grey.png", sizingMethod="crop"); -} - -* html .greylighting_minimize { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-minimize-grey.png", sizingMethod="crop"); -} - -* html .greylighting_maximize { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-maximize-grey.png", sizingMethod="crop"); -} - -* html .greylighting_content { - background:#C7C7C7; -} - - - -.overlay_greenlighting { - background-color:#FFF; - filter:alpha(opacity=60); - -moz-opacity:0.6; - opacity:0.6; -} - -.greenlighting_wired_frame { - background:#FFF; - filter:alpha(opacity=60); - -moz-opacity:0.6; - opacity:0.6; -} - -.greenlighting_nw { - background:transparent url(lighting/top-left-green.png) no-repeat 0 0; - width:9px; - height:28px; -} - -.greenlighting_n { - background:transparent url(lighting/top-middle-green.png) repeat-x 0 0; - height:28px; -} - -.greenlighting_ne { - background:transparent url(lighting/top-right-green.png) no-repeat 0 0; - width:15px; - height:28px; -} - -.greenlighting_w { - background:transparent url(lighting/left-green.png) repeat-y top left; - width:9px; -} - -.greenlighting_e { - background:transparent url(lighting/right-green.png) repeat-y top right; - width:15px; -} - -.greenlighting_sw { - background:transparent url(lighting/bottom-left-green.png) no-repeat 0 0; - width:9px; - height:15px; -} - -.greenlighting_s { - background:transparent url(lighting/bottom-middle-green.png) repeat-x 0 0; - height:15px; -} - -.greenlighting_se, .greenlighting_sizer { - background:transparent url(lighting/bottom-right-green.png) no-repeat 0 0; - width:15px; - height:15px; -} - -.greenlighting_sizer { - cursor:se-resize; -} - -.greenlighting_close { - width:15px; - height:9px; - background:transparent url(lighting/button-close-green.png) no-repeat 0 0; - position:absolute; - top:11px; - right:10px; - cursor:pointer; - z-index:1000; -} - -.greenlighting_maximize { - width:15px; - height:9px; - background:transparent url(lighting/button-maximize-green.png) no-repeat 0 0; - position:absolute; - top:11px; - right:25px; - cursor:pointer; - z-index:1000; -} - -.greenlighting_minimize { - width:15px; - height:9px; - background:transparent url(lighting/button-minimize-green.png) no-repeat 0 0; - position:absolute; - top:11px; - right:40px; - cursor:pointer; - z-index:1000; -} - -.greenlighting_title { - float:left; - height:14px; - font-size:14px; - font-weight:bold; - font-family:Verdana, Arial, sans-serif; - text-align:center; - margin-top:2px; - width:100%; - color:#2A6002; -} - -.greenlighting_content { - overflow:auto; - color:#000; - font-family:Verdana, Arial, sans-serif; - font-size:12px; - background:#ACFCAF; -} - -/* For alert/confirm dialog */ -.greenlighting_window { - border:1px solid #F00; - background:#FFF; - padding:20px; - margin-left:auto; - margin-right:auto; - width:400px; -} - -.greenlighting_message { - font-size:12px; - text-align:center; - width:100%; - padding-bottom:10px; -} - -.greenlighting_buttons { - text-align:center; - width:100%; -} - -.greenlighting_buttons input { - border:1px solid #999; - border-top-color:#CCC; - border-left-color:#CCC; - padding:2px; - background-color:#FFF; - color:#333; - background-image:url(lighting/background_buttons.gif); - background-repeat:repeat-x; - font-family:Verdana, Arial, sans-serif; - font-size:10px; - font-weight:bold; - text-align:center; -} - -.greenlighting_progress { - float:left; - margin:auto; - text-align:center; - width:100%; - height:16px; - background:transparent url('lighting/spinner.gif') no-repeat center center -} - -/* FOR IE */ -* html .greenlighting_nw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-left-green.png", sizingMethod="crop"); -} - -* html .greenlighting_n { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-middle-green.png", sizingMethod="scale"); -} - -* html .greenlighting_ne { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-right-green.png", sizingMethod="crop"); -} - -* html .greenlighting_w { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/left-green.png", sizingMethod="scale"); -} - -* html .greenlighting_e { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/right-green.png", sizingMethod="scale"); -} - -* html .greenlighting_sw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-left-green.png", sizingMethod="crop"); -} - -* html .greenlighting_s { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-middle-green.png", sizingMethod="scale"); -} - -* html greenlighting_se, * html .greenlighting_sizer { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-right-green.png", sizingMethod="crop"); -} - -* html .greenlighting_close { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-close-green.png", sizingMethod="crop"); -} - -* html .greenlighting_minimize { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-minimize-green.png", sizingMethod="crop"); -} - -* html .greenlighting_maximize { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-maximize-green.png", sizingMethod="crop"); -} - -* html .greenlighting_content { - background:#A4FCA7; -} - - - -.overlay_darkbluelighting { - background-color:#FFF; - filter:alpha(opacity=60); - -moz-opacity:0.6; - opacity:0.6; -} - -.darkbluelighting_wired_frame { - background:#FFF; - filter:alpha(opacity=60); - -moz-opacity:0.6; - opacity:0.6; -} - -.darkbluelighting_nw { - background:transparent url(lighting/top-left-darkblue.png) no-repeat 0 0; - width:9px; - height:28px; -} - -.darkbluelighting_n { - background:transparent url(lighting/top-middle-darkblue.png) repeat-x 0 0; - height:28px; -} - -.darkbluelighting_ne { - background:transparent url(lighting/top-right-darkblue.png) no-repeat 0 0; - width:15px; - height:28px; -} - -.darkbluelighting_w { - background:transparent url(lighting/left-darkblue.png) repeat-y top left; - width:9px; -} - -.darkbluelighting_e { - background:transparent url(lighting/right-darkblue.png) repeat-y top right; - width:15px; -} - -.darkbluelighting_sw { - background:transparent url(lighting/bottom-left-darkblue.png) no-repeat 0 0; - width:9px; - height:15px; -} - -.darkbluelighting_s { - background:transparent url(lighting/bottom-middle-darkblue.png) repeat-x 0 0; - height:15px; -} - -.darkbluelighting_se, .darkbluelighting_sizer { - background:transparent url(lighting/bottom-right-darkblue.png) no-repeat 0 0; - width:15px; - height:15px; -} - -.darkbluelighting_sizer { - cursor:se-resize; -} - -.darkbluelighting_close { - width:15px; - height:9px; - background:transparent url(lighting/button-close-darkblue.png) no-repeat 0 0; - position:absolute; - top:11px; - right:10px; - cursor:pointer; - z-index:1000; -} - -.darkbluelighting_maximize { - width:15px; - height:9px; - background:transparent url(lighting/button-maximize-darkblue.png) no-repeat 0 0; - position:absolute; - top:11px; - right:25px; - cursor:pointer; - z-index:1000; -} - -.darkbluelighting_minimize { - width:15px; - height:9px; - background:transparent url(lighting/button-minimize-darkblue.png) no-repeat 0 0; - position:absolute; - top:11px; - right:40px; - cursor:pointer; - z-index:1000; -} - -.darkbluelighting_title { - float:left; - height:14px; - font-size:14px; - font-weight:bold; - font-family:Verdana, Arial, sans-serif; - text-align:center; - margin-top:2px; - width:100%; - color:#E4EFFD; -} - -.darkbluelighting_content { - overflow:auto; - color:#FFF; - font-family:Verdana, Arial, sans-serif; - font-size:12px; - background:#0413C0; -} - -/* For alert/confirm dialog */ -.darkbluelighting_window { - border:1px solid #F00; - background:#FFF; - padding:20px; - margin-left:auto; - margin-right:auto; - width:400px; -} - -.darkbluelighting_message { - font-size:12px; - text-align:center; - width:100%; - padding-bottom:10px; -} - -.darkbluelighting_buttons { - text-align:center; - width:100%; -} - -.darkbluelighting_buttons input { - border:1px solid #999; - border-top-color:#CCC; - border-left-color:#CCC; - padding:2px; - background-color:#FFF; - color:#333; - background-image:url(lighting/background_buttons.gif); - background-repeat:repeat-x; - font-family:Verdana, Arial, sans-serif; - font-size:10px; - font-weight:bold; - text-align:center; -} - -.darkbluelighting_progress { - float:left; - margin:auto; - text-align:center; - width:100%; - height:16px; - background:transparent url('lighting/spinner.gif') no-repeat center center -} - -/* FOR IE */ -* html .darkbluelighting_nw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-left-darkblue.png", sizingMethod="crop"); -} - -* html .darkbluelighting_n { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-middle-darkblue.png", sizingMethod="scale"); -} - -* html .darkbluelighting_ne { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-right-darkblue.png", sizingMethod="crop"); -} - -* html .darkbluelighting_w { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/left-darkblue.png", sizingMethod="scale"); -} - -* html .darkbluelighting_e { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/right-darkblue.png", sizingMethod="scale"); -} - -* html .darkbluelighting_sw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-left-darkblue.png", sizingMethod="crop"); -} - -* html .darkbluelighting_s { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-middle-darkblue.png", sizingMethod="scale"); -} - -* html darkbluelighting_se, * html .darkbluelighting_sizer { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-right-darkblue.png", sizingMethod="crop"); -} - -* html .darkbluelighting_close { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-close-darkblue.png", sizingMethod="crop"); -} - -* html .darkbluelighting_minimize { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-minimize-darkblue.png", sizingMethod="crop"); -} - -* html .darkbluelighting_maximize { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-maximize-darkblue.png", sizingMethod="crop"); -} - -* html .darkbluelighting_content { - background:#020EBA; -} - +.overlay___invisible__ { + background-color: #666; + filter:alpha(opacity=0); + -moz-opacity: 0; + opacity: 0; +} + +.top_draggable, .bottom_draggable { + cursor:move; +} + +.status_bar { + font-size:12px; +} +.status_bar input{ + font-size:12px; +} + +.wired_frame { + display:block; + position:absolute; + border:1px #000 dashed; +} + + + +.overlay_bluelighting { + background-color:#FFF; + filter:alpha(opacity=60); + -moz-opacity:0.6; + opacity:0.6; +} + +.bluelighting_wired_frame { + background:#FFF; + filter:alpha(opacity=60); + -moz-opacity:0.6; + opacity:0.6; +} + +.bluelighting_nw { + background:transparent url(lighting/top-left-blue.png) no-repeat 0 0; + width:9px; + height:28px; +} + +.bluelighting_n { + background:transparent url(lighting/top-middle-blue.png) repeat-x 0 0; + height:28px; +} + +.bluelighting_ne { + background:transparent url(lighting/top-right-blue.png) no-repeat 0 0; + width:15px; + height:28px; +} + +.bluelighting_w { + background:transparent url(lighting/left-blue.png) repeat-y top left; + width:9px; +} + +.bluelighting_e { + background:transparent url(lighting/right-blue.png) repeat-y top right; + width:15px; +} + +.bluelighting_sw { + background:transparent url(lighting/bottom-left-blue.png) no-repeat 0 0; + width:9px; + height:15px; +} + +.bluelighting_s { + background:transparent url(lighting/bottom-middle-blue.png) repeat-x 0 0; + height:15px; +} + +.bluelighting_se, .bluelighting_sizer { + background:transparent url(lighting/bottom-right-blue.png) no-repeat 0 0; + width:15px; + height:15px; +} + +.bluelighting_sizer { + cursor:se-resize; +} + +.bluelighting_close { + width:15px; + height:9px; + background:transparent url(lighting/button-close-blue.png) no-repeat 0 0; + position:absolute; + top:11px; + right:10px; + cursor:pointer; + z-index:1000; +} + +.bluelighting_maximize { + width:15px; + height:9px; + background:transparent url(lighting/button-maximize-blue.png) no-repeat 0 0; + position:absolute; + top:11px; + right:25px; + cursor:pointer; + z-index:1000; +} + +.bluelighting_minimize { + width:15px; + height:9px; + background:transparent url(lighting/button-minimize-blue.png) no-repeat 0 0; + position:absolute; + top:11px; + right:40px; + cursor:pointer; + z-index:1000; +} + +.bluelighting_title { + float:left; + height:14px; + font-size:14px; + font-weight:bold; + font-family:Verdana, Arial, sans-serif; + text-align:center; + margin-top:2px; + width:100%; + color:#17385B; +} + +.bluelighting_content { + overflow:auto; + color:#000; + font-family:Verdana, Arial, sans-serif; + font-size:12px; + background:#BFDBFF; +} + +/* For alert/confirm dialog */ +.bluelighting_window { + border:1px solid #F00; + background:#FFF; + padding:20px; + margin-left:auto; + margin-right:auto; + width:400px; +} + +.bluelighting_message { + font-size:12px; + text-align:center; + width:100%; + padding-bottom:10px; +} + +.bluelighting_buttons { + text-align:center; + width:100%; +} + +.bluelighting_buttons input { + border:1px solid #999; + border-top-color:#CCC; + border-left-color:#CCC; + padding:2px; + background-color:#FFF; + color:#333; + background-image:url(lighting/background_buttons.gif); + background-repeat:repeat-x; + font-family:Verdana, Arial, sans-serif; + font-size:10px; + font-weight:bold; + text-align:center; +} + +.bluelighting_progress { + float:left; + margin:auto; + text-align:center; + width:100%; + height:16px; + background:transparent url('lighting/spinner.gif') no-repeat center center +} + +/* FOR IE */ +* html .bluelighting_nw { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-left-blue.png", sizingMethod="crop"); +} + +* html .bluelighting_n { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-middle-blue.png", sizingMethod="scale"); +} + +* html .bluelighting_ne { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-right-blue.png", sizingMethod="crop"); +} + +* html .bluelighting_w { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/left-blue.png", sizingMethod="scale"); +} + +* html .bluelighting_e { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/right-blue.png", sizingMethod="scale"); +} + +* html .bluelighting_sw { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-left-blue.png", sizingMethod="crop"); +} + +* html .bluelighting_s { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-middle-blue.png", sizingMethod="scale"); +} + +* html .bluelighting_se, * html .bluelighting_sizer { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-right-blue.png", sizingMethod="crop"); +} + +* html .bluelighting_close { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-close-blue.png", sizingMethod="crop"); +} + +* html .bluelighting_minimize { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-minimize-blue.png", sizingMethod="crop"); +} + +* html .bluelighting_maximize { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-maximize-blue.png", sizingMethod="crop"); +} + +* html .bluelighting_content { + background:#B8D7FF; +} + + + +.overlay_greylighting { + background-color:#FFF; + filter:alpha(opacity=60); + -moz-opacity:0.6; + opacity:0.6; +} + +.greylighting_wired_frame { + background:#FFF; + filter:alpha(opacity=60); + -moz-opacity:0.6; + opacity:0.6; +} + +.greylighting_nw { + background:transparent url(lighting/top-left-grey.png) no-repeat 0 0; + width:9px; + height:28px; +} + +.greylighting_n { + background:transparent url(lighting/top-middle-grey.png) repeat-x 0 0; + height:28px; +} + +.greylighting_ne { + background:transparent url(lighting/top-right-grey.png) no-repeat 0 0; + width:15px; + height:28px; +} + +.greylighting_w { + background:transparent url(lighting/left-grey.png) repeat-y top left; + width:9px; +} + +.greylighting_e { + background:transparent url(lighting/right-grey.png) repeat-y top right; + width:15px; +} + +.greylighting_sw { + background:transparent url(lighting/bottom-left-grey.png) no-repeat 0 0; + width:9px; + height:15px; +} + +.greylighting_s { + background:transparent url(lighting/bottom-middle-grey.png) repeat-x 0 0; + height:15px; +} + +.greylighting_se, .greylighting_sizer { + background:transparent url(lighting/bottom-right-grey.png) no-repeat 0 0; + width:15px; + height:15px; +} + +.greylighting_sizer { + cursor:se-resize; +} + +.greylighting_close { + width:15px; + height:9px; + background:transparent url(lighting/button-close-grey.png) no-repeat 0 0; + position:absolute; + top:11px; + right:10px; + cursor:pointer; + z-index:1000; +} + +.greylighting_maximize { + width:15px; + height:9px; + background:transparent url(lighting/button-maximize-grey.png) no-repeat 0 0; + position:absolute; + top:11px; + right:25px; + cursor:pointer; + z-index:1000; +} + +.greylighting_minimize { + width:15px; + height:9px; + background:transparent url(lighting/button-minimize-grey.png) no-repeat 0 0; + position:absolute; + top:11px; + right:40px; + cursor:pointer; + z-index:1000; +} + +.greylighting_title { + float:left; + height:14px; + font-size:14px; + font-weight:bold; + font-family:Verdana, Arial, sans-serif; + text-align:center; + margin-top:2px; + width:100%; + color:#525252; +} + +.greylighting_content { + overflow:auto; + color:#000; + font-family:Verdana, Arial, sans-serif; + font-size:12px; + background:#CDCDCD; +} + +/* For alert/confirm dialog */ +.greylighting_window { + border:1px solid #F00; + background:#FFF; + padding:20px; + margin-left:auto; + margin-right:auto; + width:400px; +} + +.greylighting_message { + font-size:12px; + text-align:center; + width:100%; + padding-bottom:10px; +} + +.greylighting_buttons { + text-align:center; + width:100%; +} + +.greylighting_buttons input { + border:1px solid #999; + border-top-color:#CCC; + border-left-color:#CCC; + padding:2px; + background-color:#FFF; + color:#333; + background-image:url(lighting/background_buttons.gif); + background-repeat:repeat-x; + font-family:Verdana, Arial, sans-serif; + font-size:10px; + font-weight:bold; + text-align:center; +} + +.greylighting_progress { + float:left; + margin:auto; + text-align:center; + width:100%; + height:16px; + background:transparent url('lighting/spinner.gif') no-repeat center center +} + +/* FOR IE */ +* html .greylighting_nw { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-left-grey.png", sizingMethod="crop"); +} + +* html .greylighting_n { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-middle-grey.png", sizingMethod="scale"); +} + +* html .greylighting_ne { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-right-grey.png", sizingMethod="crop"); +} + +* html .greylighting_w { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/left-grey.png", sizingMethod="scale"); +} + +* html .greylighting_e { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/right-grey.png", sizingMethod="scale"); +} + +* html .greylighting_sw { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-left-grey.png", sizingMethod="crop"); +} + +* html .greylighting_s { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-middle-grey.png", sizingMethod="scale"); +} + +* html greylighting_se, * html .greylighting_sizer { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-right-grey.png", sizingMethod="crop"); +} + +* html .greylighting_close { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-close-grey.png", sizingMethod="crop"); +} + +* html .greylighting_minimize { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-minimize-grey.png", sizingMethod="crop"); +} + +* html .greylighting_maximize { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-maximize-grey.png", sizingMethod="crop"); +} + +* html .greylighting_content { + background:#C7C7C7; +} + + + +.overlay_greenlighting { + background-color:#FFF; + filter:alpha(opacity=60); + -moz-opacity:0.6; + opacity:0.6; +} + +.greenlighting_wired_frame { + background:#FFF; + filter:alpha(opacity=60); + -moz-opacity:0.6; + opacity:0.6; +} + +.greenlighting_nw { + background:transparent url(lighting/top-left-green.png) no-repeat 0 0; + width:9px; + height:28px; +} + +.greenlighting_n { + background:transparent url(lighting/top-middle-green.png) repeat-x 0 0; + height:28px; +} + +.greenlighting_ne { + background:transparent url(lighting/top-right-green.png) no-repeat 0 0; + width:15px; + height:28px; +} + +.greenlighting_w { + background:transparent url(lighting/left-green.png) repeat-y top left; + width:9px; +} + +.greenlighting_e { + background:transparent url(lighting/right-green.png) repeat-y top right; + width:15px; +} + +.greenlighting_sw { + background:transparent url(lighting/bottom-left-green.png) no-repeat 0 0; + width:9px; + height:15px; +} + +.greenlighting_s { + background:transparent url(lighting/bottom-middle-green.png) repeat-x 0 0; + height:15px; +} + +.greenlighting_se, .greenlighting_sizer { + background:transparent url(lighting/bottom-right-green.png) no-repeat 0 0; + width:15px; + height:15px; +} + +.greenlighting_sizer { + cursor:se-resize; +} + +.greenlighting_close { + width:15px; + height:9px; + background:transparent url(lighting/button-close-green.png) no-repeat 0 0; + position:absolute; + top:11px; + right:10px; + cursor:pointer; + z-index:1000; +} + +.greenlighting_maximize { + width:15px; + height:9px; + background:transparent url(lighting/button-maximize-green.png) no-repeat 0 0; + position:absolute; + top:11px; + right:25px; + cursor:pointer; + z-index:1000; +} + +.greenlighting_minimize { + width:15px; + height:9px; + background:transparent url(lighting/button-minimize-green.png) no-repeat 0 0; + position:absolute; + top:11px; + right:40px; + cursor:pointer; + z-index:1000; +} + +.greenlighting_title { + float:left; + height:14px; + font-size:14px; + font-weight:bold; + font-family:Verdana, Arial, sans-serif; + text-align:center; + margin-top:2px; + width:100%; + color:#2A6002; +} + +.greenlighting_content { + overflow:auto; + color:#000; + font-family:Verdana, Arial, sans-serif; + font-size:12px; + background:#ACFCAF; +} + +/* For alert/confirm dialog */ +.greenlighting_window { + border:1px solid #F00; + background:#FFF; + padding:20px; + margin-left:auto; + margin-right:auto; + width:400px; +} + +.greenlighting_message { + font-size:12px; + text-align:center; + width:100%; + padding-bottom:10px; +} + +.greenlighting_buttons { + text-align:center; + width:100%; +} + +.greenlighting_buttons input { + border:1px solid #999; + border-top-color:#CCC; + border-left-color:#CCC; + padding:2px; + background-color:#FFF; + color:#333; + background-image:url(lighting/background_buttons.gif); + background-repeat:repeat-x; + font-family:Verdana, Arial, sans-serif; + font-size:10px; + font-weight:bold; + text-align:center; +} + +.greenlighting_progress { + float:left; + margin:auto; + text-align:center; + width:100%; + height:16px; + background:transparent url('lighting/spinner.gif') no-repeat center center +} + +/* FOR IE */ +* html .greenlighting_nw { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-left-green.png", sizingMethod="crop"); +} + +* html .greenlighting_n { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-middle-green.png", sizingMethod="scale"); +} + +* html .greenlighting_ne { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-right-green.png", sizingMethod="crop"); +} + +* html .greenlighting_w { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/left-green.png", sizingMethod="scale"); +} + +* html .greenlighting_e { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/right-green.png", sizingMethod="scale"); +} + +* html .greenlighting_sw { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-left-green.png", sizingMethod="crop"); +} + +* html .greenlighting_s { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-middle-green.png", sizingMethod="scale"); +} + +* html greenlighting_se, * html .greenlighting_sizer { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-right-green.png", sizingMethod="crop"); +} + +* html .greenlighting_close { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-close-green.png", sizingMethod="crop"); +} + +* html .greenlighting_minimize { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-minimize-green.png", sizingMethod="crop"); +} + +* html .greenlighting_maximize { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-maximize-green.png", sizingMethod="crop"); +} + +* html .greenlighting_content { + background:#A4FCA7; +} + + + +.overlay_darkbluelighting { + background-color:#FFF; + filter:alpha(opacity=60); + -moz-opacity:0.6; + opacity:0.6; +} + +.darkbluelighting_wired_frame { + background:#FFF; + filter:alpha(opacity=60); + -moz-opacity:0.6; + opacity:0.6; +} + +.darkbluelighting_nw { + background:transparent url(lighting/top-left-darkblue.png) no-repeat 0 0; + width:9px; + height:28px; +} + +.darkbluelighting_n { + background:transparent url(lighting/top-middle-darkblue.png) repeat-x 0 0; + height:28px; +} + +.darkbluelighting_ne { + background:transparent url(lighting/top-right-darkblue.png) no-repeat 0 0; + width:15px; + height:28px; +} + +.darkbluelighting_w { + background:transparent url(lighting/left-darkblue.png) repeat-y top left; + width:9px; +} + +.darkbluelighting_e { + background:transparent url(lighting/right-darkblue.png) repeat-y top right; + width:15px; +} + +.darkbluelighting_sw { + background:transparent url(lighting/bottom-left-darkblue.png) no-repeat 0 0; + width:9px; + height:15px; +} + +.darkbluelighting_s { + background:transparent url(lighting/bottom-middle-darkblue.png) repeat-x 0 0; + height:15px; +} + +.darkbluelighting_se, .darkbluelighting_sizer { + background:transparent url(lighting/bottom-right-darkblue.png) no-repeat 0 0; + width:15px; + height:15px; +} + +.darkbluelighting_sizer { + cursor:se-resize; +} + +.darkbluelighting_close { + width:15px; + height:9px; + background:transparent url(lighting/button-close-darkblue.png) no-repeat 0 0; + position:absolute; + top:11px; + right:10px; + cursor:pointer; + z-index:1000; +} + +.darkbluelighting_maximize { + width:15px; + height:9px; + background:transparent url(lighting/button-maximize-darkblue.png) no-repeat 0 0; + position:absolute; + top:11px; + right:25px; + cursor:pointer; + z-index:1000; +} + +.darkbluelighting_minimize { + width:15px; + height:9px; + background:transparent url(lighting/button-minimize-darkblue.png) no-repeat 0 0; + position:absolute; + top:11px; + right:40px; + cursor:pointer; + z-index:1000; +} + +.darkbluelighting_title { + float:left; + height:14px; + font-size:14px; + font-weight:bold; + font-family:Verdana, Arial, sans-serif; + text-align:center; + margin-top:2px; + width:100%; + color:#E4EFFD; +} + +.darkbluelighting_content { + overflow:auto; + color:#FFF; + font-family:Verdana, Arial, sans-serif; + font-size:12px; + background:#0413C0; +} + +/* For alert/confirm dialog */ +.darkbluelighting_window { + border:1px solid #F00; + background:#FFF; + padding:20px; + margin-left:auto; + margin-right:auto; + width:400px; +} + +.darkbluelighting_message { + font-size:12px; + text-align:center; + width:100%; + padding-bottom:10px; +} + +.darkbluelighting_buttons { + text-align:center; + width:100%; +} + +.darkbluelighting_buttons input { + border:1px solid #999; + border-top-color:#CCC; + border-left-color:#CCC; + padding:2px; + background-color:#FFF; + color:#333; + background-image:url(lighting/background_buttons.gif); + background-repeat:repeat-x; + font-family:Verdana, Arial, sans-serif; + font-size:10px; + font-weight:bold; + text-align:center; +} + +.darkbluelighting_progress { + float:left; + margin:auto; + text-align:center; + width:100%; + height:16px; + background:transparent url('lighting/spinner.gif') no-repeat center center +} + +/* FOR IE */ +* html .darkbluelighting_nw { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-left-darkblue.png", sizingMethod="crop"); +} + +* html .darkbluelighting_n { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-middle-darkblue.png", sizingMethod="scale"); +} + +* html .darkbluelighting_ne { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-right-darkblue.png", sizingMethod="crop"); +} + +* html .darkbluelighting_w { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/left-darkblue.png", sizingMethod="scale"); +} + +* html .darkbluelighting_e { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/right-darkblue.png", sizingMethod="scale"); +} + +* html .darkbluelighting_sw { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-left-darkblue.png", sizingMethod="crop"); +} + +* html .darkbluelighting_s { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-middle-darkblue.png", sizingMethod="scale"); +} + +* html darkbluelighting_se, * html .darkbluelighting_sizer { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-right-darkblue.png", sizingMethod="crop"); +} + +* html .darkbluelighting_close { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-close-darkblue.png", sizingMethod="crop"); +} + +* html .darkbluelighting_minimize { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-minimize-darkblue.png", sizingMethod="crop"); +} + +* html .darkbluelighting_maximize { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-maximize-darkblue.png", sizingMethod="crop"); +} + +* html .darkbluelighting_content { + background:#020EBA; +} + diff --git a/public/plugin_assets/redmine_code_review/stylesheets/window_js/lighting/pngbehavior.htc b/public/plugin_assets/redmine_code_review/stylesheets/window_js/lighting/pngbehavior.htc index 36ea182e7..92248c665 100644 --- a/public/plugin_assets/redmine_code_review/stylesheets/window_js/lighting/pngbehavior.htc +++ b/public/plugin_assets/redmine_code_review/stylesheets/window_js/lighting/pngbehavior.htc @@ -1,67 +1,67 @@ - - - -