<%= image_tag '/images/transparent.png', size: "75x75" %>
-
+
-
<%= l(:label_welcome_trustie) %><%= l(:label_welcome_trustie_contest) %> , <%= l(:label_welcome_trustie_contest_description) %>
diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb
index eef2401f8..8b1a9d9ee 100644
--- a/app/views/welcome/course.html.erb
+++ b/app/views/welcome/course.html.erb
@@ -5,8 +5,22 @@
$(function(){
$("#main").find("a").attr("target", "_blank");
+ setCss();
});
+ //设置div居中
+ function setCss()
+ {
+ var mainBar = $('#main-content-bar')[0];
+ var topHeight = mainBar.offsetHeight;
+ var welcomeLeft = $('#welcome_left')[0];
+ var leftHeight = welcomeLeft.offsetHeight;
+ var searchbar = $('#search-bar')[0];
+ var searchHeight = searchbar.offsetHeight;
+ welcomeLeft.style.marginTop = (topHeight - leftHeight)/2 + "px";
+ searchbar.style.marginTop = (topHeight - searchHeight)/2 + "px";
+ //alert((topHeight - leftHeight)/2 );
+ }
// 给主页用户弹新页面
$(document).ready(function($) {
$("#loggedas").find("a").attr("target", "_blank");
@@ -19,13 +33,12 @@
<%= image_tag '/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" %>
微信扫码
+
<%= image_tag(@logoLink, size:'75x75') %>
-
-
+
+
<% if params[:school_id].nil? and User.current.user_extensions.school.nil? %>
<% else%>
<% if params[:school_id] == "0" %>
@@ -48,7 +61,7 @@
<% end %>
<% end %>
-
+
-
<%= render :partial => "search_project", :locals => {:project_type => Project::ProjectType_course}%>
diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb
index 0a69b1f78..bb2d6cd36 100644
--- a/app/views/welcome/index.html.erb
+++ b/app/views/welcome/index.html.erb
@@ -4,8 +4,21 @@
$(function(){
$("#main").find("a").attr("target", "_blank");
+ setCss();
});
-
+ //设置div居中
+ function setCss()
+ {
+ var mainBar = $('#main-content-bar')[0];
+ var topHeight = mainBar.offsetHeight;
+ var welcomeLeft = $('#welcome_left')[0];
+ var leftHeight = welcomeLeft.offsetHeight;
+ var searchbar = $('#search-bar')[0];
+ var searchHeight = searchbar.offsetHeight;
+ welcomeLeft.style.marginTop = (topHeight - leftHeight)/2 + "px";
+ searchbar.style.marginTop = (topHeight - searchHeight)/2 + "px";
+ //alert((topHeight - leftHeight)/2 );
+ }
// 给主页用户弹新页面
$(document).ready(function($) {
$("#loggedas").find("a").attr("target", "_blank");
@@ -18,14 +31,14 @@
<%= link_to image_tag('/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" ), home_path %>
微信扫码
+
<%= image_tag '/images/transparent.png', size: "75x75" %>
-
+
<%= l(:label_welcome_trustie) %><%= l(:label_welcome_trustie_project) %> , <%= l(:label_welcome_trustie_project_description) %>
-
+
<%= render :partial => "search_project", :locals => {:project_type => 0}%>
diff --git a/config/routes.rb b/config/routes.rb
index ea1b70e35..fe8be3ee8 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -40,6 +40,7 @@ RedmineApp::Application.routes.draw do
end
mount SeemsRateable::Engine => '/rateable', :as => :rateable
+
namespace :zipdown do
match 'assort'
end
@@ -461,9 +462,11 @@ RedmineApp::Application.routes.draw do
get 'attachments/autocomplete'
match 'attachments/autocomplete', :to => 'attachments#autocomplete', via: [:post]
post 'attachments/relationfile', to: 'attachments#add_exist_file_to_project', as: 'attach_relation'
+ get 'attachments/renderTag/:attchmentId', :to => 'attachments#renderTag', :attchmentId => /\d+/
resources :attachments, :only => [:show, :destroy] do
collection do
match "updateType" , via: [:get, :post]
+ match "renderTag" , via: [:get, :post]
end
end
diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js
index 3d1520f84..663183b9a 100644
--- a/public/javascripts/attachments.js
+++ b/public/javascripts/attachments.js
@@ -1,6 +1,17 @@
/* Redmine - project management software
Copyright (C) 2006-2013 Jean-Philippe Lang */
+function postUpMsg(attachmentId)
+{
+ $.ajax({
+ url: '/attachments/renderTag',
+ type: "GET",
+ data: {
+ attachmentId: attachmentId
+ }
+
+ })
+}
function addFile(inputEl, file, eagerUpload) {
if ($('#attachments_fields').children().length < 10) {
@@ -12,14 +23,15 @@ function addFile(inputEl, file, eagerUpload) {
fileSpan.append(
$('', { 'type': 'text', 'class': 'filename readonly', 'name': 'attachments[' + attachmentId + '][filename]', 'readonly': 'readonly'} ).val(file.name),
$('', { 'type': 'text', 'class': 'description', 'name': 'attachments[' + attachmentId + '][description]', 'maxlength': 255, 'placeholder': $(inputEl).data('description-placeholder') } ).toggle(!eagerUpload),
- $(' ').attr({ 'href': "#", 'class': 'remove-upload', 'data-confirm' : "您确定要删除吗?" }).click(removeFile).toggle(!eagerUpload)
+ $(' ').attr({ 'href': "#", 'class': 'remove-upload', 'data-confirm' : "您确定要删除吗?" }).click(removeFile).toggle(!eagerUpload),
+ $('', { 'class': 'div_attachments', 'name': 'div_'+'attachments_' + attachmentId} )
).appendTo('#attachments_fields');
-
- if(eagerUpload) {
- ajaxUpload(file, attachmentId, fileSpan, inputEl);
- }
- return attachmentId;
+ if(eagerUpload) {
+ ajaxUpload(file, attachmentId, fileSpan, inputEl);
+
+ }
+ return attachmentId;
}
return null;
}
@@ -66,7 +78,7 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
//gcm files count and add delete_all link
- var count=$('#attachments_fields>span').length;
+ var count=$('#attachments_fields>span').length;
$('#upload_file_count').html("已上传"+""+count+""+"个文件");
if(count>=1){
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index d786101b1..1a1c1b2ea 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -1829,7 +1829,7 @@ fieldset#notified_events .parent { padding-left: 20px; }
span.required {color: #bb0000;}
.summary {font-style: italic;}
-#attachments_fields input.description {margin-left:4px; width:340px; }
+#attachments_fields input.description {margin-left:4px; width:100px; }
#attachments_fields span {display:block; white-space:nowrap; font-family:'微软雅黑';}
#attachments_fields input.filename {border:0; height:1.8em; width:150px; color:#555; background-color:inherit; background:url(../images/attachment.png) no-repeat 1px 50%; padding-left:18px;}/*Modified by young*/
#attachments_fields .ajax-waiting input.filename {background:url(../images/hourglass.png) no-repeat 0px 50%;}
diff --git a/public/stylesheets/welcome.css b/public/stylesheets/welcome.css
index f7756e5b8..4393c1dbc 100644
--- a/public/stylesheets/welcome.css
+++ b/public/stylesheets/welcome.css
@@ -312,11 +312,11 @@ a.attachments_list_color {
}
.main-content-bar{
margin: 0;
- margin-top: 35px;
+ margin-top: 12px;
padding: 0;
- margin-bottom: 35px;
- width: 100%;
- height: auto;
+ margin-bottom: 2px;
+ width: 100%;
+ height: 78;
}
.weixin-content{