From 4d2459c60c25a9d7abd6a13ed9916207e4ba372f Mon Sep 17 00:00:00 2001 From: Pavel Chipiga Date: Fri, 24 Feb 2012 23:37:22 +0200 Subject: [PATCH] Refactor, fix and cleanup wiki templates and translations. Refs #193 --- app/assets/javascripts/wiki_history.js | 20 --- app/views/git/blobs/_editor.html.haml | 6 +- app/views/wiki/_compare.html.haml | 9 +- app/views/wiki/_diff_data.html.haml | 7 +- app/views/wiki/_editor.html.haml | 33 +++-- app/views/wiki/_editor_toolbar.html.haml | 70 +++++------ app/views/wiki/_git_access.html.haml | 5 +- .../wiki/_git_access_message.en.html.haml | 15 +-- .../wiki/_git_access_message.ru.html.haml | 16 +-- app/views/wiki/_history.html.haml | 25 +++- app/views/wiki/_navigation.html.haml | 11 +- app/views/wiki/_page.html.haml | 16 +-- app/views/wiki/_project_short.html.haml | 2 +- app/views/wiki/_results.html.haml | 14 +-- app/views/wiki/_searchbar.html.haml | 6 +- app/views/wiki/_sidebar.html.haml | 10 +- app/views/wiki/compare.html.haml | 43 ++----- app/views/wiki/edit.html.haml | 44 ++----- app/views/wiki/git.html.haml | 29 ++--- app/views/wiki/history.html.haml | 44 +------ app/views/wiki/new.html.haml | 27 +--- app/views/wiki/pages.html.haml | 30 +---- app/views/wiki/search.html.haml | 36 ++---- app/views/wiki/show.html.haml | 22 ++-- config/locales/wiki.en.yml | 115 +++++++++--------- config/locales/wiki.ru.yml | 115 +++++++++--------- config/locales/wiki_welcome.en.yml | 7 -- config/locales/wiki_welcome.ru.yml | 7 -- 28 files changed, 293 insertions(+), 491 deletions(-) delete mode 100644 app/assets/javascripts/wiki_history.js delete mode 100644 config/locales/wiki_welcome.en.yml delete mode 100644 config/locales/wiki_welcome.ru.yml diff --git a/app/assets/javascripts/wiki_history.js b/app/assets/javascripts/wiki_history.js deleted file mode 100644 index 50bf733e1..000000000 --- a/app/assets/javascripts/wiki_history.js +++ /dev/null @@ -1,20 +0,0 @@ -// Disable checkboxes selection for history table for more than 2 versions: -//$(document).ready(function() { - if ('.wiki .history') { - $('.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'); - } - } - }); - } -//}); diff --git a/app/views/git/blobs/_editor.html.haml b/app/views/git/blobs/_editor.html.haml index 9851626e4..f1e745809 100644 --- a/app/views/git/blobs/_editor.html.haml +++ b/app/views/git/blobs/_editor.html.haml @@ -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 diff --git a/app/views/wiki/_compare.html.haml b/app/views/wiki/_compare.html.haml index 402c7f9f6..48f2da74c 100644 --- a/app/views/wiki/_compare.html.haml +++ b/app/views/wiki/_compare.html.haml @@ -1,9 +1,8 @@ - revert_button = capture do - = link_to t("layout.wiki.revert_page#{action_name == 'revert' ? '' : 's'}"), '#', :class => "gollum-revert-button button width100" + = link_to t("wiki.revert_page#{action_name == 'revert' ? '' : 's'}"), '#', :class => "gollum-revert-button button width100" -- 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 +- 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 @@ -21,4 +20,4 @@ %br %br -= link_to t("layout.wiki.back_to_top"), '#wiki' += link_to t("wiki.back_to_top"), '#wiki' \ No newline at end of file diff --git a/app/views/wiki/_diff_data.html.haml b/app/views/wiki/_diff_data.html.haml index 9e55cc408..da8920b6a 100644 --- a/app/views/wiki/_diff_data.html.haml +++ b/app/views/wiki/_diff_data.html.haml @@ -1,6 +1 @@ --#.blob_header --# .size= h(diff.deleted_file ? diff.a_path : diff.b_path) --# .clear - -.diff_data.highlight - = render_diff(diff) +.diff_data.highlight= render_diff(diff) \ No newline at end of file diff --git a/app/views/wiki/_editor.html.haml b/app/views/wiki/_editor.html.haml index 19636f88b..cddc9323d 100644 --- a/app/views/wiki/_editor.html.haml +++ b/app/views/wiki/_editor.html.haml @@ -3,44 +3,41 @@ %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' --# --# - content_for :stylesheets do --# = stylesheet_link_tag 'gollum/editor.css' +/ - content_for :javascripts do +/ = javascript_include_tag 'gollum/editor/gollum.editor.js' +/ +/ - content_for :stylesheets do +/ = stylesheet_link_tag 'gollum/editor.css' diff --git a/app/views/wiki/_editor_toolbar.html.haml b/app/views/wiki/_editor_toolbar.html.haml index 18400d172..f3d60d8d8 100644 --- a/app/views/wiki/_editor_toolbar.html.haml +++ b/app/views/wiki/_editor_toolbar.html.haml @@ -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 \ No newline at end of file diff --git a/app/views/wiki/_git_access.html.haml b/app/views/wiki/_git_access.html.haml index 88ffcd715..fa0e5fbcb 100644 --- a/app/views/wiki/_git_access.html.haml +++ b/app/views/wiki/_git_access.html.haml @@ -1,6 +1,5 @@ .name - = link_to t("layout.wiki.clones.http"), git_repo_url(@project.wiki_repo_name), - :'data-permissions' => (can? :write, @project) ? 'Read+Write' : 'Read' + = 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 @@ -16,4 +15,4 @@ $('.name #url-field').text($(this).attr('href')); $('.role').text($(this).attr('data-permissions')); }); - }); + }); \ No newline at end of file diff --git a/app/views/wiki/_git_access_message.en.html.haml b/app/views/wiki/_git_access_message.en.html.haml index 14cbdd513..707d4dd0e 100644 --- a/app/views/wiki/_git_access_message.en.html.haml +++ b/app/views/wiki/_git_access_message.en.html.haml @@ -1,16 +1,11 @@ %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/ + 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. - 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. \ No newline at end of file diff --git a/app/views/wiki/_git_access_message.ru.html.haml b/app/views/wiki/_git_access_message.ru.html.haml index 8527ff9c9..16d5746c2 100644 --- a/app/views/wiki/_git_access_message.ru.html.haml +++ b/app/views/wiki/_git_access_message.ru.html.haml @@ -1,17 +1,11 @@ %p - Все данные вашей Wiki могут быть клонированы из Git-репозитория для - доступа без интернета. В этом случае вы можете редактировать страницы - следующими способами: - %br/ + Все данные вашей Wiki могут быть клонированы из Git-репозитория для доступа без интернета. В этом случае вы можете редактировать страницы следующими способами: + %br %ol - %li - Вашим любимым текстовым редактором или IDE. + %li Вашим любимым текстовым редактором или IDE. %li С помощью встроенного Web-интерфейса, включенного в = link_to 'Gollum', "https://github.com/github/gollum" Ruby API. - %li - С помощью Gollum Ruby API. - Когда изменения будут завершены, просто запуште их обратно в нашу систему - чтобы увидеть их на сайте. Доступ к репозиторию Wiki осуществляется с теми - же правами, что и к проекту, с которым она связана. + %li С помощью Gollum Ruby API. + Когда изменения будут завершены, просто запуште их обратно в нашу систему чтобы увидеть их на сайте. Доступ к репозиторию Wiki осуществляется с теми же правами, что и к проекту, с которым она связана. \ No newline at end of file diff --git a/app/views/wiki/_history.html.haml b/app/views/wiki/_history.html.haml index 26d61be97..82f1e8fa5 100644 --- a/app/views/wiki/_history.html.haml +++ b/app/views/wiki/_history.html.haml @@ -4,16 +4,14 @@ %tr.history %td.td1 %span#niceCheckbox1.niceCheck-main{:onclick => "changeCheck(this)"} - =# check_box_tag "versions[]", v.id, :html => {:class => 'history_cbx'} + / = 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{:src => gravatar_url(v.author.email), - :alt => "avatar: #{v.author.name.encode_to_default}", - :class => "mini-gravatar"} + %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 @@ -21,8 +19,23 @@ %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("layout.wiki.view_commit")}]" + = 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]}]" -= javascript_include_tag 'wiki_history' +: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'); + } + } + }); diff --git a/app/views/wiki/_navigation.html.haml b/app/views/wiki/_navigation.html.haml index 7dce8dffc..aa2d542a0 100644 --- a/app/views/wiki/_navigation.html.haml +++ b/app/views/wiki/_navigation.html.haml @@ -1,14 +1,13 @@ - act = action_name.intern .sub-menu - .left - = @project.name + .left= @project.name %nav %ul %li{:class => ((act == :show and @name == 'Home') or act == :index) ? 'active' : ''} - = link_to t("layout.wiki.home"), project_wiki_index_path(@project) + = link_to t("wiki.home"), project_wiki_index_path(@project) %li{:class => (act == :pages) ? 'active' : ''} - = link_to t("layout.wiki.pages"), pages_project_wiki_index_path(@project) + = link_to t("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) + = link_to t("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) + = link_to t("wiki.git_access"), git_project_wiki_index_path(@project) \ No newline at end of file diff --git a/app/views/wiki/_page.html.haml b/app/views/wiki/_page.html.haml index 850bc403c..cb200c328 100644 --- a/app/views/wiki/_page.html.haml +++ b/app/views/wiki/_page.html.haml @@ -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"), :class => 'button width100' do - %span= t("layout.wiki.delete_page") + %span= t("wiki.delete_page") \ No newline at end of file diff --git a/app/views/wiki/_project_short.html.haml b/app/views/wiki/_project_short.html.haml index 258ea3373..e3252f1c8 100644 --- a/app/views/wiki/_project_short.html.haml +++ b/app/views/wiki/_project_short.html.haml @@ -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) \ No newline at end of file diff --git a/app/views/wiki/_results.html.haml b/app/views/wiki/_results.html.haml index ffe50291a..9cd93b013 100644 --- a/app/views/wiki/_results.html.haml +++ b/app/views/wiki/_results.html.haml @@ -1,9 +1,9 @@ %p -- if @results and !@results.empty? +- 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("layout.wiki.matches")})" + %span.count= "(#{result.count} #{t("wiki.matches")})" -else = link_to result.name, project_wiki_path(@project, CGI.escape(result.name)) %br @@ -12,10 +12,10 @@ - @st_ref = capture do %strong= @ref || @query - if action_name == 'search' - = raw t("layout.wiki.no_results_for_search", :query => @st_ref) + = raw t("wiki.no_results_for_search", :query => @st_ref) - else - = raw t("layout.wiki.no_pages_in", :ref => @st_ref) + = 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' \ No newline at end of file diff --git a/app/views/wiki/_searchbar.html.haml b/app/views/wiki/_searchbar.html.haml index 6d2572d09..c0c7ebeed 100644 --- a/app/views/wiki/_searchbar.html.haml +++ b/app/views/wiki/_searchbar.html.haml @@ -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") \ No newline at end of file diff --git a/app/views/wiki/_sidebar.html.haml b/app/views/wiki/_sidebar.html.haml index 44dbbb912..b8768c8b3 100644 --- a/app/views/wiki/_sidebar.html.haml +++ b/app/views/wiki/_sidebar.html.haml @@ -3,12 +3,12 @@ .admin-preferences %ul %li{:class => ((act == :show and @name == 'Home') or act == :index) ? 'active' : ''} - = link_to t("layout.wiki.home"), project_wiki_index_path(@project) + = link_to t("wiki.home"), project_wiki_index_path(@project) %li{:class => (act == :pages) ? 'active' : ''} - = link_to t("layout.wiki.pages"), pages_project_wiki_index_path(@project) + = link_to t("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) + = link_to t("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) + = link_to t("wiki.git_access"), git_project_wiki_index_path(@project) %br - = render :partial => 'searchbar' + = render 'searchbar' \ No newline at end of file diff --git a/app/views/wiki/compare.html.haml b/app/views/wiki/compare.html.haml index 824be502d..133cc3d93 100644 --- a/app/views/wiki/compare.html.haml +++ b/app/views/wiki/compare.html.haml @@ -1,49 +1,22 @@ -= render :partial => 'gollum_includes' -=# render :partial => 'project_short' -= render :partial => 'projects/submenu' += render 'gollum_includes' +/ = render 'project_short' += render 'projects/submenu' %h3.wiki - if @name - = t("layout.wiki.history_for") + = t("wiki.history_for") %strong= @page.name - else - = t("layout.wiki.wiki_history") + = t("wiki.wiki_history") %br %br .r - if can? :read, @project - = link_to t("layout.wiki.back_to_history"), - @name ? history_project_wiki_path(@project, escaped_name) : history_project_wiki_index_path(@project), - :class => 'button width100' + = 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" - --#%a{ :name => "wiki"} --#.block --# = render :partial => 'navigation' --# --# .content --# #wiki-wrapper.inner.compare --# #head --# %h1.title --# - if @name --# = t("layout.wiki.history_for") --# %strong= @page.name --# - else --# = t("layout.wiki.wiki_history") --# --# %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' --# --# #wiki-content --# = render :partial => "compare" +#wiki-content= render "compare" - content_for :sidebar do - - render :partial => 'sidebar' - + - render 'sidebar' diff --git a/app/views/wiki/edit.html.haml b/app/views/wiki/edit.html.haml index 4d455b297..ae0745da1 100644 --- a/app/views/wiki/edit.html.haml +++ b/app/views/wiki/edit.html.haml @@ -1,47 +1,19 @@ -= render :partial => 'gollum_includes' -=# render :partial => 'project_short' -= render :partial => 'projects/submenu' += render 'gollum_includes' +/ = render 'project_short' += render 'projects/submenu' %h3.wiki - = t("layout.wiki.editing_page") + = t("wiki.editing_page") %strong= @page.name - if can? :read, @project - .r - = link_to t("layout.wiki.view_page"), view_path(@project, escaped_name), - :class => 'action-view-page button width100' - .r - = link_to t("layout.wiki.page_history"), history_project_wiki_path(@project, escaped_name), - :class => 'aciton-view-history button width100' + .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' %br %br %br -#wiki-content - = render :partial => "editor" - --#%a{ :name => "wiki"} --#.block --# = render :partial => 'navigation' --# --# .content --# #wiki-wrapper.inner --# #head --# %h1.title --# = t("layout.wiki.editing_page") --# %strong= @page.name --# --# %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() { @@ -52,4 +24,4 @@ #gollum-editor { width: 100%; } - content_for :sidebar do - - render :partial => 'sidebar' + - render 'sidebar' diff --git a/app/views/wiki/git.html.haml b/app/views/wiki/git.html.haml index 0db37abd4..2674ca376 100644 --- a/app/views/wiki/git.html.haml +++ b/app/views/wiki/git.html.haml @@ -1,29 +1,14 @@ -=# render :partial => 'gollum_includes' -=# render :partial => 'project_short' -= render :partial => 'projects/submenu' - +/ = render 'gollum_includes' +/ = render 'project_short' += render 'projects/submenu' .desription-top - .img - = image_tag("code.png") - = render :partial => "git_access" + .img= image_tag("code.png") + = render "git_access" .both -= render :partial => "git_access_message" += render "git_access_message" .both --#.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" - - content_for :sidebar do - - render :partial => 'sidebar' - - + - render 'sidebar' diff --git a/app/views/wiki/history.html.haml b/app/views/wiki/history.html.haml index 1203ca554..1879207b8 100644 --- a/app/views/wiki/history.html.haml +++ b/app/views/wiki/history.html.haml @@ -1,43 +1,11 @@ -=# render :partial => 'gollum_includes' -=# render :partial => 'project_short' -= render :partial => 'projects/submenu' +/ = render 'gollum_includes' +/ = render 'project_short' += render 'projects/submenu' -.r - = link_to t("layout.wiki.compare_revisions"), "javascript:void(0);", - :class => "action-compare-revision button width100" +.r= link_to t("wiki.compare_revisions"), "javascript:void(0);", :class => "action-compare-revision button width100" .both -= render :partial => 'history' += render 'history' .both - content_for :sidebar do - - render :partial => 'sidebar' - - --# .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" + - render 'sidebar' diff --git a/app/views/wiki/new.html.haml b/app/views/wiki/new.html.haml index 965ed0426..bf7bba762 100644 --- a/app/views/wiki/new.html.haml +++ b/app/views/wiki/new.html.haml @@ -1,28 +1,13 @@ -= render :partial => 'gollum_includes' -=# render :partial => 'project_short' -= render :partial => 'projects/submenu' += render 'gollum_includes' +/ = render 'project_short' += render 'projects/submenu' %h3.wiki - = t("layout.wiki.create_page") + = t("wiki.create_page") %strong= @name %br -#wiki-content - = render :partial => "editor" - --#%a{ :name => "wiki"} --#.block --# = render :partial => 'navigation' --# --# .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() { @@ -33,4 +18,4 @@ #gollum-editor { width: 100%; } - content_for :sidebar do - - render :partial => 'sidebar' + - render 'sidebar' diff --git a/app/views/wiki/pages.html.haml b/app/views/wiki/pages.html.haml index 3ba917166..d207e9ee5 100644 --- a/app/views/wiki/pages.html.haml +++ b/app/views/wiki/pages.html.haml @@ -1,29 +1,11 @@ -=# render :partial => 'gollum_includes' -=# render :partial => 'project_short' -= render :partial => 'projects/submenu' +/ = render 'gollum_includes' +/ = render 'project_short' += render 'projects/submenu' - if can? :write, @project - .r - = link_to t("layout.wiki.new_page"), '#', :'data-url' => project_wiki_index_path(@project), - :id => 'minibutton-new-page', :class => 'button width100' + .r= link_to t("wiki.new_page"), '#', :'data-url' => project_wiki_index_path(@project), :id => 'minibutton-new-page', :class => 'button width100' .both -= render :partial => "results" - --# .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" += render "results" - content_for :sidebar do - - render :partial => 'sidebar' + - render 'sidebar' diff --git a/app/views/wiki/search.html.haml b/app/views/wiki/search.html.haml index e3acbd84c..1fc2fbee6 100644 --- a/app/views/wiki/search.html.haml +++ b/app/views/wiki/search.html.haml @@ -1,37 +1,15 @@ -=# render :partial => 'gollum_includes' -=# render :partial => 'project_short' -= render :partial => 'projects/submenu' +/ = render 'gollum_includes' +/ = render 'project_short' += render 'projects/submenu' - @st_query = capture do %strong= @query -%h1.title= raw t("layout.wiki.search_results_for", :query => @st_query) +%h1.title= raw t("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' + %li.minibutton= link_to t("wiki.home"), project_wiki_index_path(@project), :class => 'action-edit-page' -= render :partial => "results" += render "results" - content_for :sidebar do - - render :partial => 'sidebar' - --#%a{ :name => "wiki"} --#.block --# = render :partial => 'navigation' --# --# .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 'sidebar' diff --git a/app/views/wiki/show.html.haml b/app/views/wiki/show.html.haml index eb1064290..a3d93ccb8 100644 --- a/app/views/wiki/show.html.haml +++ b/app/views/wiki/show.html.haml @@ -1,29 +1,29 @@ -=# render :partial => 'gollum_includes' -=# render :partial => 'project_short' -= render :partial => 'projects/submenu' +/ = render 'gollum_includes' +/ = render 'project_short' += render 'projects/submenu' %h3.wiki = @page.name - = "(#{t("layout.wiki.preview")})" if action_name == 'preview' + = "(#{t("wiki.preview")})" if action_name == 'preview' - unless action_name == 'preview' .r - = link_to t("layout.wiki.page_history"), history_project_wiki_path(@project, escaped_name), :class => 'button width100' + = link_to t("wiki.page_history"), history_project_wiki_path(@project, escaped_name), :class => 'button width100' .r - if @editable - = link_to t("layout.wiki.edit_page"), edit_project_wiki_path(@project, escaped_name), :class => "button width100" + = link_to t("wiki.edit_page"), edit_project_wiki_path(@project, escaped_name), :class => "button width100" .r - if can? :write, @project - = link_to t("layout.wiki.new_page"), '#', :'data-url' => project_wiki_index_path(@project), - :id => 'minibutton-new-page', :class => 'button width100' + = link_to t("wiki.new_page"), '#', :'data-url' => project_wiki_index_path(@project), :id => 'minibutton-new-page', :class => 'button width100' + %br %br %br .both -=# render :partial => 'searchbar' -= render :partial => "page" +/ = render 'searchbar' += render "page" - content_for :sidebar do - - render :partial => 'sidebar' + - render 'sidebar' :css #wiki-content .wrap { width: 100% } diff --git a/config/locales/wiki.en.yml b/config/locales/wiki.en.yml index 316a02ad7..24f5a9511 100644 --- a/config/locales/wiki.en.yml +++ b/config/locales/wiki.en.yml @@ -1,60 +1,65 @@ en: - layout: - 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 + 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 + 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 + 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. diff --git a/config/locales/wiki.ru.yml b/config/locales/wiki.ru.yml index 0ceeb262e..df50dd5e7 100644 --- a/config/locales/wiki.ru.yml +++ b/config/locales/wiki.ru.yml @@ -1,60 +1,65 @@ ru: - layout: - 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: Предпросмотр + 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 + clones: + http: HTTP - editor: - bold: Жирный - italic: Курсив - code: Исходный код - unordered_list: Маркированный список - ordered_list: Нумерованный список - blockquote: Цитата - horizontal_rule: Горизонтальная черта - h1: Заголовок первого уровня - h2: Заголовок второго уровня - h3: Заголовок третьего уровня - link: Ссылка - image: Изображение - help: Помощь + editor: + bold: Жирный + italic: Курсив + code: Исходный код + unordered_list: Маркированный список + ordered_list: Нумерованный список + blockquote: Цитата + horizontal_rule: Горизонтальная черта + h1: Заголовок первого уровня + h2: Заголовок второго уровня + h3: Заголовок третьего уровня + link: Ссылка + image: Изображение + help: Помощь + seed: + welcome_content: | + # Добро пожаловать в **Wiki** # + Отредактируйте эту страницу и создайте новые. diff --git a/config/locales/wiki_welcome.en.yml b/config/locales/wiki_welcome.en.yml deleted file mode 100644 index ef246fda5..000000000 --- a/config/locales/wiki_welcome.en.yml +++ /dev/null @@ -1,7 +0,0 @@ -en: - wiki: - seed: - welcome_content: | - # Welcome to **Wiki** # - - Edit this page and create new ones. diff --git a/config/locales/wiki_welcome.ru.yml b/config/locales/wiki_welcome.ru.yml deleted file mode 100644 index dccfc665b..000000000 --- a/config/locales/wiki_welcome.ru.yml +++ /dev/null @@ -1,7 +0,0 @@ -ru: - wiki: - seed: - welcome_content: | - # Добро пожаловать в **Wiki** # - - Отредактируйте эту страницу и создайте новые.