2016-09-28 11:01:30 +08:00
|
|
|
<div class="project_r_h" xmlns="http://www.w3.org/1999/html" style="width:730px;">
|
2015-03-06 14:55:21 +08:00
|
|
|
<h2 class="project_h2">Wiki</h2>
|
|
|
|
</div>
|
2015-04-16 00:30:23 +08:00
|
|
|
<div class="wiki_page">
|
|
|
|
<div class="wiki_page_con">
|
|
|
|
<div class="contextual">
|
|
|
|
<% if @editable %>
|
|
|
|
<% if @content.current_version? %>
|
|
|
|
|
|
|
|
<%#= watcher_link(@page, User.current) %>
|
2015-03-06 14:55:21 +08:00
|
|
|
<%#= link_to_if_authorized(l(:button_lock), {:action => 'protect', :id => @page.title, :protected => 1}, :method => :post, :class => 'icon icon-lock') if !@page.protected? %>
|
|
|
|
<%#= link_to_if_authorized(l(:button_unlock), {:action => 'protect', :id => @page.title, :protected => 0}, :method => :post, :class => 'icon icon-unlock') if @page.protected? %>
|
|
|
|
<%#= link_to_if_authorized(l(:button_rename), {:action => 'rename', :id => @page.title}, :class => 'icon icon-move') %>
|
2015-04-16 00:30:23 +08:00
|
|
|
<%= link_to_if_authorized("", {:action => 'destroy', :id => @page.title}, :method => :delete, :data => {:confirm => l(:text_are_you_sure)}, :class => 'pic_del fr') %>
|
|
|
|
<%= link_to_if_authorized("", {:action => 'edit', :id => @page.title}, :class => 'pic_edit fr', :accesskey => accesskey(:edit)) %>
|
2015-03-06 14:55:21 +08:00
|
|
|
<% else %>
|
|
|
|
<%= link_to_if_authorized(l(:button_rollback), {:action => 'edit', :id => @page.title, :version => @content.version }, :class => 'icon icon-cancel') %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
2015-04-16 00:30:23 +08:00
|
|
|
<%#= link_to_if_authorized(l(:label_history), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %>
|
2014-10-23 11:30:34 +08:00
|
|
|
</div>
|
|
|
|
<%= wiki_page_breadcrumb(@page) %>
|
|
|
|
<% unless @content.current_version? %>
|
|
|
|
<p>
|
2015-03-06 14:55:21 +08:00
|
|
|
<%= link_to(("\xc2\xab " + l(:label_previous)),
|
|
|
|
:action => 'show', :id => @page.title, :project_id => @page.project,
|
|
|
|
:version => @content.previous.version) + " - " if @content.previous %>
|
|
|
|
<%= "#{l(:label_version)} #{@content.version}/#{@page.content.version}" %>
|
|
|
|
<%= '('.html_safe + link_to(l(:label_diff), :controller => 'wiki', :action => 'diff',
|
|
|
|
:id => @page.title, :project_id => @page.project,
|
|
|
|
:version => @content.version) + ')'.html_safe if @content.previous %> -
|
|
|
|
<%= link_to((l(:label_next) + " \xc2\xbb"), :action => 'show',
|
|
|
|
:id => @page.title, :project_id => @page.project,
|
|
|
|
:version => @content.next.version) + " - " if @content.next %>
|
|
|
|
<%= link_to(l(:label_current_version), :action => 'show', :id => @page.title, :project_id => @page.project, :version => nil) %>
|
|
|
|
<br />
|
|
|
|
<em>
|
|
|
|
<%= @content.author ? link_to_user(@content.author) : l(:label_user_anonymous)%>,
|
|
|
|
<%= format_time(@content.updated_on) %>
|
|
|
|
</em>
|
|
|
|
<br />
|
|
|
|
<%=h @content.comments %>
|
2014-10-23 11:30:34 +08:00
|
|
|
</p>
|
|
|
|
<hr />
|
|
|
|
<% end %>
|
2015-04-16 00:30:23 +08:00
|
|
|
<div class="cl"></div>
|
2014-10-23 11:30:34 +08:00
|
|
|
<%= render(:partial => "wiki/content", :locals => {:content => @content}) %>
|
2015-04-17 08:28:07 +08:00
|
|
|
<%= link_to_attachment_project @page, :author => true %>
|
2015-04-16 00:30:23 +08:00
|
|
|
<!--<a href="javascript:void(0)" class=" c_orange fl ml20 fl">zhang<span class="c_grey"> 2014-08-04 10:09</span></a>-->
|
|
|
|
</div>
|
|
|
|
<!--wiki new-->
|
2014-10-23 11:30:34 +08:00
|
|
|
<% if @editable && authorize_for('wiki', 'add_attachment') %>
|
2015-04-16 00:30:23 +08:00
|
|
|
|
|
|
|
<div class=" mb10">
|
2016-07-06 15:43:48 +08:00
|
|
|
<%= link_to l(:label_upload_source), {}, :onclick => "$('#add_attachment_form').show(); return false;",
|
2015-04-16 00:30:23 +08:00
|
|
|
:id => 'attach_files_link',
|
|
|
|
:class => "blue_u_btn fl mr10" %>
|
2014-10-23 11:30:34 +08:00
|
|
|
<%= form_tag({:controller => 'wiki', :action => 'add_attachment',
|
2015-03-06 14:55:21 +08:00
|
|
|
:project_id => @project, :id => @page.title},
|
|
|
|
:multipart => true, :id => "add_attachment_form",
|
|
|
|
:style => "display:none;") do %>
|
2015-04-16 00:30:23 +08:00
|
|
|
|
|
|
|
<div class="box">
|
|
|
|
<p> <br/><br/>
|
|
|
|
<%= render :partial => 'attachments/form_project' %>
|
2015-03-06 14:55:21 +08:00
|
|
|
</p>
|
|
|
|
</div>
|
2015-04-16 00:30:23 +08:00
|
|
|
<a remote="true" href="javascript:void(0)" class="blue_btn fl " onclick="$('#add_attachment_form').submit();">
|
|
|
|
<%= l(:button_add) %>
|
|
|
|
</a>
|
|
|
|
<%= link_to l(:button_cancel), {}, :onclick => "$('#add_attachment_form').hide(); return false;", :class => "grey_btn ml10 fl" %>
|
2014-10-23 11:30:34 +08:00
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
|
2015-04-16 00:30:23 +08:00
|
|
|
<% end %>
|
2015-04-16 15:16:15 +08:00
|
|
|
<br/><br/>
|
2015-07-28 15:42:10 +08:00
|
|
|
<%# other_formats_links do |f| %>
|
|
|
|
<%#= f.link_to 'PDF', :url => {:id => @page.title, :version => params[:version]} %>
|
|
|
|
<%#= f.link_to 'HTML', :url => {:id => @page.title, :version => params[:version]} %>
|
|
|
|
<%#= f.link_to 'TXT', :url => {:id => @page.title, :version => params[:version]} %>
|
|
|
|
<%# end if User.current.allowed_to?(:export_wiki_pages, @project) %>
|
2014-10-23 11:30:34 +08:00
|
|
|
<% content_for :sidebar do %>
|
2015-03-06 14:55:21 +08:00
|
|
|
<%= render :partial => 'sidebar' %>
|
2014-10-23 11:30:34 +08:00
|
|
|
<% end %>
|
|
|
|
<% html_title @page.pretty_title %>
|
2014-10-24 09:32:47 +08:00
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
window.onready = function() {
|
|
|
|
var maxwidth = $("#wiki_content_div").width();
|
|
|
|
$("#wiki_content_div").children().each(function(){
|
|
|
|
if($(this).width()>maxwidth)
|
|
|
|
{
|
|
|
|
$(this).width(maxwidth);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|
2016-09-28 11:01:30 +08:00
|
|
|
|
2016-09-29 14:24:42 +08:00
|
|
|
$(".project_r_h").parent().css({"width":"730px","background-color":"#fff","padding":"10px","margin-left":"10px","margin-bottom":"10px"});
|
2014-10-24 09:32:47 +08:00
|
|
|
</script>
|
2015-04-16 00:30:23 +08:00
|
|
|
</div>
|