diff --git a/app/views/apps/show.html.haml b/app/views/apps/show.html.haml index 29adda0..95625b1 100644 --- a/app/views/apps/show.html.haml +++ b/app/views/apps/show.html.haml @@ -1,6 +1,7 @@ - content_for :title, @app.name - content_for :head do = auto_discovery_link_tag :atom, app_url(@app, User.token_authentication_key => current_user.authentication_token, :format => "atom"), :title => "Errbit notices for #{@app.name} at #{root_url}" + = javascript_include_tag 'apps.show' - content_for :meta do %strong Errs Caught: = @app.errs.count @@ -17,52 +18,61 @@ - else = link_to 'all errs', app_path(@app, {all_errs: true}), :class => 'button' -%h3 Watchers -%table.watchers - %thead - %tr - %th User or Email - %tbody - - @app.watchers.each do |watcher| - %tr - %td= watcher.label - - if @app.watchers.none? - %tr - %td - %em Sadly, no one is watching this app - -- if @app.github_url? - %h3 Repository - %table.repository +%h3{:id => 'watchers_toggle'} + Watchers + %span{:class => 'click_span'} (show/hide) +#watchers_div + %table.watchers %thead %tr - %th GitHub + %th User or Email %tbody - %tr - %td= link_to(@app.github_url, @app.github_url, :target => '_blank') + - @app.watchers.each do |watcher| + %tr + %td= watcher.label + - if @app.watchers.none? + %tr + %td + %em Sadly, no one is watching this app -%h3 Latest Deploys -- if @deploys.any? - %table.deploys - %thead - %tr - %th When - %th Who - %th Message - %th Repository - %th Revision +- if @app.github_url? + %h3{:id => 'repository_toggle'} + Repository + %span{:class => 'click_span'} (show/hide) + #repository_div + %table.repository + %thead + %tr + %th GitHub + %tbody + %tr + %td= link_to(@app.github_url, @app.github_url, :target => '_blank') - %tbody - - @deploys.each do |deploy| +%h3{:id => 'deploys_toggle'} + Latest Deploys + %span{:class => 'click_span'} (show/hide) +#deploys_div + - if @deploys.any? + %table.deploys + %thead %tr - %td.when #{deploy.created_at.to_s(:micro)} - %td.who #{deploy.username} - %td.message #{deploy.message} - %td.repository #{deploy.repository} - %td.revision #{deploy.revision} - = link_to "All Deploys (#{@app.deploys.count})", app_deploys_path(@app), :class => 'button' -- else - %h3 No deploys + %th When + %th Who + %th Message + %th Repository + %th Revision + + %tbody + - @deploys.each do |deploy| + %tr + %td.when #{deploy.created_at.to_s(:micro)} + %td.who #{deploy.username} + %td.message #{deploy.message} + %td.repository #{deploy.repository} + %td.revision #{deploy.revision} + = link_to "All Deploys (#{@app.deploys.count})", app_deploys_path(@app), :class => 'button' + - else + %h3 No deploys - if @app.errs.count > 0 %h3.clear Errs diff --git a/public/javascripts/apps.show.js b/public/javascripts/apps.show.js new file mode 100644 index 0000000..2300d81 --- /dev/null +++ b/public/javascripts/apps.show.js @@ -0,0 +1,11 @@ +$(function() { + $("#watchers_toggle").click(function() { + $("#watchers_div").slideToggle("slow"); + }); + $("#repository_toggle").click(function() { + $("#repository_div").slideToggle("slow"); + }); + $("#deploys_toggle").click(function() { + $("#deploys_div").slideToggle("slow"); + }); +}); diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 08f6ee4..a5850f1 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -660,3 +660,11 @@ table.backtrace li.in-app { color: #2adb2e; background-color: #2f2f2f; } + +span.click_span { + font-size: 0.7em; +} + +#deploys_div, #repository_div, #watchers_div { + display: none; +} -- libgit2 0.21.2