Merge pull request #216 from warpc/193-new_design_for_wiki

[Refs #193] new design for wiki
This commit is contained in:
Vladimir Sharshov 2012-02-27 11:12:28 -08:00
commit b475877608
40 changed files with 750 additions and 527 deletions

View File

@ -1,7 +1,3 @@
//@import "vendor";
@import "vendor";
@import "main";
@import "custom";
//= require main
//= require vendor
//= require custom

View File

@ -5,13 +5,13 @@
= text_area_tag :content, @blob.data.encode_to_default, :id => "gollum-editor-body"
#gollum-editor-edit-summary.singleline
= label_tag :message, t("layout.wiki.edit_commit_message"), :class => "jaws"
= text_field_tag :message, t("layout.wiki.commit_message_placeholder"), :id => "editor-commit-message-field"
= label_tag :message, t("wiki.edit_commit_message"), :class => "jaws"
= text_field_tag :message, t("wiki.commit_message_placeholder"), :id => "editor-commit-message-field"
%span.jaws
%br
= submit_tag t("layout.wiki.save_button"), :id => "gollum-editor-submit", :title => t("layout.wiki.save_changes")
= submit_tag t("wiki.save_button"), :id => "gollum-editor-submit", :title => t("wiki.save_changes")
= link_to t("layout.cancel"), blob_file_path, :class => 'minibutton', :id => 'gollum-editor-preview'
:javascript

View File

@ -9,7 +9,7 @@
= csrf_meta_tag
%body
.wrap
.wrap{:class => content_for?(:sidebar) ? 'columns' : ''}
%header
.left
.middle
@ -20,9 +20,7 @@
.search
.pic
.field
%input.gray{:onclick => "if(this.value=='#{t "layout.search"}'){this.value='';this.className='black';}",
:onblur => "if(this.value==''){this.value='#{t "layout.search"}';this.className='gray';}",
:type => "text", :value => "#{t "layout.search"}"}
%input.gray{:onclick => "if(this.value=='#{t "layout.search"}'){this.value='';this.className='black';}", :onblur => "if(this.value==''){this.value='#{t "layout.search"}';this.className='gray';}", :type => "text", :value => "#{t "layout.search"}"}
.user
.avatar= image_tag 'ava.png', :alt => 'avatar', :height => "30"
.profile

View File

@ -0,0 +1,14 @@
- content_for :sub_menu do
- act = action_name.to_sym
- contr = controller_name.to_sym
.left
= @project.name
%nav
%ul
%li= link_to t("project_menu.project"), project_path(@project), {:class => (act == :show && contr == :projects) ? 'active' : ''}
%li= link_to t("project_menu.commits"), commits_path(@project), {:class => (act == :index && contr == :commits) ? 'active' : ''}
%li= link_to t("project_menu.builds"), project_build_lists_path(@project), {:class => (act == :index && contr == :builds) ? 'active' : ''}
%li= link_to t("project_menu.tracker"), project_issues_path(@project), {:class => (act == :index && contr == :issues) ? 'active' : ''}
%li= link_to t("project_menu.wiki"), project_wiki_index_path(@project), {:class => contr == :wiki ? 'active' : ''}
%li= link_to t("project_menu.readme"), "#" #pending
%li= link_to t("project_menu.settings"), edit_project_path(@project), {:class => (act == :edit && contr == :projects) ? 'active' : ''}

View File

@ -1,20 +1,23 @@
- revert_button = capture do
= link_to t("layout.wiki.revert_page#{action_name == 'revert' ? '' : 's'}"), '#', :class => "gollum-revert-button"
= link_to t("wiki.revert_page#{action_name == 'revert' ? '' : 's'}"), '#', :class => "gollum-revert-button button width100"
#compare-content
- if action_name != 'revert'
%ul.actions
%li.minibutton
= form_tag revert_path(@project, @versions[0][0..6], @versions[1][0..6], @name),
:name => "gollum-revert", :id => "gollum-revert-form" do
= revert_button if can? :write, @project
- if action_name != 'revert'
= form_tag revert_path(@project, @versions[0][0..6], @versions[1][0..6], @name), :name => "gollum-revert", :id => "gollum-revert-form" do
= revert_button if can? :write, @project
%br
%br
= render :partial => 'diff_data', :collection => @diffs, :as => :diff
.spacer
#gollum-footer
%ul.actions
- if action_name != 'revert'
%li.minibutton
= revert_button if can? :write, @project
%li.minibutton= link_to t("layout.wiki.back_to_top"), '#wiki'
%br
%br
- if action_name != 'revert'
= revert_button if can? :write, @project
%br
%br
= link_to t("wiki.back_to_top"), '#wiki'

View File

@ -1,9 +1,4 @@
.blob_header
.size= h(diff.deleted_file ? diff.a_path : diff.b_path)
- puts 'in view'
- puts diff.a_path
- puts diff.b_path
.clear
.diff_data.highlight
= render_diff(diff)
 .size= h(diff.deleted_file ? diff.a_path : diff.b_path)
.clear
.diff_data.highlight= render_diff(diff)

View File

@ -3,41 +3,38 @@
%fieldset#gollum-editor-fields
- if @new
#gollum-editor-title-field.singleline
= label_tag :page, t("layout.wiki.page_title"), :class => 'jaws'
= label_tag :page, t("wiki.page_title"), :class => 'jaws'
= text_field_tag :page, @name, :id => "gollum-editor-page-title"
- else
= hidden_field_tag :page, @name, :id => "gollum-editor-page-title"
= render :partial => 'editor_toolbar'
= render 'editor_toolbar'
= text_area_tag :content, @content, :id => "gollum-editor-body", :'data-markup-lang' => format
- if has_footer?
#gollum-editor-edit-footer.collapsed
= link_to "#", :class => "button" do
%span= t("layout.wiki.expand_collapse")
%h4
Footer
%span= t("wiki.expand_collapse")
%h4= t("wiki.footer")
= text_area_tag :footer, footer.text_data
- if has_sidebar?
#gollum-editor-edit-sidebar.collapsed
= link_to "#", :class => "button" do
%span= t("layout.wiki.expand_collapse")
%h4
Sidebar
%span= t("wiki.expand_collapse")
%h4= t("wiki.sidebar")
= text_area_tag :sidebar, sidebar.text_data
#gollum-editor-edit-summary.singleline
= label_tag :message, t("layout.wiki.edit_commit_message"), :class => "jaws"
= text_field_tag :message, t("layout.wiki.commit_message_placeholder"), :id => "gollum-editor-message-field"
= label_tag :message, t("wiki.edit_commit_message"), :class => "jaws"
= text_field_tag :message, t("wiki.commit_message_placeholder"), :id => "gollum-editor-message-field"
%span.jaws
%br
= submit_tag t("layout.wiki.save_button"), :id => "gollum-editor-submit", :title => t("layout.wiki.save_changes")
= link_to t("layout.wiki.preview"), "javascript:void(0)", :id => "gollum-editor-preview",
:class => "minibutton", :title => t("layout.wiki.preview_title"), :'data-url' => preview_project_wiki_index_path(@project)
= submit_tag t("wiki.save_button"), :id => "gollum-editor-submit", :title => t("wiki.save_changes")
= link_to t("wiki.preview"), "javascript:void(0)", :id => "gollum-editor-preview", :class => "minibutton", :title => t("wiki.preview_title"), :'data-url' => preview_project_wiki_index_path(@project)
/ - content_for :javascripts do
/ = javascript_include_tag 'gollum/editor/gollum.editor.js'

View File

@ -1,51 +1,48 @@
#gollum-editor-function-bar
#gollum-editor-function-buttons
= link_to "#", :id => "function-bold", :class => "function-button", :title => t("layout.wiki.editor.bold") do
%span= t("layout.wiki.editor.bold")
= link_to "#", :id => "function-italic", :class => "function-button", :title => t("layout.wiki.editor.italic") do
%span= t("layout.wiki.editor.italic")
= link_to "#", :id => "function-code", :class => "function-button", :title => t("layout.wiki.editor.code") do
%span= t("layout.wiki.editor.code")
= link_to "#", :id => "function-bold", :class => "function-button", :title => t("wiki.editor.bold") do
%span= t("wiki.editor.bold")
= link_to "#", :id => "function-italic", :class => "function-button", :title => t("wiki.editor.italic") do
%span= t("wiki.editor.italic")
= link_to "#", :id => "function-code", :class => "function-button", :title => t("wiki.editor.code") do
%span= t("wiki.editor.code")
%span.function-divider
 
%span.function-divider  
= link_to "#", :id => "function-ul", :class => "function-button", :title => t("layout.wiki.editor.unordered_list") do
%span= t("layout.wiki.editor.unordered_list")
= link_to "#", :id => "function-ol", :class => "function-button", :title => t("layout.wiki.editor.ordered_list") do
%span= t("layout.wiki.editor.ordered_list")
= link_to "#", :id => "function-blockquote", :class => "function-button", :title => t("layout.wiki.editor.blockquote") do
%span= t("layout.wiki.editor.blockquote")
= link_to "#", :id => "function-hr", :class => "function-button", :title => t("layout.wiki.editor.horizontal_rule") do
%span= t("layout.wiki.editor.horizontal_rule")
= link_to "#", :id => "function-ul", :class => "function-button", :title => t("wiki.editor.unordered_list") do
%span= t("wiki.editor.unordered_list")
= link_to "#", :id => "function-ol", :class => "function-button", :title => t("wiki.editor.ordered_list") do
%span= t("wiki.editor.ordered_list")
= link_to "#", :id => "function-blockquote", :class => "function-button", :title => t("wiki.editor.blockquote") do
%span= t("wiki.editor.blockquote")
= link_to "#", :id => "function-hr", :class => "function-button", :title => t("wiki.editor.horizontal_rule") do
%span= t("wiki.editor.horizontal_rule")
%span.function-divider
 
%span.function-divider  
= link_to "#", :id => "function-h1", :class => "function-button", :title => t("layout.wiki.editor.h1") do
%span= t("layout.wiki.editor.h1")
= link_to "#", :id => "function-h2", :class => "function-button", :title => t("layout.wiki.editor.h2") do
%span= t("layout.wiki.editor.h2")
= link_to "#", :id => "function-h3", :class => "function-button", :title => t("layout.wiki.editor.h3") do
%span= t("layout.wiki.editor.h3")
= link_to "#", :id => "function-h1", :class => "function-button", :title => t("wiki.editor.h1") do
%span= t("wiki.editor.h1")
= link_to "#", :id => "function-h2", :class => "function-button", :title => t("wiki.editor.h2") do
%span= t("wiki.editor.h2")
= link_to "#", :id => "function-h3", :class => "function-button", :title => t("wiki.editor.h3") do
%span= t("wiki.editor.h3")
%span.function-divider
 
%span.function-divider  
= link_to "#", :id => "function-link", :class => "function-button", :title => t("layout.wiki.editor.link") do
%span= t("layout.wiki.editor.link")
= link_to "#", :id => "function-image", :class => "function-button", :title => t("layout.wiki.editor.image") do
%span= t("layout.wiki.editor.image")
= link_to "#", :id => "function-link", :class => "function-button", :title => t("wiki.editor.link") do
%span= t("wiki.editor.link")
= link_to "#", :id => "function-image", :class => "function-button", :title => t("wiki.editor.image") do
%span= t("wiki.editor.image")
%span.function-divider
 
%span.function-divider  
= link_to "#", :id => "function-help", :class => "function-button", :title => t("layout.wiki.editor.help") do
%span= t("layout.wiki.editor.help")
= link_to "#", :id => "function-help", :class => "function-button", :title => t("wiki.editor.help") do
%span= t("wiki.editor.help")
#gollum-editor-format-selector
= select_tag :format, options_for_select(wiki_formats, format), :id => "wiki_format"
= label_tag :format, t("layout.wiki.editor.format")
= label_tag :format, t("wiki.editor.format")
#gollum-editor-help.jaws
%ul#gollum-editor-help-parent
%li= link_to "help_1", "javascript:void(0);", :class => "selected"
@ -61,5 +58,4 @@
%li= link_to "help_8", "javascript:void(0);"
#gollum-editor-help-wrapper
#gollum-editor-help-content
%p
%p

View File

@ -1,23 +1,18 @@
.url-box
%ul.clone-urls
%li.http-clone-url.selected
= link_to t("layout.wiki.clones.http"), git_repo_url(@project.wiki_repo_name),
:'data-permissions' => (can? :write, @project) ? 'Read+Write' : 'Read'
%input.url-field{:type => 'text', :spellcheck => 'false'}
%p.url-description
%strong
access
.name
= link_to t("wiki.clones.http"), git_repo_url(@project.wiki_repo_name), :'data-permissions' => (can? :write, @project) ? 'Read+Write' : 'Read'
#url-field{:style => 'display: inline'}
.role
:javascript
$(document).ready(function() {
var link = $('li.http-clone-url a').first();
var link = $('.name a').first();
$('.url-box input.url-field').attr('value', link.attr('href'));
$('.url-box p.url-description strong').text(link.attr('data-permissions'));
$('.name #url-field').text(link.attr('href'));
$('.role').text(link.attr('data-permissions'));
$('li.http-clone-url a').live('click', function(e) {
$('.name a').live('click', function(e) {
e.preventDefault();
$('.url-box input.url-field').attr('value', $(this).attr('href'));
$('.url-box p.url-description strong').text($(this).attr('data-permissions'));
$('.name #url-field').text($(this).attr('href'));
$('.role').text($(this).attr('data-permissions'));
});
});
});

View File

@ -1,17 +1,11 @@
#template
%p
Your wiki data can be cloned from a git repository for offline access.
You have several options for editing it at this point:
%p
Your wiki data can be cloned from a git repository for offline access. You have several options for editing it at this point:
%br
%ol
%li
With your favorite text editor or IDE.
%li With your favorite text editor or IDE.
%li
With the built-in web interface, included with the
= link_to 'Gollum', "https://github.com/github/gollum"
Ruby API.
%li
With the Gollum Ruby API.
%p
When you're done, you can simply push your changes back to our system to
see them reflected on the site. The wiki repositories obey the same
access rules as the source repository that they belong to.
%li With the Gollum Ruby API.
When you're done, you can simply push your changes back to our system to see them reflected on the site. The wiki repositories obey the same access rules as the source repository that they belong to.

View File

@ -1,18 +1,11 @@
#template
%p
Все данные вашей Wiki могут быть клонированы из Git-репозитория для
доступа без интернета. В этом случае вы можете редактировать страницы
следующими способами:
%p
Все данные вашей Wiki могут быть клонированы из Git-репозитория для доступа без интернета. В этом случае вы можете редактировать страницы следующими способами:
%br
%ol
%li
Вашим любимым текстовым редактором или IDE.
%li Вашим любимым текстовым редактором или IDE.
%li
С помощью встроенного Web-интерфейса, включенного в
= link_to 'Gollum', "https://github.com/github/gollum"
Ruby API.
%li
С помощью Gollum Ruby API.
%p
Когда изменения будут завершены, просто запуште их обратно в нашу систему
чтобы увидеть их на сайте. Доступ к репозиторию Wiki осуществляется с теми
же правами, что и к проекту, с которым она связана.
%li С помощью Gollum Ruby API.
Когда изменения будут завершены, просто запуште их обратно в нашу систему чтобы увидеть их на сайте. Доступ к репозиторию Wiki осуществляется с теми же правами, что и к проекту, с которым она связана.

View File

@ -1,36 +1,41 @@
#wiki-history
%ul.actions
%li.minibutton
= link_to t("layout.wiki.compare_revisions"), "javascript:void(0);",
:class => "action-compare-revision"
= form_tag compare_path(@project, @name), :name => "compare-versions", :id => "version-form" do
%table.wiki{:cellpadding => "0", :cellspacing => "0"}
- @versions.each do |v|
%tr.history
%td.td1
%span#niceCheckbox1.niceCheck-main{:onclick => "changeCheck(this)"}
/ = check_box_tag "versions[]", v.id, :html => {:class => 'history_cbx'}
%input{:type => 'checkbox', :id => 'versions_', :name => 'versions[]', :value => v.id, :class => 'history_cbx'}
%td.td2
- user = User.where(:email => v.author.email).first
.avatar
%a{:href => "#"}
= link_to user_path_by_user(user) do
%img.mini-gravatar{:src => gravatar_url(v.author.email), :alt => "avatar: #{v.author.name.encode_to_default}"}
%span.username= user.present? ? user.uname : v.author.name.encode_to_default
.name
.both
%td.td3
%span.wiki-gray= "#{l v.committed_date.to_date, :format => :long}:"
= v.message.encode_to_default
- if @name
= raw "[#{link_to v.id[0..6], versioned_project_wiki_path(@project, escaped_name, v.id), :title => t("wiki.view_commit")}]"
- else
= "[#{v.id[0..6]}]"
= form_tag compare_path(@project, @name), :name => "compare-versions", :id => "version-form" do
%fieldset
%table
%tbody
- @versions.each do |v|
%tr{:class => cycle("odd", "even")}
%td.checkbox
= check_box_tag "versions[]", v.id
%td.author
- user = User.where(:email => v.author.email).first
= link_to user_path_by_user(user) do
%img{:src => gravatar_url(v.author.email),
:alt => "avatar: #{v.author.name.encode_to_default}",
:class => "mini-gravatar"}
%span.username= user.present? ? user.uname : v.author.name.encode_to_default
%td.commit-name
%span.time-elapsed= "#{l v.committed_date.to_date, :format => :long}:"
 
= v.message.encode_to_default
- if @name
= raw "[#{link_to v.id[0..6], versioned_project_wiki_path(@project, escaped_name, v.id), :title => t("layout.wiki.view_commit")}]"
- else
= "[#{v.id[0..6]}]"
#gollum-footer
%ul.actions
%li.minibutton
= link_to t("layout.wiki.compare_revisions"), "javascript:void(0);", :class => "action-compare-revision"
%li.minibutton
= link_to t("layout.wiki.back_to_top"), "#wiki", :class => "action-back-to-top"
:javascript
$('.niceCheck-main').click(function() {
var count = 0;
$('input.history_cbx').each(function(i,el) {
if ($(el).attr('checked')) {
count = count + 1;
}
});
if (count > 2) {
var cbx = $( $(this).find('input.history_cbx')[0] );
if ( cbx.attr('checked') ) {
$(this).css('background-position', '0pt 0px');
cbx.removeAttr('checked');
}
}
});

View File

@ -1,11 +1,13 @@
- act = action_name.intern
.secondary-navigation
%ul.wat-cf
%li.first{:class => ((act == :show and @name == 'Home') or act == :index) ? 'active' : ''}
= link_to t("layout.wiki.home"), project_wiki_index_path(@project)
%li{:class => (act == :pages) ? 'active' : ''}
= link_to t("layout.wiki.pages"), pages_project_wiki_index_path(@project)
%li{:class => (act == :wiki_history or act == :compare_wiki) ? 'active' : ''}
= link_to t("layout.wiki.wiki_history"), history_project_wiki_index_path(@project)
%li{:class => (act == :git) ? 'active' : ''}
= link_to t("layout.wiki.git_access"), git_project_wiki_index_path(@project)
.sub-menu
.left= @project.name
%nav
%ul
%li{:class => ((act == :show and @name == 'Home') or act == :index) ? 'active' : ''}
= link_to t("wiki.home"), project_wiki_index_path(@project)
%li{:class => (act == :pages) ? 'active' : ''}
= link_to t("wiki.pages"), pages_project_wiki_index_path(@project)
%li{:class => (act == :wiki_history or act == :compare_wiki) ? 'active' : ''}
= link_to t("wiki.wiki_history"), history_project_wiki_index_path(@project)
%li{:class => (act == :git) ? 'active' : ''}
= link_to t("wiki.git_access"), git_project_wiki_index_path(@project)

View File

@ -1,23 +1,19 @@
#wiki-content
.wrap{:class => "#{has_footer? ? 'has-footer' : ''} #{has_sidebar? ? 'has-rightbar' : ''}"}
#wiki-body{:class => "gollum-#{format}-content"}
#template
= raw @content
#template= raw @content
- if has_sidebar?
#wiki-rightbar{:class => "gollum-#{sidebar_format}-content"}
= raw sidebar_content
#wiki-rightbar{:class => "gollum-#{sidebar_format}-content"}= raw sidebar_content
- if has_footer?
#wiki-footer{:class => "gollum-#{footer_format}-content"}
#footer-content
= raw footer_content
#footer-content= raw footer_content
#gollum-footer
%p#last-edit
= t("layout.wiki.last_edited_by")
%b
= user_link_by_user User.where(:email => author_email).first
= t("wiki.last_edited_by")
%b= user_link_by_user User.where(:email => author_email).first
= time_ago_in_words date.to_time - 4.hours, true
= t("layout.time.ago")
- unless action_name == 'preview' or cannot? :write, @project
%p#delete-link
= link_to project_wiki_path(@project, escaped_name), :method => :delete, :confirm => t("layout.confirm") do
%span= t("layout.wiki.delete_page")
= link_to project_wiki_path(@project, escaped_name), :method => :delete, :confirm => t("layout.confirm"), :class => 'button width100' do
%span= t("wiki.delete_page")

View File

@ -21,4 +21,4 @@
%b
= t("activerecord.attributes.project.owner")
\:
= link_to @project.owner.try(:name), url_for(@project.owner)
= link_to @project.owner.try(:name), url_for(@project.owner)

View File

@ -1,22 +1,21 @@
#results
- if @results and !@results.empty?
%ul
- @results.each do |result|
%li
- if action_name == 'search'
= link_to result[:name], project_wiki_path(@project, CGI.escape(result[:name]))
%span.count= "(#{result.count} #{t("layout.wiki.matches")})"
-else
= link_to result.name, project_wiki_path(@project, CGI.escape(result.name))
- else
%p#no-results
- @st_ref = capture do
%strong= @ref || @query
- if action_name == 'search'
= raw t("layout.wiki.no_results_for_search", :query => @st_ref)
- else
= raw t("layout.wiki.no_pages_in", :ref => @st_ref)
%p
- if @results.present?
- @results.each do |result|
- if action_name == 'search'
= link_to result[:name], project_wiki_path(@project, CGI.escape(result[:name]))
%span.count= "(#{result.count} #{t("wiki.matches")})"
-else
= link_to result.name, project_wiki_path(@project, CGI.escape(result.name))
%br
- else
%p#no-results
- @st_ref = capture do
%strong= @ref || @query
- if action_name == 'search'
= raw t("wiki.no_results_for_search", :query => @st_ref)
- else
= raw t("wiki.no_pages_in", :ref => @st_ref)
#footer
%ul.actions
%li.minibutton= link_to t("layout.wiki.back_to_top"), '#wiki'
/ #footer
/ %ul.actions
/ %li.minibutton= link_to t("wiki.back_to_top"), '#wiki'

View File

@ -1,6 +1,6 @@
#gollum-searchbar
= form_tag search_project_wiki_index_path(@project), :method => :get, :id => "gollum-search-form" do
#gollum-searchbar-fauxtext
= text_field_tag :q, t("layout.wiki.search_and_hellip"), :id => "search-query", :autocomplete => "on"
= link_to "#", :id => "search-submit", :title => t("layout.wiki.search_popup") do
%span= t("layout.wiki.search")
= text_field_tag :q, t("wiki.search_and_hellip"), :id => "search-query", :autocomplete => "on"
= link_to "#", :id => "search-submit", :title => t("wiki.search_popup") do
%span= t("wiki.search")

View File

@ -0,0 +1,14 @@
- act = action_name.intern
%aside
.admin-preferences
%ul
%li{:class => ((act == :show and @name == 'Home') or act == :index) ? 'active' : ''}
= link_to t("wiki.home"), project_wiki_index_path(@project)
%li{:class => (act == :pages) ? 'active' : ''}
= link_to t("wiki.pages"), pages_project_wiki_index_path(@project)
%li{:class => (act == :wiki_history or act == :compare_wiki) ? 'active' : ''}
= link_to t("wiki.wiki_history"), history_project_wiki_index_path(@project)
%li{:class => (act == :git) ? 'active' : ''}
= link_to t("wiki.git_access"), git_project_wiki_index_path(@project)
%br
= render 'searchbar'

View File

@ -1,29 +1,22 @@
= render :partial => 'gollum_includes'
= render :partial => 'project_short'
= render 'gollum_includes'
/ = render 'project_short'
= render 'projects/submenu'
%a{ :name => "wiki"}
.block
= render :partial => 'navigation'
%h3.wiki
- if @name
= t("wiki.history_for")
%strong= @page.name
- else
= t("wiki.wiki_history")
.content
#wiki-wrapper.inner.compare
#head
%h1.title
- if @name
= t("layout.wiki.history_for")
%strong= @page.name
- else
= t("layout.wiki.wiki_history")
%br
%br
%ul.actions
- if can? :read, @project
%li.minibutton= link_to t("layout.wiki.back_to_history"),
@name ? history_project_wiki_path(@project, escaped_name) : history_project_wiki_index_path(@project)
= render :partial => 'searchbar'
.r
- if can? :read, @project
= link_to t("wiki.back_to_history"), @name ? history_project_wiki_path(@project, escaped_name) : history_project_wiki_index_path(@project), :class => 'button width100'
#wiki-content
= render :partial => "compare"
#wiki-content= render "compare"
- content_for :sidebar do
- render :partial => 'projects/sidebar'
- render 'sidebar'

View File

@ -1,33 +1,27 @@
= render :partial => 'gollum_includes'
= render :partial => 'project_short'
= render 'gollum_includes'
/ = render 'project_short'
= render 'projects/submenu'
%a{ :name => "wiki"}
.block
= render :partial => 'navigation'
%h3.wiki
= t("wiki.editing_page")
%strong= @page.name
- if can? :read, @project
.r= link_to t("wiki.view_page"), view_path(@project, escaped_name), :class => 'action-view-page button width100'
.r= link_to t("wiki.page_history"), history_project_wiki_path(@project, escaped_name), :class => 'aciton-view-history button width100'
.content
#wiki-wrapper.inner
#head
%h1.title
= t("layout.wiki.editing_page")
%strong= @page.name
%br
%br
%br
%ul.actions
- if can? :read, @project
%li.minibutton
= link_to t("layout.wiki.view_page"), view_path(@project, escaped_name),
:class => 'action-view-page'
%li.minibutton
= link_to t("layout.wiki.page_history"), history_project_wiki_path(@project, escaped_name),
:class => 'aciton-view-history'
#wiki-content
= render :partial => "editor"
#wiki-content= render "editor"
:javascript
jQuery(document).ready(function() {
$.GollumEditor();
});
:css
#gollum-editor { width: 100%; }
- content_for :sidebar do
- render :partial => 'projects/sidebar'
- render 'sidebar'

View File

@ -1,22 +1,14 @@
= render :partial => 'gollum_includes'
= render :partial => 'project_short'
/ = render 'gollum_includes'
/ = render 'project_short'
= render 'projects/submenu'
%a{ :name => "wiki"}
.block
= render :partial => 'navigation'
.desription-top
.img= image_tag("code.png")
= render "git_access"
.both
= render "git_access_message"
.content
#wiki-wrapper.inner.compare
#head
%h1.title
= t("layout.wiki.wiki_git_access")
#wiki-content
= render :partial => "git_access"
%br
= render :partial => "git_access_message"
.both
- content_for :sidebar do
- render :partial => 'projects/sidebar'
- render 'sidebar'

View File

@ -1,38 +1,11 @@
= render :partial => 'gollum_includes'
= render :partial => 'project_short'
/ = render 'gollum_includes'
/ = render 'project_short'
= render 'projects/submenu'
%a{ :name => "wiki"}
.block
= render :partial => 'navigation'
.content
#wiki-wrapper.inner.history
#head
%h1.title
- if @name
= t("layout.wiki.history_for")
%strong= @page.name
- else
= t("layout.wiki.wiki_history")
%ul.actions
- if @name
- if can? :read, @project
%li.minibutton
= link_to t("layout.wiki.view_page"), view_path(@project, escaped_name),
:class => 'action-view-page'
- if can? :write, @project
%li.minibutton
= link_to t("layout.wiki.edit_page"), edit_project_wiki_path(@project, escaped_name),
:class => 'aciton-edit-page'
- else
- if can? :read, @project
%li.minibutton
= link_to t("layout.wiki.view_page"), project_wiki_index_path(@project)
= render :partial => 'searchbar'
#wiki-content
= render :partial => "history"
.r= link_to t("wiki.compare_revisions"), "javascript:void(0);", :class => "action-compare-revision button width100"
.both
= render 'history'
.both
- content_for :sidebar do
- render :partial => 'projects/sidebar'
- render 'sidebar'

View File

@ -1,24 +1,21 @@
= render :partial => 'gollum_includes'
= render :partial => 'project_short'
= render 'gollum_includes'
/ = render 'project_short'
= render 'projects/submenu'
%a{ :name => "wiki"}
.block
= render :partial => 'navigation'
%h3.wiki
= t("wiki.create_page")
%strong= @name
%br
.content
#wiki-wrapper.inner
#head
%h1.title
= t("layout.wiki.create_page")
%strong= @name
#wiki-content
= render :partial => "editor"
#wiki-content= render "editor"
:javascript
jQuery(document).ready(function() {
$.GollumEditor({ NewFile: true });
});
:css
#gollum-editor { width: 100%; }
- content_for :sidebar do
- render :partial => 'projects/sidebar'
- render 'sidebar'

View File

@ -1,25 +1,11 @@
= render :partial => 'gollum_includes'
= render :partial => 'project_short'
/ = render 'gollum_includes'
/ = render 'project_short'
= render 'projects/submenu'
%a{ :name => "wiki"}
.block
= render :partial => 'navigation'
.content
.inner
#wiki-wrapper.results
#head
- @st_ref = capture do
%strong= @ref
%h1.title= raw t("layout.wiki.all_pages_in")
%ul.actions
- if can? :read, @project
%li.minibutton
= link_to t("layout.wiki.home"), project_wiki_index_path(@project),
:class => 'action-edit-page'
= render :partial => 'searchbar'
= render :partial => "results"
- if can? :write, @project
.r= link_to t("wiki.new_page"), '#', :'data-url' => project_wiki_index_path(@project), :id => 'minibutton-new-page', :class => 'button width100'
.both
= render "results"
- content_for :sidebar do
- render :partial => 'projects/sidebar'
- render 'sidebar'

View File

@ -1,25 +1,15 @@
= render :partial => 'gollum_includes'
= render :partial => 'project_short'
/ = render 'gollum_includes'
/ = render 'project_short'
= render 'projects/submenu'
%a{ :name => "wiki"}
.block
= render :partial => 'navigation'
- @st_query = capture do
%strong= @query
%h1.title= raw t("wiki.search_results_for", :query => @st_query)
%ul.actions
- if can? :read, @project
%li.minibutton= link_to t("wiki.home"), project_wiki_index_path(@project), :class => 'action-edit-page'
.content
.inner
#wiki-wrapper.results
#head
- @st_query = capture do
%strong= @query
%h1.title= raw t("layout.wiki.search_results_for", :query => @st_query)
%ul.actions
- if can? :read, @project
%li.minibutton
= link_to t("layout.wiki.home"), project_wiki_index_path(@project),
:class => 'action-edit-page'
= render :partial => 'searchbar'
= render :partial => "results"
= render "results"
- content_for :sidebar do
- render :partial => 'projects/sidebar'
- render 'sidebar'

View File

@ -1,30 +1,29 @@
= render :partial => 'gollum_includes'
= render :partial => 'project_short'
/ = render 'gollum_includes'
/ = render 'project_short'
= render 'projects/submenu'
%a{ :name => "wiki"}
.block
= render :partial => 'navigation'
%h3.wiki
= @page.name
= "(#{t("wiki.preview")})" if action_name == 'preview'
- unless action_name == 'preview'
.r
= link_to t("wiki.page_history"), history_project_wiki_path(@project, escaped_name), :class => 'button width100'
.r
- if @editable
= link_to t("wiki.edit_page"), edit_project_wiki_path(@project, escaped_name), :class => "button width100"
.r
- if can? :write, @project
= link_to t("wiki.new_page"), '#', :'data-url' => project_wiki_index_path(@project), :id => 'minibutton-new-page', :class => 'button width100'
.content
.inner
#wiki-wrapper.page
#head
%h1.title
= @page.name
= "(#{t("layout.wiki.preview")})" if action_name == 'preview'
- unless action_name == 'preview'
%ul.actions
- if can? :write, @project
%li.minibutton.jaws
= link_to t("layout.wiki.new_page"), '#', :'data-url' => project_wiki_index_path(@project),
:id => 'minibutton-new-page'
- if @editable
%li.minibutton
= link_to t("layout.wiki.edit_page"), edit_project_wiki_path(@project, escaped_name), :class => "action-edit-page"
%li.minibutton= link_to t("layout.wiki.page_history"), history_project_wiki_path(@project, escaped_name)
= render :partial => 'searchbar'
= render :partial => "page"
%br
%br
%br
.both
/ = render 'searchbar'
= render "page"
- content_for :sidebar do
- render :partial => 'projects/sidebar'
- render 'sidebar'
:css
#wiki-content .wrap { width: 100% }

View File

@ -57,6 +57,9 @@ Rosa::Application.configure do
# Generate digests for assets URLs
config.assets.digest = true
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
config.assets.precompile += %w()
end
# require 'stub_xml_rpc'

View File

@ -165,63 +165,6 @@ en:
confirm_clone: To clone?
clone: To clone
wiki:
new_page: New Page
edit_page: Edit Page
delete_page: Delete this Page
page_history: Page History
create_page: Create page
wiki_git_access: Git Access
page_title: Page header
expand_collapse: Expand
last_edited_by: Last edited by
home: Home
pages: Pages
wiki_history: Wiki History
git_access: Git Access
search_and_hellip: Search & Hellip
search: Search
search_popup: Search this Wiki
commit_message_placeholder: Write a small message here explaining this change. (Optional)
edit_commit_message: Edit commit message
preview_title: Preview Page in new window
save_changes: Save current changes
save_button: Save Page
view_page: View Page
view_commit: View version
compare_revisions: Compare versions
back_to_top: Back to Top
no_pages_in: No pages in %{ref}.
no_results_for_search: Nothing found for %{query}.
matches: matches
back_to_history: Back to History
history_for: History for
editing_page: Editing
create_page: Create Page
revert_page: Revert Page
revert_pages: Revert Pages
all_pages_in: "All pages:"
search_results_for: "Search results for %{query}:"
preview: Preview
clones:
http: HTTP
editor:
bold: Bold
italic: Italic
code: Code
unordered_list: Unordered list
ordered_list: Ordered list
blockquote: Blockquote
horizontal_rule: Horizontal rule
h1: First level header
h2: Second level header
h3: Third level header
link: Link
image: Image
help: Help
event_logs:
list: List
list_header: Event log

View File

@ -19,3 +19,11 @@ en:
contacts: Contacts
tos: Terms Of Service
security: Security
project_menu:
project: Project
commits: Commits
builds: Builds
tracker: Tracker
wiki: Wiki
readme: Readme
settings: Settings

View File

@ -19,3 +19,11 @@ ru:
contacts: Контакты
tos: Условия использования
security: Безопасность
project_menu:
project: Проект
commits: Коммиты
builds: Сборки
tracker: Трекер
wiki: Wiki
readme: Readme
settings: Настройки

View File

@ -165,63 +165,6 @@ ru:
confirm_clone: Клонировать?
clone: Клонировать
wiki:
new_page: Новая
edit_page: Изменить
delete_page: Удалить страницу
page_history: История
create_page: Создать страницу
wiki_git_access: Доступ к Wiki через Git
page_title: Заголовок страницы
expand_collapse: Развернуть
last_edited_by: Последним редактировал
home: Главная
pages: Все страницы
wiki_history: История Wiki
git_access: Доступ через Git
search_and_hellip: Ключевые слова
search: Искать
search_popup: Искать в этой Wiki
commit_message_placeholder: Введите сопровождающее сообщение (опционально)
edit_commit_message: Редактировать сопровождающее сообщение
preview_title: Посмотреть в новом окне
save_changes: Сохранить текущие изменения
save_button: Сохранить
view_page: Показать
view_commit: Показать версию
compare_revisions: Сравнить версии
back_to_top: Наверх
no_pages_in: В %{ref} нет страниц для отображения.
no_results_for_search: По запросу %{query} ничего не найдено.
matches: Совпадений
back_to_history: Назад к истории
history_for: История для
editing_page: Редактирование страницы
create_page: Создать страницу
revert_page: Откатить изменения
revert_pages: Откатить изменения
all_pages_in: "Все страницы:"
search_results_for: "Результаты поиска для %{query}:"
preview: Предпросмотр
clones:
http: HTTP
editor:
bold: Жирный
italic: Курсив
code: Исходный код
unordered_list: Маркированный список
ordered_list: Нумерованный список
blockquote: Цитата
horizontal_rule: Горизонтальная черта
h1: Заголовок первого уровня
h2: Заголовок второго уровня
h3: Заголовок третьего уровня
link: Ссылка
image: Изображение
help: Помощь
event_logs:
list: Список
list_header: Лог событий

View File

@ -0,0 +1,65 @@
en:
wiki:
new_page: New Page
edit_page: Edit Page
delete_page: Delete this Page
page_history: Page History
create_page: Create page
wiki_git_access: Git Access
page_title: Page header
expand_collapse: Expand
last_edited_by: Last edited by
home: Home
pages: Pages
wiki_history: Wiki History
git_access: Git Access
search_and_hellip: Search & Hellip
search: Search
search_popup: Search this Wiki
commit_message_placeholder: Write a small message here explaining this change. (Optional)
edit_commit_message: Edit commit message
preview_title: Preview Page in new window
save_changes: Save current changes
save_button: Save Page
view_page: View Page
view_commit: View version
compare_revisions: Compare versions
back_to_top: Back to Top
no_pages_in: No pages in %{ref}.
no_results_for_search: Nothing found for %{query}.
matches: matches
back_to_history: Back to History
history_for: History for
editing_page: Editing
create_page: Create Page
revert_page: Revert Page
revert_pages: Revert Pages
all_pages_in: "All pages:"
search_results_for: "Search results for %{query}:"
preview: Preview
footer: Footer
sidebar: Sidebar
clones:
http: HTTP
editor:
bold: Bold
italic: Italic
code: Code
unordered_list: Unordered list
ordered_list: Ordered list
blockquote: Blockquote
horizontal_rule: Horizontal rule
h1: First level header
h2: Second level header
h3: Third level header
link: Link
image: Image
help: Help
seed:
welcome_content: |
# Welcome to **Wiki** #
Edit this page and create new ones.

View File

@ -0,0 +1,65 @@
ru:
wiki:
new_page: Новая
edit_page: Изменить
delete_page: Удалить страницу
page_history: История
create_page: Создать страницу
wiki_git_access: Доступ к Wiki через Git
page_title: Заголовок страницы
expand_collapse: Развернуть
last_edited_by: Последним редактировал
home: Главная
pages: Все страницы
wiki_history: История Wiki
git_access: Доступ через Git
search_and_hellip: Ключевые слова
search: Искать
search_popup: Искать в этой Wiki
commit_message_placeholder: Введите сопровождающее сообщение (опционально)
edit_commit_message: Редактировать сопровождающее сообщение
preview_title: Посмотреть в новом окне
save_changes: Сохранить текущие изменения
save_button: Сохранить
view_page: Показать
view_commit: Показать версию
compare_revisions: Сравнить версии
back_to_top: Наверх
no_pages_in: В %{ref} нет страниц для отображения.
no_results_for_search: По запросу %{query} ничего не найдено.
matches: Совпадений
back_to_history: Назад к истории
history_for: История для
editing_page: Редактирование страницы
create_page: Создать страницу
revert_page: Откатить изменения
revert_pages: Откатить изменения
all_pages_in: "Все страницы:"
search_results_for: "Результаты поиска для %{query}:"
preview: Предпросмотр
footer: Подвал
sidebar: Сайдбар
clones:
http: HTTP
editor:
bold: Жирный
italic: Курсив
code: Исходный код
unordered_list: Маркированный список
ordered_list: Нумерованный список
blockquote: Цитата
horizontal_rule: Горизонтальная черта
h1: Заголовок первого уровня
h2: Заголовок второго уровня
h3: Заголовок третьего уровня
link: Ссылка
image: Изображение
help: Помощь
seed:
welcome_content: |
# Добро пожаловать в **Wiki** #
Отредактируйте эту страницу и создайте новые.

View File

@ -1,7 +0,0 @@
en:
wiki:
seed:
welcome_content: |
# Welcome to **Wiki** #
Edit this page and create new ones.

View File

@ -1,7 +0,0 @@
ru:
wiki:
seed:
welcome_content: |
# Добро пожаловать в **Wiki** #
Отредактируйте эту страницу и создайте новые.

View File

@ -101,7 +101,8 @@ Rosa::Application.routes.draw do
match '_access' => 'wiki#git', :as => :git, :via => :get
match '_revert/:sha1/:sha2' => 'wiki#revert_wiki', :as => :revert, :via => [:get, :post]
match '_compare' => 'wiki#compare_wiki', :as => :compare, :via => :post
match '_compare/*versions' => 'wiki#compare_wiki', :as => :compare_versions, :via => :get
#match '_compare/:versions' => 'wiki#compare_wiki', :versions => /.*/, :as => :compare_versions, :via => :get
match '_compare/:versions' => 'wiki#compare_wiki', :versions => /([a-f0-9\^]{6,40})(\.\.\.[a-f0-9\^]{6,40})/, :as => :compare_versions, :via => :get
post :preview
get :search
get :pages

View File

@ -38,20 +38,18 @@ $(document).ready(function() {
});
}
if ($('#wiki-wrapper').hasClass('history')) {
$('#wiki-history td.checkbox input').each(function() {
//if ($('#wiki-wrapper').hasClass('history')) {
$('tr.history td input').each(function() {
$(this).click(highlightChecked);
if ( $(this).is(':checked') ) {
nodeSelector.checkNode($(this));
}
});
if ($('.history a.action-compare-revision').length) {
$('.history a.action-compare-revision').click(function() {
$("#version-form").submit();
});
}
}
$('a.action-compare-revision').click(function() {
$("#version-form").submit();
});
//}

281
vendor/assets/stylesheets/git/style.css vendored Normal file
View File

@ -0,0 +1,281 @@
ul.commits {
}
li.commit {
}
li.commit table tr td {
vertical-align: top;
padding-top: 5px;
}
li.commit .committers {
width: 175px;
border-right: 1px solid #E2E2E2;
}
li.commit .committers .author {
}
li.commit .committers .committer {
margin-top: 5px;
color: #999999;
font-size: 11px;
font-weight: normal;
letter-spacing: normal;
text-transform: none;
}
li.commit .message {
padding-left: 5px;
border-right: 1px solid #E2E2E2;
width: 575px;
}
li.commit .trees {
padding-left: 5px;
width: 200px;
}
li.commit .message a {
text-decoration: none;
}
li.commit .message p {
margin: 0;
}
li.commit .message a:hover {
text-decoration: underline;
}
li.commit .trees div {
margin-bottom: 3px;
}
table.git_tree .icon {
padding-left: 10px !important;
padding-right: 0px !important;
width: 16px;
}
table.git_tree tree_element a {
text-decoration: none;
}
table.git_tree ree_element a:hover {
text-decoration: underline;
}
table.git_tree .icon img {
top: 1px;
position: relative;
}
table.blob {
line-height: 1.4em;
font-family: 'Bitstream Vera Sans Mono','Courier',monospace;
border-left: 1px solid #EAEAEA;
border-right: 1px solid #EAEAEA;
}
table.blob td {
padding: 0 !important;
}
table.blob td.lines {
width: auto;
vertical-align: top;
}
table.blob td.lines pre {
text-align: right;
background-color: #ECECEC;
border-right: 1px solid #DDDDDD;
color: #AAAAAA;
padding: 10px;
}
table.blob td.blob {
vertical-align: top;
}
table.blob td.blob pre {
padding: 10px;
}
.blob_header {
background-color: #EAEAEA;
border-bottom: 1px solid #DDDDDD;
font-family: Monaco,"Courier New","DejaVu Sans Mono","Bitstream Vera Sans Mono",monospace;
font-size: 1.2em;
padding: 5px;
margin-top: 20px;
}
.blob_header .size {
margin-left: 15px;
float: left;
}
.blob_header .buttons {
float: right;
margin-right: 15px;
}
table.commit_stats {
width: 100%;
margin-top: 12px;
line-height: 1.4em;
}
table.commit_stats tr {
padding: 5px;
}
.diff_data {
overflow-x: auto;
border-left: 1px solid #EAEAEA;
border-right: 1px solid #EAEAEA;
}
table.diff {
line-height: 1.4em;
font-size: 1.2em;
font-family: 'Bitstream Vera Sans Mono','Courier',monospace;
border-top: 1px solid #EAEAEA;
border-bottom: 1px solid #EAEAEA;
width: 100%;
}
table.diff tr td.line_numbers {
background-color: #ECECEC;
border-right: 1px solid #DDDDDD;
color: #AAAAAA;
padding: 0 0.5em;
text-align: right;
}
table.diff tr td.header {
line-height: 1.4em;
font-family: 'Bitstream Vera Sans Mono','Courier',monospace;
width: 100%;
background-color: #ECECEC;
color: #AAAAAA;
padding-left: 10px;
}
table.diff tr td.code {
width: 100%;
padding-left: 10px;
}
table.diff tr td.code.del {
background-color: #FFDDDD;
}
table.diff tr td.code.del .idiff {
background-color: #F2ACAD;
}
table.diff tr td.code.ins {
background-color: #DDFFDD;
}
table.diff tr td.code.ins .idiff {
background-color: #BAFBAD;
}
table.diff .diff-content {
}
.patch_and_diff {
margin-top: 10px;
float: right;
margin-right: 10px;
}
.blame_data {
overflow-x: auto;
border-right: 1px solid #EAEAEA;
}
table.blame {
line-height: 1.4em;
font-family: 'Bitstream Vera Sans Mono','Courier',monospace;
border-left: 1px solid #EAEAEA;
/*border-right: 1px solid #EAEAEA;*/
width: 100%;
}
table.blame td {
padding: 0 !important;
}
table.blame td.lines {
width: auto;
text-align: right;
background-color: #ECECEC;
border-right: 1px solid #DDDDDD;
color: #AAAAAA;
padding: 10px;
}
table.blame td.code {
width: auto;
}
table.blame td.code pre {
margin-left: 10px;
}
table.blame td.message {
width: auto;
padding: 10px;
}
table.blame td.message .commit {
margin: 10px;
width: 430px;
}
table.blame td.message .message {
margin-bottom: 10px;
margin-left: 10px;
width: 430px;
}
#git_submenu {
margin: 0;
padding: 0;
z-index: 30;
}
#git_submenu li a:hover {
background: #FFF;
}
#git_submenu div {
background: none repeat scroll 0 0 #F8F8F8;
border: 1px solid #CCCCCC;
display: none;
max-height: 275px;
overflow: auto;
position: absolute;
z-index: 4;
}
#git_submenu div span {
padding: 10px 15px;
display: block;
background: #ECECEC;
}
#git_submenu div a:hover {
background: #ECECEC;
color: #000;
}

View File

@ -6,5 +6,6 @@
@import "gollum/gollum";
@import "gollum/dialog";
@import "gollum/ie7";
@import "gollum/template";
//@import "gollum/template";
@import "gollum/editor";
@import "git/style";