新版项目界面(部分未完成,先合并)

1、项目框架整理
2、各页面样式
dev_repository_hjq
huang 10 years ago
parent 5954ced7a7
commit df43274565

@ -1921,6 +1921,8 @@ module ApplicationHelper
forum_link = link_to l(:label_forum_all), {:controller => "forums", :action => "index"} forum_link = link_to l(:label_forum_all), {:controller => "forums", :action => "index"}
stores_link = link_to l(:label_stores_index), {:controller => 'stores', :action=> 'index'} stores_link = link_to l(:label_stores_index), {:controller => 'stores', :action=> 'index'}
school_all_school_link = link_to l(:label_school_all), {:controller => 'school', :action => 'index'} school_all_school_link = link_to l(:label_school_all), {:controller => 'school', :action => 'index'}
project_new_link = link_to l(:label_project_new), {:controller => 'projects', :action => 'new', :host => Setting.project_domain}
# project_mine_link = link_to l(:label_my_project), {:controller => 'users', :action => 'user_projects', :host => Setting.project_domain}
#@nav_dispaly_project_label #@nav_dispaly_project_label
nav_list = Array.new nav_list = Array.new
@ -1933,6 +1935,8 @@ module ApplicationHelper
nav_list.push(main_contest_link) if @nav_dispaly_main_contest_label && @show_contest == 1 nav_list.push(main_contest_link) if @nav_dispaly_main_contest_label && @show_contest == 1
nav_list.push(courses_link) if @nav_dispaly_course_label && @show_course == 1 nav_list.push(courses_link) if @nav_dispaly_course_label && @show_course == 1
nav_list.push(project_new_link) if @nav_dispaly_project_label
# nav_list.push(project_mine_link) if @nav_dispaly_main_project_label
# nav_list.push(projects_link) if @nav_dispaly_project_label # nav_list.push(projects_link) if @nav_dispaly_project_label
#nav_list.push(users_link) if @nav_dispaly_user_label #nav_list.push(users_link) if @nav_dispaly_user_label
# nav_list.push(contest_link) if @nav_dispaly_contest_label && @show_contest == 1 # nav_list.push(contest_link) if @nav_dispaly_contest_label && @show_contest == 1

@ -35,6 +35,16 @@ module AttachmentsHelper
end end
end end
def link_to_attachment_project(container, options = {})
options.assert_valid_keys(:author, :thumbnails)
if container.attachments.any?
options = {:deletable => container.attachments_deletable?, :author => true}.merge(options)
render :partial => 'attachments/project_file_links',
:locals => {:attachments => container.attachments, :options => options, :thumbnails => (options[:thumbnails] && Setting.thumbnails_enabled?)}
end
end
def link_to_attachments_course(container, options = {}) def link_to_attachments_course(container, options = {})
options.assert_valid_keys(:author, :thumbnails) options.assert_valid_keys(:author, :thumbnails)

@ -304,7 +304,7 @@ module WatchersHelper
def exit_project_link(project) def exit_project_link(project)
link_to(l(:label_exit_project),exit_cur_project_path(project.id), link_to(l(:label_exit_project),exit_cur_project_path(project.id),
:remote => true, :confirm => l(:lable_sure_exit_project), :remote => true, :confirm => l(:lable_sure_exit_project),
:style => "color: #fff; display:block;font-size:12px; padding: 0px 5px; margin-right: 10px; height: 20px; line-height: 22px; background: none repeat scroll 0% 0% #64BDD9; TES;padding-top:1px;" ) :class => "pr_join_a" )
end end
#项目关注、取消关注 #项目关注、取消关注
@ -321,7 +321,7 @@ module WatchersHelper
:object_id => (objects.size == 1 ? objects.first.id : objects.map(&:id).sort)) :object_id => (objects.size == 1 ? objects.first.id : objects.map(&:id).sort))
method = watched ? 'delete' : 'post' method = watched ? 'delete' : 'post'
link_to text, url, :remote => true, :method => method, link_to text, url, :remote => true, :method => method,
:class => "project_watch_new" ,:id=>id :class => "pr_join_a" ,:id=>id
end end
#申请加入项目 #申请加入项目
@ -339,7 +339,7 @@ module WatchersHelper
:user_id => user.id, :user_id => user.id,
:project_id => project.id) :project_id => project.id)
method = applied ? 'delete' : 'post' method = applied ? 'delete' : 'post'
link_to text, url, :remote => true, :method => method , :class => "project_watch_new",:id => id link_to text, url, :remote => true, :method => method , :class => "pr_join_a",:id => id
end end
end end

@ -0,0 +1,67 @@
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
<% if defined?(container) && container && container.saved_attachments %>
<% if isReply %>
<% container.saved_attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>" class="attachment">
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") +
link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %>
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false, :class => 'is_public')%>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span>
<% end %>
<% else %>
<% container.attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>" class="attachment">
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") +
link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %>
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false, :class => 'is_public')%>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span>
<% end %>
<% end %>
<% end %>
</span></br>
<script type='text/javascript'>
// function CompatibleSend()
// {
// var obj=document.getElementById("_file");
// var file= $(obj).clone();
// file.click();
// }
</script>
<span class="add_attachment">
<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %>
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->
<%= button_tag "浏览", :type=>"button", :onclick=>"_file.click()",:class =>"sub_btn",:style => ie8? ? 'display:none' : '' %>
<%= file_field_tag 'attachments[dummy][file]',
:id => '_file',
:class => 'file_selector',
:multiple => true,
:onchange => 'addInputFiles(this);',
:style => 'display:none',
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:upload_path => uploads_path(:format => 'js'),
:description_placeholder => l(:label_optional_description),
:field_is_public => l(:field_is_public),
:are_you_sure => l(:text_are_you_sure),
:file_count => l(:label_file_count),
:delete_all_files => l(:text_are_you_sure_all)
} %>
<span id="upload_file_count" :class="c_grey"><%= l(:label_no_file_uploaded)%></span>
(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
</span>
<% content_for :header_tags do %>
<%= javascript_include_tag 'attachments' %>
<% end %>

@ -0,0 +1,72 @@
<div class="attachments" style="font-weight:normal;">
<% is_float ||= false %>
<% for attachment in attachments %>
<p style="width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<%if is_float%>
<div style="max-width:55%;white-space: nowrap; overflow: hidden; text-overflow: ellipsis;float: left;">
<% end%>
<span title="<%= attachment.filename%>" id = "attachment_">
<% if options[:length] %>
<%= link_to_short_attachment attachment, :class => ' link_file_board', :download => true,:length => options[:length] -%>
<% else %>
<%= link_to_short_attachment attachment, :class => ' link_file_board', :download => true -%>
<% end %>
</span>
<%if is_float%>
</div>
<% end%>
<% if attachment.is_text? %>
<%= link_to image_tag('magnifier.png'),
:controller => 'attachments',
:action => 'show',
:id => attachment,
:filename => attachment.filename%>
<% end %>
<span title="<%= attachment.description%>">
<%= h(truncate(" - #{attachment.description}", length: options[:length] ? options[:length]:15, omission: '...')) unless attachment.description.blank? %>
</span>
<span class="size">(
<%= number_to_human_size attachment.filesize %>)
</span>
<% if options[:deletable] %>
<% if attachment.container_type == 'HomeworkAttach' %>
<%= link_to image_tag('delete.png'), {:controller => 'attachments', :action => 'delete_homework', :id => attachment.id},
:data => {:confirm => l(:text_are_you_sure)},
:method => :delete,
:class => 'delete delete-homework-icon',
:remote => true,
:title => l(:button_delete) %>
<% else %>
<%= link_to image_tag('delete.png'), attachment_path(attachment),
:data => {:confirm => l(:text_are_you_sure)},
:method => :delete,
:class => 'delete',
#:remote => true,
#:id => "attachments_" + attachment.id.to_s,
:title => l(:button_delete) %>
<% end %>
<% end %>
<% if options[:wrap] %>
<br/>
&nbsp;
<% end %>
<% if options[:author] %>
<span class="author" title="<%= attachment.author%>">
<%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author) %>,
<%= format_time(attachment.created_on) %>
</span>
<% end %>
</p>
<% end %>
<% if defined?(thumbnails) && thumbnails %>
<% images = attachments.select(&:thumbnailable?) %>
<% if images.any? %>
<div class="thumbnails">
<% images.each do |attachment| %>
<div><%= thumbnail_tag(attachment) %></div>
<% end %>
</div>
<% end %>
<% end %>
</div>

@ -1,4 +1,4 @@
<script type="text/javascript"> <script type="text/javascript" xmlns="http://www.w3.org/1999/html">
function submitProjectBoard() function submitProjectBoard()
{ {
if(regexSubject()&&regexContent()) if(regexSubject()&&regexContent())
@ -37,7 +37,6 @@
<% end %> <% end %>
<!-- 内容显示部分 --> <!-- 内容显示部分 -->
<div class="project_right">
<div class="project_r_h"> <div class="project_r_h">
<h2 class="project_h2"><%= h @board.name %></h2> <h2 class="project_h2"><%= h @board.name %></h2>
</div> </div>
@ -45,7 +44,7 @@
<div class="fl">项目讨论区共有<span><%= @topic_count %></span>个帖子 </div> <div class="fl">项目讨论区共有<span><%= @topic_count %></span>个帖子 </div>
<% if @project.enabled_modules.where("name = 'boards'").count > 0 && User.current.member_of?(@project) %> <% if @project.enabled_modules.where("name = 'boards'").count > 0 && User.current.member_of?(@project) %>
<span><%= link_to l(:label_message_new), new_board_message_path(@board), <span><%= link_to l(:label_message_new), new_board_message_path(@board),
:class => 'problem_new_btn fl', :class => 'problem_new_btn fl c_dorange',
:onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.logged? %></span> :onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.logged? %></span>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
@ -54,34 +53,26 @@
<% if @topics.any? %> <% if @topics.any? %>
<% @topics.each do |topic| %> <% @topics.each do |topic| %>
<div class="problem_main"> <div class="problem_main">
<a> <%= link_to image_tag(url_to_avatar(topic.author), :width=>"32",:height=>"32"), user_path(topic.author),:class => 'problem_pic talk_pic fl' %>
<%= link_to image_tag(url_to_avatar(topic.author), :class => "problem_pic talk_pic fl"), user_path(topic.author) %>
</a>
<div class="talk_txt fl"> <div class="talk_txt fl">
<div> <%= link_to h(topic.subject), board_message_path(@board, topic), title:topic.subject.to_s, :class =>"problem_tit fl" %>
<span><%= link_to h(topic.subject), board_message_path(@board, topic), title:topic.subject.to_s, :class =>"problem_tit fl" %></span>
<% if topic.sticky? %> <% if topic.sticky? %>
<span class="talk_up">置顶</span> <span class="talk_up fl c_red">置顶</span>
<% end %> <% end %>
<br/>
<p>由<%= link_to topic.author, user_path(topic.author), :class =>"problem_name c_orange" %>添加于<%= format_time topic.created_on %></p>
</div> </div>
<div class="problem_line"> <%=link_to (l(:label_reply) + topic.replies_count.to_s), board_message_path(@board, topic),:class => "talk_btn fr c_white" %>
<span>由<%= link_to topic.author, user_path(topic.author), :class =>"problem_name" %></span>
<span>添加于<%= format_time topic.created_on %></span>
</div>
</div>
<span class="talk_btn fr">回复<%= link_to (topic.replies_count), board_message_path(@board, topic), :style =>"color:#fff;" %></span>
<div class="cl"></div> <div class="cl"></div>
</div><!--讨论主类容 end--> </div><!--讨论主类容 end-->
<% end %> <% end %>
<ul class="wlist">
<%= pagination_links_full @topic_pages, @topic_count, :per_page_links => false, :remote => false, :flag => true %>
</ul>
<% else %> <% else %>
<p class="nodata"><%= l(:label_no_data) %></p> <p class="nodata"><%= l(:label_no_data) %></p>
<% end %> <% end %>
<ul class="wlist">
<%= pagination_links_full @topic_pages, @topic_count, :per_page_links => false, :remote => false, :flag => true %>
</ul>
<!--讨论主类容 end--> <!--讨论主类容 end-->
<div class="cl"></div>
</div>
<% other_formats_links do |f| %> <% other_formats_links do |f| %>
<%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %> <%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>

@ -1,69 +1,28 @@
<div class="autoscroll">
<ul>
<% issue_list(issues) do |issue, level| -%> <% issue_list(issues) do |issue, level| -%>
<% if @query.grouped? && (group = @query.group_by_column.value(issue)) != previous_group %> <% if @query.grouped? && (group = @query.group_by_column.value(issue)) != previous_group %>
<% reset_cycle %> <% reset_cycle %>
<% previous_group = group %> <% previous_group = group %>
<% end %> <% end %>
<div style=""> <!-- CONTENT LIST -->
<li id="issue-<%= issue.id %>" class="hascontextmenu-1 <%= issue.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>"> <div class="problem_main">
<!--< id="issue-<%#= issue.id %>" class="hascontextmenu-1 <%#= issue.css_classes %> <%#= level > 0 ? "idnt idnt-#{level}" : nil %>" >-->
<% column_content = ( query.inline_columns.map {|column| "#{column_content_new(column, issue)}"}) %> <% column_content = ( query.inline_columns.map {|column| "#{column_content_new(column, issue)}"}) %>
<% if issue.tracker_id == 1 %>
<%= image_tag("/images/task.png", :class => "img-tag-issues") %>
<% end %>
<% if issue.tracker_id == 2 %>
<%= image_tag("/images/feature.png", :class => "img-tag-issues") %>
<% end %>
<% if issue.tracker_id == 3 %>
<%= image_tag("/images/support.png", :class => "img-tag-issues") %>
<% end %>
<% if issue.tracker_id == 4 %>
<%= image_tag("/images/issues.png", :class => "img-tag-issues") %>
<% end %>
<ul class="issue_list">
<% unless issue.author.nil? || issue.author.name == "Anonymous" %> <% unless issue.author.nil? || issue.author.name == "Anonymous" %>
<ul class="list-group-item-meta" style="word-break: break-all;word-wrap: break-word;width: 100%;"> <a class="problem_pic fl"><%= image_tag(url_to_avatar(issue.author), :width => "42", :height => "42") %></a>
<!-- 在这里添加赞和踩--> <div class="problem_txt fl">
<span id="praise_tread" style="float: right"> <%= link_to issue.author.name, user_path(issue.author), :class => "problem_name c_orange fl" %>
<%= render :partial => "/praise_tread/praise_tread",:locals => <span class="fl"><%= l(:label_post_on_issue) %><%= "#{raw column_content[2]}" %></span>
{:obj => issue,:show_flag => true,:user_id =>User.current.id,:horizontal => false}%> <%=link_to column_content[4], issue_path(issue.id), :class => "problem_tit fl" %><br />
</span> <p><%= textilizable issue, :description %></p><br/>
<span> <p>
<%= link_to issue.author.name, user_path(issue.author), :class => "bid_user_u" %>
</span>
<%= l(:label_post_on)%>
<% a = [] %>
<% a << column_content[1] %>
<%# a << "##{column_content[0]}" << "(#{raw column_content[2]}):" << column_content[4] %>
<% a << "#{issue.source_from}" << "(#{raw column_content[2]}):" << column_content[4] %>
<%= link_to a.join(' '), issue_path(issue.id), :class => "issue-link" , :target =>"_blank"%>
<ul class="list-group-item-meta">
<div class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textilizable issue, :description %>
</div>
</ul>
</ul>
<ul class="list-group-item-meta" style="margin-top: -15px;">
<% unless issue.assigned_to_id.nil? %> <% unless issue.assigned_to_id.nil? %>
<span> <%= l(:field_assigned_to) %>
<%= l(:field_assigned_to)%>&nbsp; <%=link_to issue.assigned_to(@user), user_path(issue.assigned_to(@user)), :class => "problem_name c_orange f1" %>
</span>
<%= raw column_content[5] %>&nbsp;
<% end %> <% end %>
<%= l(:label_updated_time_on, format_date(issue.updated_on)).html_safe %> <%= l(:label_updated_time_on, format_date(issue.updated_on)).html_safe %>
<div class="find-comment-class"> </p>
<span>
<%= link_to l(:label_find_all_comments), issue_path(issue.id) %>
</span>
<%= l(:label_comments_count, :count => issue.journals.all.count) %>
</div> </div>
</ul> <% end %>
<% end -%> <div class="cl"></div>
</ul>
</li>
</div> </div>
<% end -%> <% end -%>
</ul>
</div>

@ -79,11 +79,12 @@
</p> </p>
<% else %> <% else %>
<%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query} %> <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query} %>
<div class="pagination"> <ul class="wlist">
<ul><%= pagination_links_full @issue_pages, @issue_count %></ul> <%= pagination_links_full @issue_pages, @issue_count, :per_page_links => false, :remote => false, :flag => true %>
</div> </ul>
<% end %> <% end %>
<div style="float: right; padding-top: 30px"> <div style="float: left; padding-top: 30px">
<% other_formats_links do |f| %> <% other_formats_links do |f| %>
<%= f.link_to 'Atom', :url => params.merge(:key => User.current.rss_key) %> <%= f.link_to 'Atom', :url => params.merge(:key => User.current.rss_key) %>
<%= f.link_to 'CSV', :url => params, :onclick => "showModal('csv-export-options', '330px'); return false;" %> <%= f.link_to 'CSV', :url => params, :onclick => "showModal('csv-export-options', '330px'); return false;" %>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,44 @@
<%= error_messages_for 'message' %>
<% replying ||= false %>
<% extra_option = replying ? { readonly: true} : { maxlength: 200 } %>
<li>
<label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label>
<% if replying %>
<%= f.text_field :subject, { size: 60, id: "message_subject",:class=>"talk_input w585" }.merge(extra_option) %>
<% else %>
<%= f.text_field :subject, { size: 60, id: "message_subject", onkeyup: "regexSubject();",:class=>"talk_input w585" }.merge(extra_option) %>
<% end %>
<p id="subject_span" class="ml55"></p>
</li>
<li class="ml60 mb5">
<% unless replying %>
<% if @message.safe_attribute? 'sticky' %>
<%= f.check_box :sticky %>
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
<% end %>
<% if @message.safe_attribute? 'locked' %>
<%= f.check_box :locked %>
<%= label_tag 'message_locked', l(:label_board_locked) %>
<% end %>
<% end %>
<div class="cl"></div>
</li>
<li>
<div id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div>
<label class="fl" ><span class="c_red">*</span>&nbsp;<%= l(:field_description) %>&nbsp;&nbsp;</label>
<%= text_area :quote,:quote,:style => 'display:none' %>
<%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %>
<div class="cl"></div>
<p id="message_content_span" class="ml55"></p>
</li>
<div class="cl"></div>
<li>
<label class="fl">&nbsp;&nbsp;<%= l(:label_attachment_plural) %>&nbsp;&nbsp;</label>
<div class="fl">
<%= render :partial => 'attachments/form_project', :locals => {:container => @message,:isReply => @isReply} %>
</div>
</li>
<li >
<div class="cl"></div>
</li>

File diff suppressed because it is too large Load Diff

@ -3,22 +3,22 @@
</div> </div>
<% if @message.project %> <% if @message.project %>
<%= board_breadcrumb(@message) %> <%#= board_breadcrumb(@message) %>
<h3><%= avatar(@topic.author, :size => "24") %><span style = "width:100%;word-break:break-all;word-wrap: break-word;"><%=h @topic.subject %></span></h3> <!--<h3><%#= avatar(@topic.author, :size => "24") %><span style = "width:100%;word-break:break-all;word-wrap: break-word;"><%#=h @topic.subject %></span></h3>-->
<div class="talk_new ml15">
<%= form_for @message, { <ul>
:as => :message, <%= form_for @message, { :as => :message,
:url => {:action => 'edit'}, :url => {:action => 'edit'},
:html => {:multipart => true, :html => {:multipart => true,
:id => 'message-form', :id => 'message-form',
:method => :post} :method => :post}
} do |f| %> } do |f| %>
<%= render :partial => 'form', <%= render :partial => 'form_project',
:locals => {:f => f, :replying => !@message.parent.nil?} %> :locals => {:f => f, :replying => !@message.parent.nil?} %>
<a href="#" onclick="$('#message-form').submit();" class="ButtonColor m3p10"> <a href="#" onclick="submitProjectsBoard();"class="blue_btn fl c_white"><%= l(:button_submit)%></a>
<%= l(:button_save) %> <%= link_to l(:button_cancel), board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)), :class => "blue_btn grey_btn fl c_white" %>
</a> </ul>
<%= link_to l(:button_cancel), board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)), :class => "ButtonColor m3p10" %> </div>
<% end %> <% end %>
<% elsif @message.course %> <% elsif @message.course %>
<%#= course_board_breadcrumb(@message) %> <%#= course_board_breadcrumb(@message) %>

@ -0,0 +1,27 @@
<li class="ml45">
<label><span class="c_red">*</span>&nbsp;<%= l(:field_title) %>&nbsp;&nbsp;</label>
<input type="text" name="news[title]" class="hwork_input" id="news_title" size="60" onkeyup="regexTitle();" maxlength="60" placeholder="60个字符以内" value="<%= is_new ? '' : @news.title %>">
<p id="title_notice_span" class="ml55"></p>
</li>
<li class="ml45">
<label class="fl" ><span class="c_red">*</span>&nbsp;<%= l(:field_description) %>&nbsp;&nbsp;</label>
<textarea id="news_description" name="news[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="hwork_text fl" onkeyup="regexDescription();" maxlength="6000"><%= is_new ? '' : @news.description %></textarea>
<p id="description_notice_span" class="ml55"></p>
</li>
<div class="cl"></div>
<li class="ml45">
<label class="fl">&nbsp;&nbsp;<%= l(:label_attachment_plural) %>&nbsp;&nbsp;</label>
<%= render :partial => 'attachments/new_form', :locals => {:container => @news} %>
<div class="cl"></div>
</li>
<li class=" ml90" >
<% if is_new %>
<%= link_to l(:button_create), "#", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'blue_btn fl c_white' %>
<%= link_to l(:button_cancel), project_news_index_path(@project), :onclick => '$("#add-news").hide()', :class => 'blue_btn grey_btn fl c_white' %>
<% else %>
<%= link_to l(:button_save), "#", :onclick => 'submitNews();',:onmouseover => 'this.focus()',:class => 'blue_btn fl c_white' %>
<%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;',:class => 'blue_btn grey_btn fl c_white' %>
<% end %>
<div class="cl"></div>
</li>
<!-- <#%= wikitoolbar_for 'news_description'%>-->

@ -1,95 +1,21 @@
<div class="project_r_h">
<h2 class="project_h2"><%= l(:label_news) %></h2>
</div>
<script type="text/javascript">
function regexTitle()
{
var name = $("#news_title").val();
if(name.length ==0)
{
$("#title_notice_span").text("标题不能为空");
$("#title_notice_span").css('color','#ff0000');
$("#title_notice_span").focus();
return false;
}
else if(name.length <= 60)
{
$("#title_notice_span").text("填写正确");
$("#title_notice_span").css('color','#008000');
return true;
}
else
{
$("#title_notice_span").text("标题超过60个字符");
$("#title_notice_span").css('color','#ff0000');
$("#title_notice_span").focus();
return false;
}
}
function regexDescription()
{
var name = $("#news_description").val();
if(name.length ==0)
{
$("#description_notice_span").text("描述不能为空");
$("#description_notice_span").css('color','#ff0000');
$("#description_notice_span").focus();
return false;
}
else
{
$("#description_notice_span").text("填写正确");
$("#description_notice_span").css('color','#008000');
return true;
}
}
function submitNews()
{
if(regexTitle() && regexDescription())
{
$("#news-form").submit();
}
}
function submitFocus(obj)
{
$(obj).focus();
}
</script>
<% <%
if @project.project_type == Project::ProjectType_course
btn_tips = l(:label_news_notice)
label_tips = l(:label_course_news)
else
btn_tips = l(:label_news_new) btn_tips = l(:label_news_new)
label_tips = l(:label_news) label_tips = l(:label_news)
end
%> %>
<% if @project.enabled_modules.where("name = 'news'").count > 0 && User.current.member_of?(@project) %> <div class="project_r_h">
<%= link_to(btn_tips, <h2 class="project_h2"><%= label_tips %></h2>
new_project_news_path(@project), </div>
:class => 'icon icon-add', <div class="talk_top">
:onclick => 'showAndScrollTo("add-news", "news_title"); return false;') %> <p class="fl"><%= l(:label_total_news) %><span><%= @news_count %></span><%= l(:label_project_new_list) %></p>
<% end %> <% if @project && User.current.allowed_to?(:manage_news, @project) %>
<% if @project && User.current.allowed_to?(:manage_news, @project) %> <%= link_to(btn_tips, new_project_news_path(@project),
<div id="add-news" class="add_frame" style="display:none;"> :class => 'problem_new_btn fl c_dorange') %>
<%= labelled_form_for @news, :url => project_news_index_path(@project), <div class="cl"></div>
:html => {:id => 'news-form', :multipart => true} do |f| %>
<%= render :partial => 'news/form', :locals => {:f => f} %>
<%#= submit_tag l(:button_create), :class => 'whiteButton m3p10 h30', :name => nil %><!-- button-submit -->
<%= link_to l(:button_create), "#", :onclick => 'submitNews();',:onmouseover => 'submitFocus(this);', :class => 'ButtonColor m3p10' %>
<%#= preview_link preview_news_path(:project_id => @project), 'news-form', target='preview', {:class => 'whiteButton m3p10'} %> <% end %>
<div class="cl"></div>
</div>
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()', :class => 'ButtonColor m3p10' %>
<% end if @project %>
<div id="preview" class="wiki"></div>
</div>
<% end %>
<div> <div>
<% if @newss.empty? %> <% if @newss.empty? %>
<p class="nodata"> <p class="nodata">
@ -97,58 +23,25 @@
</p> </p>
<% else %> <% else %>
<% @newss.each do |news| %> <% @newss.each do |news| %>
<div class="problem_main">
<%= link_to image_tag(url_to_avatar(news.author),:width => 42,:height => 42), user_path(news.author), :class => "problem_pic fl" %>
<div class="problem_txt fl mt5">
<%= link_to_user_header(news.author,false,{:class=> 'problem_name c_orange fl'}) if news.respond_to?(:author) %>
<span class="fl"> <%= l(:label_release_news) %></span><%= link_to h(news.title), news_path(news),:class => 'problem_tit fl fb c_dblue' %><br />
<div class="cl mb5"></div>
<p id="news_description_<%= news.id %>" class="news_description mt5"><%= news.description %><br /> <%= l(:label_create_time) %> <%= format_time(news.created_on) %></p>
<div class="news_foot" style="display: none;" onclick="news_show_more_des(<%= news.id %>);" id="news_foot_<%= news.id %>"><%= l(:label_expend_information) %> <span class="g-arr-down"><img src="/images/jiantou.jpg" width="12" height="6" /></span></div>
</div>
<div class="cl"></div>
</div><!--problem_main end-->
<table class="content-text-list">
<tr>
<td colspan="2" valign="top" width="50">
<%= link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %>
</td>
<td>
<table width="580px" border="0">
<% if @project.project_type == 1 %>
<tr>
<td colspan="2" valign="top">
<strong><%= link_to_user(news.author) if news.respond_to?(:author) %></strong>
<span style="margin-left: 4px;" class="font_lighter"><%= l(:label_project_notice) %></span>
<span><%= link_to h(news.title), news_path(news) %></span>
<span style="float: right"><%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %> </span>
</td>
</tr>
<% else %>
<tr>
<td colspan="2" valign="top">
<strong><%= link_to_user(news.author) if news.respond_to?(:author) %></strong>
<span style="margin-left: 4px;" class="font_lighter"><%= l(:label_project_newshare) %></span>
<span> <%= link_to h(news.title), news_path(news) %></span>
<span style="float: right" class='delete_icon'>
<%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %>
</span>
</td>
</tr>
<% end %>
<tr>
<td colspan="2" width="580px">
<span class="font_description"><%= textilizable(news, :description) %></span></td>
</tr>
<tr>
<td align="left"><span class="font_lighter"> <%= l :label_update_time %>
&nbsp;<%= format_time(news.created_on) %></span></td>
<td width="350" align="right" class="a"><%= link_to l(:label_project_newother), news_path(news) %><%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count >= 0 %></td>
</tr>
</table>
</td>
</tr>
</table>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
<!--end--> <!--end-->
<div style="padding-right: 10px"> <ul class="wlist">
<div class="pagination"> <%= pagination_links_full @news_pages, @news_count, :per_page_links => false, :remote => false, :flag => true%>
<ul> </ul>
<%= pagination_links_full @news_pages %>
</ul>
</div>
<% other_formats_links do |f| %> <% other_formats_links do |f| %>
<%= f.link_to 'Atom', :url => {:project_id => @project, :key => User.current.rss_key} %> <%= f.link_to 'Atom', :url => {:project_id => @project, :key => User.current.rss_key} %>
@ -160,7 +53,6 @@
<% end %> <% end %>
<% html_title(l(:label_news_plural)) -%> <% html_title(l(:label_news_plural)) -%>
</div>
<script type='text/javascript'> <script type='text/javascript'>
$(document).ready(function ($) { $(document).ready(function ($) {

@ -4,12 +4,23 @@
label_tips = l(:label_course_news) label_tips = l(:label_course_news)
%> %>
<% if @project %> <% if @project %>
<div class="project_r_h">
<h2 class="project_h2"><%= l(:label_news) %></h2>
</div>
<div class="hwork_new">
<%= error_messages_for @news %>
<p class="talk_top pl15" >
<%= l(:label_news_new)%>
</p>
<ul>
<%= labelled_form_for @news, :url => project_news_index_path(@project), <%= labelled_form_for @news, :url => project_news_index_path(@project),
:html => {:id => 'news-form', :multipart => true} do |f| %> :html => {:id => 'news-form', :multipart => true} do |f| %>
<%= render :partial => 'news/form', :locals => {:f => f} %> <%= render :partial => 'news/project_form', :locals => {:f => f, :is_new => true} %>
<%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %>
<%#= preview_link preview_news_path(:project_id => @project), 'news-form', target='preview', {:class => 'whiteButton m3p10'} %> <% end if @project %>
<% end %> </ul>
<div id="preview" class="wiki"></div>
</div>
<% elsif @course %> <% elsif @course %>
<div class="project_r_h"> <div class="project_r_h">
<h2 class="project_h2"><%= label_tips %></h2> <h2 class="project_h2"><%= label_tips %></h2>

File diff suppressed because it is too large Load Diff

@ -1,30 +1,15 @@
<div id="tags_show" style="float: left;"> <div id="tags_show">
<%= render :partial => "tags/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %> <%= render :partial => "tags/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
</div> </div>
<div style="float: left;"> <% if User.current.logged?%>
<% if User.current.logged? %> <a href="javascript:void(0)" class="yellowBtn f_l" onclick="$('#add_tag01').slideToggle();"><%= l(:label_add_tag)%></a>
<span> <%= toggle_link (l(:label_add_tag)), 'put-tag-form', {:focus => 'tags_name'} %> </span> <span id="add_tag01" style="display:none; vertical-align: middle;" class="ml10 f_l">
<% end %> <%= form_for "tag_for_save",:remote=>true,:url=>save_tag_path,:update => "tags_show",:complete => '$("#put-tag-form").slideUp();' do |f| %>
<%= f.text_field :name ,:id => "tags_name",:size=>"20",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>Setting.tags_min_length,:class =>"isTxt w90 f_l" %>
<div id="put-tag-form" style="display: none;text-align: center">
<%= form_for "tag_for_save",:remote=>true,:url=>tag_path,
:update => "tags_show",
:complete => '$("#put-tag-form").slideUp();' do |f| %>
<table>
<tr>
<td>
<%= f.text_field :name ,:id => "tags_name",:size=>"20",
:require=>true,
:maxlength => Setting.tags_max_length,
:minlength=>Setting.tags_min_length %>
</td>
<%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%> <%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%> <%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
<td style="margin-left: 5px" vertical-valign="middle" > <input type="button" class="submit f_l" onclick="$('#tags_name').parent().submit();" />
<a href="#" onclick='$("#tags_name").parent().submit();' type="button" class="submit f_l"></a>
</td>
<tr>
</table>
<% end %> <% end %>
</div> </span>
</div> <% end%>

@ -31,10 +31,10 @@
<!-- 用来显示三大对象的主页中的tag 故是全部显示 --> <!-- 用来显示三大对象的主页中的tag 故是全部显示 -->
<% if @tags.size > 0 %> <% if @tags.size > 0 %>
<% @tags.each do |tag| %> <% @tags.each do |tag| %>
<!--项目暂时单独出来,后面重构--> <!--object_flag == '2'为项目 项目暂时单独出来,后面其它几个选项也需样式重构-->
<% if object_flag == '2' %> <% if object_flag == '2' %>
<span class="re_tag f_l"> <span class="re_tag f_l">
<%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %> <%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id, :class => 'pt5' %>
<% if (ProjectInfo.find_by_project_id(obj.id)).try(:user_id) == User.current.id %> <% if (ProjectInfo.find_by_project_id(obj.id)).try(:user_id) == User.current.id %>
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag, <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
:taggable_id => obj.id, :taggable_type => object_flag %> :taggable_id => obj.id, :taggable_type => object_flag %>

@ -12,6 +12,9 @@ zh:
# #
label_project_new: "新建项目" label_project_new: "新建项目"
label_join_project: "加入项目" label_join_project: "加入项目"
label_my_project: "我的项目"
# #
@ -20,13 +23,23 @@ zh:
# 热门项目栏 # 热门项目栏
# #
lable_hot_projects: 热门项目 lable_hot_projects: 热门项目
label_project_name: 项目名称:
label_private: 私有 label_private: 私有
label_public: 公开
label_project_member_amount: label_project_member_amount:
one: "%{count}人" one: "%{count}人"
other: "%{count}人" other: "%{count}人"
label_project_score_tips: 项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度 label_project_score_tips: 项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度
label_project_score: 项目评分 label_project_score: 项目评分
#
# 项目托管平台主页
#
# TopBar
#
label_project_hosting_platform: 项目托管平台
# #
# 项目托管平台主页 # 项目托管平台主页
@ -36,7 +49,7 @@ zh:
label_project_id: "项目ID:" label_project_id: "项目ID:"
label_apply_project: "+申请加入" label_apply_project: "+申请加入"
label_button_following: "+关注" label_button_following: "+添加关注"
label_exit_project: 退出项目 label_exit_project: 退出项目
label_apply_project_waiting: 已处理申请,请等待管理员审核 label_apply_project_waiting: 已处理申请,请等待管理员审核
label_unapply_project: 取消申请 label_unapply_project: 取消申请
@ -52,7 +65,7 @@ zh:
project_module_boards: 讨论区 project_module_boards: 讨论区
project_module_boards_post: 发帖 project_module_boards_post: 发帖新帖
project_module_files: 资源库 project_module_files: 资源库
project_module_repository: 版本库 project_module_repository: 版本库
project_module_create_repository: 创建版本库 project_module_create_repository: 创建版本库
@ -253,6 +266,7 @@ zh:
# 项目得分 # 项目得分
# #
label_projects_score: 项目综合得分 label_projects_score: 项目综合得分
label_project_new_list: 条项目新闻
label_issue_score: issue得分 label_issue_score: issue得分
label_issue_number: issue的数量 label_issue_number: issue的数量

@ -1225,6 +1225,7 @@ zh:
label_author_name: 由%{author_name}发表了 label_author_name: 由%{author_name}发表了
label_post_on: 发表了 label_post_on: 发表了
label_post_on_issue: 发表了问题

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save