From 2681a01bcf1230cc54764db4c40d12befb4c48a7 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 14 Mar 2013 22:57:38 +0200 Subject: [PATCH] add resize button for better wiki reading --- app/assets/javascripts/main.js.coffee | 6 +++++ app/views/commits/_diffs.html.haml | 2 +- app/views/wikis/edit.html.haml | 1 - app/views/wikis/show.html.haml | 32 ++++++++++++++------------- 4 files changed, 24 insertions(+), 17 deletions(-) diff --git a/app/assets/javascripts/main.js.coffee b/app/assets/javascripts/main.js.coffee index d707657d..8d139f2e 100644 --- a/app/assets/javascripts/main.js.coffee +++ b/app/assets/javascripts/main.js.coffee @@ -53,6 +53,12 @@ $ -> $('.trigger-submit').on 'change', -> $(@).parents('form').submit() + # Wiki resizer + $('.wiki-fullscreen').on 'click', -> + $('.writeboards-menu').toggleClass('hide') + $('.writeboards-content').toggleClass('span9').toggleClass('span12') + + # Flash if (flash = $(".flash-container")).length > 0 flash.click -> $(@).fadeOut() diff --git a/app/views/commits/_diffs.html.haml b/app/views/commits/_diffs.html.haml index 76f9f267..b2da4796 100644 --- a/app/views/commits/_diffs.html.haml +++ b/app/views/commits/_diffs.html.haml @@ -25,7 +25,7 @@ %span= diff.old_path - if @commit.prev_commit - = link_to project_tree_path(@project, tree_join(@commit.prev_commit_id, diff.new_path)), {:class => 'btn pull-right view-file'} do + = link_to project_tree_path(@project, tree_join(@commit.prev_commit_id, diff.new_path)), {:class => 'btn btn-tiny pull-right view-file'} do View file @ %span.commit-short-id= @commit.short_id(6) - else diff --git a/app/views/wikis/edit.html.haml b/app/views/wikis/edit.html.haml index 0f879334..501ba092 100644 --- a/app/views/wikis/edit.html.haml +++ b/app/views/wikis/edit.html.haml @@ -1,5 +1,4 @@ %h3.page_title Editing page -%hr = render 'form' .pull-right diff --git a/app/views/wikis/show.html.haml b/app/views/wikis/show.html.haml index 694b046a..7984c61c 100644 --- a/app/views/wikis/show.html.haml +++ b/app/views/wikis/show.html.haml @@ -1,25 +1,27 @@ .row - .span3 + .span3.writeboards-menu = render 'writeboards/nav' - .span9 - %h3.page_title - = @wiki.title - %span.pull-right - = link_to pages_project_wikis_path(@project), class: "btn btn-small grouped" do - Pages - - if can? current_user, :write_wiki, @project - = link_to history_project_wiki_path(@project, @wiki), class: "btn btn-small grouped" do - History - = link_to edit_project_wiki_path(@project, @wiki), class: "btn btn-small grouped" do - %i.icon-edit - Edit - %br + .span9.writeboards-content - if @wiki != @most_recent_wiki - .warning_message + .alert This is an old version of this page. You can view the #{link_to "most recent version", project_wiki_path(@project, @wiki)} or browse the #{link_to "history", history_project_wiki_path(@project, @wiki)}. .file_holder + .file_title + = link_to '#', class: 'wiki-fullscreen' do + %i.icon-resize-horizontal + = @wiki.title + %span.options + = link_to pages_project_wikis_path(@project), class: "btn btn-tiny grouped" do + Pages + - if can? current_user, :write_wiki, @project + = link_to history_project_wiki_path(@project, @wiki), class: "btn btn-tiny grouped" do + History + = link_to edit_project_wiki_path(@project, @wiki), class: "btn btn-tiny grouped" do + %i.icon-edit + Edit + .file_content.wiki = preserve do = markdown @wiki.content