From 7fb77290c1d051527f8fb1076c17c5678ccd6a02 Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 27 Jun 2013 11:28:09 +0200 Subject: bootstrap menu now has 60 px height - adjust body padding --- app/assets/stylesheets/application.scss | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 3e1b42c..25e854e 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -10,10 +10,10 @@ // import bootstrap. // @import "bootstrap"; -body { - padding: 40px; -} +body { padding-top: 60px; } + @import "bootstrap-responsive"; + table.table-hover .btn { opacity: 0; } -- cgit v1.2.3 From 3f51128e24e1ca3247169066aa6a03090df98dd6 Mon Sep 17 00:00:00 2001 From: elijah Date: Mon, 17 Jun 2013 01:26:35 -0700 Subject: start of new ui - css changes, layout changes, navigation changes. --- app/assets/stylesheets/application.scss | 15 ++---- app/assets/stylesheets/leap.scss | 65 +++++++++++++++++++++++ app/helpers/application_helper.rb | 17 ++++++ app/helpers/navigation_helper.rb | 82 +++++++++++++++++++++++++++++ app/views/home/_home_text.html.haml | 3 ++ app/views/home/index.html.haml | 23 ++++---- app/views/layouts/_footer.html.haml | 0 app/views/layouts/_header.html.haml | 3 ++ app/views/layouts/_masthead.html.haml | 4 ++ app/views/layouts/_masthead_large.html.haml | 3 ++ app/views/layouts/_navigation.html.haml | 17 ++++-- app/views/layouts/application.html.haml | 30 +++++++---- 12 files changed, 229 insertions(+), 33 deletions(-) create mode 100644 app/assets/stylesheets/leap.scss create mode 100644 app/helpers/navigation_helper.rb create mode 100644 app/views/home/_home_text.html.haml create mode 100644 app/views/layouts/_footer.html.haml create mode 100644 app/views/layouts/_header.html.haml create mode 100644 app/views/layouts/_masthead.html.haml create mode 100644 app/views/layouts/_masthead_large.html.haml (limited to 'app') diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 25e854e..5a5e900 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -1,7 +1,7 @@ // // import custom scss, content to be set in deployment. // -@import "tail"; +@import "head"; // First import journal variables @import "bootswatch/cerulean/variables"; @@ -10,17 +10,12 @@ // import bootstrap. // @import "bootstrap"; -body { padding-top: 60px; } - @import "bootstrap-responsive"; -table.table-hover .btn { - opacity: 0; -} -table.table-hover tr:hover .btn { - opacity: 1; -} -@import "bootstrap-editable"; +// +// LEAP web app specific overrides +// +@import "leap"; // And finally bootswatch style itself @import "bootswatch/cerulean/bootswatch"; diff --git a/app/assets/stylesheets/leap.scss b/app/assets/stylesheets/leap.scss new file mode 100644 index 0000000..42638eb --- /dev/null +++ b/app/assets/stylesheets/leap.scss @@ -0,0 +1,65 @@ + +table.table-hover .btn { + opacity: 0; +} +table.table-hover tr:hover .btn { + opacity: 1; +} + +.debug { + outline: 1px solid red; +} + +// +// Icons +// + + +// force a black icon, even if bootstrap thinks differently +.icon-black { + background-image: url(/assets/glyphicons-halflings.png) !important; +} + +// +// Typography +// + +.first { + margin-top: 0; + padding-top: 0; +} + +// +// Boring default masthead +// + +#masthead { + background: #eee; + margin-bottom: 10px; + border-bottom: 1px solid #e6e6e6; + .title { + padding: 20px; + font-size: 1.25em; + } + .sitename { + font-weight: bold; + } +} + +// +// Side Navigation +// + +.sidenav { + @extend .nav-tabs; + @extend .nav-stacked; + box-shadow: 0 2px 4px rgba(0,0,0,.1); + li.active { + a, a:hover { + background-color: $blueDark; + color: $white; + border-color: darken($blueDark, 10%); + cursor: pointer; + } + } +} diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index de6be79..db70109 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,2 +1,19 @@ module ApplicationHelper + + # + # markup for bootstrap icon + # + # http://twitter.github.io/bootstrap/base-css.html#icons + # + def icon(name, color=nil) + if color.nil? + color_class = nil + elsif color == :black + color_class = 'icon-black' + elsif color == :white + color_class = 'icon-white' + end + " ".html_safe + end + end diff --git a/app/helpers/navigation_helper.rb b/app/helpers/navigation_helper.rb new file mode 100644 index 0000000..19cb934 --- /dev/null +++ b/app/helpers/navigation_helper.rb @@ -0,0 +1,82 @@ +module NavigationHelper + + # + # used to create a side navigation link. + # + # Signature is the same as link_to, except it accepts an :active value in the html_options + # + def link_to_navigation(*args) + if args.last.is_a? Hash + html_options = args.pop.dup + active_class = html_options.delete(:active) ? 'active' : nil + html_options[:class] = [html_options[:class], active_class].join(' ') + args << html_options + else + active_class = nil + end + content_tag :li, :class => active_class do + link_to(*args) + end + end + + # + # returns true if params[:action] matches one of the args. + # + def action?(*actions) + actions.detect do |action| + if action.is_a? String + action == action_string + elsif action.is_a? Symbol + if action == :none + action_string == nil + else + action == action_symbol + end + end + end + end + + # + # returns true if params[:controller] matches one of the args. + # + # for example: + # controller?(:me, :home) + # controller?('groups/') <-- matches any controller in namespace 'groups' + # + def controller?(*controllers) + controllers.each do |cntr| + if cntr.is_a? String + if cntr.ends_with?('/') + return true if controller_string.starts_with?(cntr.chop) + end + return true if cntr == controller_string + elsif cntr.is_a? Symbol + return true if cntr == controller_symbol + end + end + return false + end + + private + + def controller_string + @controller_string ||= params[:controller].to_s.gsub(/^\//, '') + end + + def controller_symbol + @controller_symbol ||= params[:controller].gsub(/^\//,'').gsub('/','_').to_sym + end + + def action_string + params[:action] + end + + def action_symbol + @action_symbol ||= if params[:action].present? + params[:action].to_sym + else + nil + end + end + +end diff --git a/app/views/home/_home_text.html.haml b/app/views/home/_home_text.html.haml new file mode 100644 index 0000000..1055091 --- /dev/null +++ b/app/views/home/_home_text.html.haml @@ -0,0 +1,3 @@ +Welcome to the LEAP web application. + +For more information, visit #{link_to('leap.se', 'https://leap.se')} \ No newline at end of file diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index c02dcad..0b3bbf9 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -1,11 +1,16 @@ -Try to fetch a -= link_to "cert", cert_path +.row-fluid + .span8 + = render 'home_text' + .span4 + = render '/login_or_signup' -%p -Create a -= link_to "ticket", new_ticket_path +- if Rails.env == 'development' + .row-fluid + %hr + %p + Try to fetch a + = link_to "cert", cert_path -- if logged_in? - %p - See all - = link_to "tickets", tickets_path + %p + Create a + = link_to "ticket", new_ticket_path diff --git a/app/views/layouts/_footer.html.haml b/app/views/layouts/_footer.html.haml new file mode 100644 index 0000000..e69de29 diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml new file mode 100644 index 0000000..aa4054b --- /dev/null +++ b/app/views/layouts/_header.html.haml @@ -0,0 +1,3 @@ +- if user + %strong.user_address + = user.email_address diff --git a/app/views/layouts/_masthead.html.haml b/app/views/layouts/_masthead.html.haml new file mode 100644 index 0000000..280f2c2 --- /dev/null +++ b/app/views/layouts/_masthead.html.haml @@ -0,0 +1,4 @@ +.title + %span.sitename + = APP_CONFIG[:domain] + = t(:user_control_panel) \ No newline at end of file diff --git a/app/views/layouts/_masthead_large.html.haml b/app/views/layouts/_masthead_large.html.haml new file mode 100644 index 0000000..6bb1943 --- /dev/null +++ b/app/views/layouts/_masthead_large.html.haml @@ -0,0 +1,3 @@ +.title + %span.sitename + = APP_CONFIG[:domain] \ No newline at end of file diff --git a/app/views/layouts/_navigation.html.haml b/app/views/layouts/_navigation.html.haml index b75eed7..7cd0f38 100644 --- a/app/views/layouts/_navigation.html.haml +++ b/app/views/layouts/_navigation.html.haml @@ -1,6 +1,13 @@ -= link_to "Leap Web", root_path, :class => 'brand' -%ul.nav - // = render '/tickets/nav' +//= link_to "Leap Web", root_path, :class => 'brand' +//%ul.nav +// // = render '/tickets/nav' +// +//%ul.nav.pull-right +// = render '/sessions/nav' -%ul.nav.pull-right - = render '/sessions/nav' +%ul.nav.sidenav + = link_to_navigation t(:overview), user_overview_path(user), :active => controller?(:overviews) + = link_to_navigation t(:account_settings), edit_user_path(user), :active => controller?(:users) + =# link_to_navigation t(:email_settings), edit_email_path(user), :active => controller?(:emails) + = link_to_navigation t(:support_tickets), tickets_path, :active => controller?(:tickets) + = link_to_navigation t(:logout), logout_path, :method => :delete diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index e6d22f0..719d699 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -9,15 +9,27 @@ = csrf_meta_tags = yield(:head) %body - %header.navbar.navbar-fixed-top - %nav.navbar-inner - .container - = render 'layouts/navigation' - #main{:role => "main"} - .container - .content - .row + #masthead + - if logged_in? + = render 'layouts/masthead' + - else + = render 'layouts/masthead_large' + #main + .container-fluid + - if logged_in? + .row-fluid .span12 + = render 'layouts/header' + .row-fluid + .span2 + = render 'layouts/navigation' + .span10 = render 'layouts/messages' = yield - %footer + - else + .row-fluid + .span12 + = render 'layouts/messages' + = yield + #footer + = render 'layouts/footer' -- cgit v1.2.3 From 8393058ac15d72be702a6de481d6129aed4bbef3 Mon Sep 17 00:00:00 2001 From: elijah Date: Wed, 19 Jun 2013 00:33:19 -0700 Subject: new ui for tickets --- app/assets/stylesheets/leap.scss | 73 ++++++++++++++++++++++++++++++++++------ 1 file changed, 63 insertions(+), 10 deletions(-) (limited to 'app') diff --git a/app/assets/stylesheets/leap.scss b/app/assets/stylesheets/leap.scss index 42638eb..6b44986 100644 --- a/app/assets/stylesheets/leap.scss +++ b/app/assets/stylesheets/leap.scss @@ -6,27 +6,80 @@ table.table-hover tr:hover .btn { opacity: 1; } +.ticket { + td.user { + white-space: nowrap; + } + td.comment { + width: 100%; + } +} + +// +// UTILITY +// + .debug { outline: 1px solid red; } +.full-width { + width: 100%; +} + +.slim { + margin: 0; +} + +.first { + margin-top: 0; + padding-top: 0; +} + // -// Icons +// Typography // +input.large { + font-size: $baseFontSize * 1.25; + line-height: $baseLineHeight * 1.5; +} -// force a black icon, even if bootstrap thinks differently -.icon-black { - background-image: url(/assets/glyphicons-halflings.png) !important; +// +// FORMS +// + +// +// Sometimes we really want full width controls, but this flies in the face of +// what bootstrap does for control sizes, so we have to step on bootstrap's +// toes a bit to make this work. +// +input, textarea { + &.full-width { + height: inherit; + box-sizing: border-box; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + } } // -// Typography +// Labels // -.first { - margin-top: 0; - padding-top: 0; +.label-clear { + background-color: $white; + text-shadow: none; + color: $black; +} + +// +// Icons +// + +// force a black icon, even if bootstrap thinks differently +.icon-black { + background-image: url(/assets/glyphicons-halflings.png) !important; } // @@ -56,9 +109,9 @@ table.table-hover tr:hover .btn { box-shadow: 0 2px 4px rgba(0,0,0,.1); li.active { a, a:hover { - background-color: $blueDark; + background-color: $linkColor; color: $white; - border-color: darken($blueDark, 10%); + border-color: darken($linkColor, 0%); cursor: pointer; } } -- cgit v1.2.3 From 1157caf42ebd9ccfd25c455115abfa79bcf90e03 Mon Sep 17 00:00:00 2001 From: elijah Date: Wed, 19 Jun 2013 00:34:11 -0700 Subject: remove gem bootstrap-editable --- app/assets/javascripts/application.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 049a392..ad4dbbf 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -14,8 +14,8 @@ //= require jquery_ujs //= require srp //= require bootstrap -//= require bootstrap-editable -//= require bootstrap-editable-rails +//# require bootstrap-editable +//# require bootstrap-editable-rails //= require rails.validations //= require rails.validations.simple_form -- cgit v1.2.3 From 1dcec6ed912b075f5bdaa069bb5725b0ff06fe41 Mon Sep 17 00:00:00 2001 From: elijah Date: Wed, 19 Jun 2013 00:36:02 -0700 Subject: added html_title helper - use @title to set page title. --- app/helpers/application_helper.rb | 13 +++++++++++++ app/views/layouts/application.html.haml | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index db70109..a236a0a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,5 +1,18 @@ module ApplicationHelper + # + # determine title for the page + # + def html_title + if content_for?(:title) + yield(:title) + elsif @title + [@title, ' - ', APP_CONFIG[:domain]].join + else + APP_CONFIG[:domain] + end + end + # # markup for bootstrap icon # diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 719d699..71364fc 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -2,7 +2,7 @@ %html %head %meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"} - %title= content_for?(:title) ? yield(:title) : "Leap Web" + %title= html_title %meta{:content => content_for?(:description) ? yield(:description) : "Leap Web", :name => "description"} = stylesheet_link_tag "application", :media => "all" = javascript_include_tag "application" -- cgit v1.2.3 From 93999b107fff7275970012c3f12c6877d2b16d6e Mon Sep 17 00:00:00 2001 From: elijah Date: Wed, 19 Jun 2013 00:36:16 -0700 Subject: redirect to overview if authenticated --- app/controllers/home_controller.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'app') diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 4e1983a..120541e 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -1,6 +1,9 @@ class HomeController < ApplicationController def index + if logged_in? + redirect_to user_overview_url(current_user) + end debugger if params[:debug] end end -- cgit v1.2.3 From e5a37b4ed76df8aec6131789e7361ed6efa3394b Mon Sep 17 00:00:00 2001 From: elijah Date: Sun, 23 Jun 2013 22:18:28 -0700 Subject: new home page --- app/assets/stylesheets/leap.scss | 22 ++++++++++ app/helpers/navigation_helper.rb | 82 ------------------------------------- app/views/home/_home_text.html.haml | 7 +++- app/views/home/index.html.haml | 12 +++--- 4 files changed, 34 insertions(+), 89 deletions(-) delete mode 100644 app/helpers/navigation_helper.rb (limited to 'app') diff --git a/app/assets/stylesheets/leap.scss b/app/assets/stylesheets/leap.scss index 6b44986..a7d6261 100644 --- a/app/assets/stylesheets/leap.scss +++ b/app/assets/stylesheets/leap.scss @@ -45,6 +45,10 @@ input.large { line-height: $baseLineHeight * 1.5; } +.p { + @extend p; +} + // // FORMS // @@ -99,6 +103,24 @@ input, textarea { } } +.home-buttons { + .span6 { + margin-bottom: 20px; + } + div { + a { + width: 10em; + margin-bottom: 4px; + display: block; + } + .info { + } + span { + } + } +} + + // // Side Navigation // diff --git a/app/helpers/navigation_helper.rb b/app/helpers/navigation_helper.rb deleted file mode 100644 index 19cb934..0000000 --- a/app/helpers/navigation_helper.rb +++ /dev/null @@ -1,82 +0,0 @@ -module NavigationHelper - - # - # used to create a side navigation link. - # - # Signature is the same as link_to, except it accepts an :active value in the html_options - # - def link_to_navigation(*args) - if args.last.is_a? Hash - html_options = args.pop.dup - active_class = html_options.delete(:active) ? 'active' : nil - html_options[:class] = [html_options[:class], active_class].join(' ') - args << html_options - else - active_class = nil - end - content_tag :li, :class => active_class do - link_to(*args) - end - end - - # - # returns true if params[:action] matches one of the args. - # - def action?(*actions) - actions.detect do |action| - if action.is_a? String - action == action_string - elsif action.is_a? Symbol - if action == :none - action_string == nil - else - action == action_symbol - end - end - end - end - - # - # returns true if params[:controller] matches one of the args. - # - # for example: - # controller?(:me, :home) - # controller?('groups/') <-- matches any controller in namespace 'groups' - # - def controller?(*controllers) - controllers.each do |cntr| - if cntr.is_a? String - if cntr.ends_with?('/') - return true if controller_string.starts_with?(cntr.chop) - end - return true if cntr == controller_string - elsif cntr.is_a? Symbol - return true if cntr == controller_symbol - end - end - return false - end - - private - - def controller_string - @controller_string ||= params[:controller].to_s.gsub(/^\//, '') - end - - def controller_symbol - @controller_symbol ||= params[:controller].gsub(/^\//,'').gsub('/','_').to_sym - end - - def action_string - params[:action] - end - - def action_symbol - @action_symbol ||= if params[:action].present? - params[:action].to_sym - else - nil - end - end - -end diff --git a/app/views/home/_home_text.html.haml b/app/views/home/_home_text.html.haml index 1055091..4de4b5e 100644 --- a/app/views/home/_home_text.html.haml +++ b/app/views/home/_home_text.html.haml @@ -1,3 +1,6 @@ -Welcome to the LEAP web application. +%h1= t(:welcome, :provider => APP_CONFIG[:domain]) -For more information, visit #{link_to('leap.se', 'https://leap.se')} \ No newline at end of file +%p + We provide secure communication services, including encrypted internet, email (coming soon), and chat (coming later). + += home_page_buttons diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index 0b3bbf9..96a3aee 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -1,8 +1,10 @@ -.row-fluid - .span8 - = render 'home_text' - .span4 - = render '/login_or_signup' +/ .row-fluid +/ .span8 +/ = render 'home_text' +/ .span4 +/ = render '/login_or_signup' + += render 'home_text' - if Rails.env == 'development' .row-fluid -- cgit v1.2.3 From 4863ce5e78d880f1ca8a1874cd03022afb061f4a Mon Sep 17 00:00:00 2001 From: elijah Date: Fri, 28 Jun 2013 20:38:14 -0700 Subject: new layout for the home buttons --- app/assets/stylesheets/leap.scss | 112 +++++++++++++++++---------- app/controllers/application_controller.rb | 12 +++ app/helpers/application_helper.rb | 8 ++ app/views/home/_home_text.html.haml | 6 -- app/views/home/index.html.haml | 11 ++- app/views/layouts/_masthead_large.html.haml | 3 - app/views/layouts/_masthead_noauth.html.haml | 3 + app/views/layouts/_messages.html.haml | 2 +- app/views/layouts/application.html.haml | 4 +- 9 files changed, 102 insertions(+), 59 deletions(-) delete mode 100644 app/views/home/_home_text.html.haml delete mode 100644 app/views/layouts/_masthead_large.html.haml create mode 100644 app/views/layouts/_masthead_noauth.html.haml (limited to 'app') diff --git a/app/assets/stylesheets/leap.scss b/app/assets/stylesheets/leap.scss index a7d6261..577d211 100644 --- a/app/assets/stylesheets/leap.scss +++ b/app/assets/stylesheets/leap.scss @@ -1,27 +1,24 @@ +// +// LAYOUT +// -table.table-hover .btn { - opacity: 0; -} -table.table-hover tr:hover .btn { - opacity: 1; -} - -.ticket { - td.user { - white-space: nowrap; - } - td.comment { - width: 100%; - } +// This is a trick to be able to use bootstrap fluid layout and also have a max-width. +// It is like having your cake and eating it too. +#main { + *zoom: 1; + margin-left: auto; + margin-right: auto; + width: 1000px; + max-width: 100%; } // // UTILITY // -.debug { - outline: 1px solid red; -} +//.debug { +// outline: 1px solid red; +//} .full-width { width: 100%; @@ -36,8 +33,35 @@ table.table-hover tr:hover .btn { padding-top: 0; } +.last { + margin-bottom: 0; + padding-bottom: 0; +} + // -// Typography +// ICONS +// + +[class^="big-icon-"], +[class*=" big-icon-"] { + display: inline-block; + width: 32px; + height: 32px; + @include ie7-restore-right-whitespace(); + line-height: 32px; + vertical-align: middle; + //background-image: $iconSpritePath; + //background-position: 14px 14px; + background-repeat: no-repeat; + margin-top: 1px; +} + +.big-icon-arrow-down { + background-image: url(/img/32/arrow-down.png) +} + +// +// TYPOGRAPHY // input.large { @@ -50,7 +74,7 @@ input.large { } // -// FORMS +// BOOSTRAP TWEAKS // // @@ -67,27 +91,33 @@ input, textarea { } } -// -// Labels -// - +// like a label, but with no background .label-clear { background-color: $white; text-shadow: none; color: $black; } -// -// Icons -// - // force a black icon, even if bootstrap thinks differently .icon-black { background-image: url(/assets/glyphicons-halflings.png) !important; } // -// Boring default masthead +// TICKETS +// + +.ticket { + td.user { + white-space: nowrap; + } + td.comment { + width: 100%; + } +} + +// +// BORING DEFAULT MASTHEAD // #masthead { @@ -104,25 +134,25 @@ input, textarea { } .home-buttons { - .span6 { - margin-bottom: 20px; + text-align: center; + .first { + margin: 20px 0; } - div { - a { - width: 10em; - margin-bottom: 4px; - display: block; - } - .info { - } - span { + .download { + a.btn { + width: 14em; } } + a.btn { + font-weight: bold; + width: 11em; + margin: 10px auto; + display: block; + } } - // -// Side Navigation +// SIDE NAVIGATION // .sidenav { diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 06b245a..62d9df2 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -3,4 +3,16 @@ class ApplicationController < ActionController::Base ActiveSupport.run_load_hooks(:application_controller, self) + protected + + # + # Allows us to pass through bold text to flash messages. See format_flash() for where this is reversed. + # + # TODO: move to core + # + def bold(str) + "[b]#{str}[/b]" + end + helper_method :bold + end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a236a0a..1e79990 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -29,4 +29,12 @@ module ApplicationHelper " ".html_safe end + def big_icon(name, color=nil) + " ".html_safe + end + + def format_flash(msg) + html_escape(msg).gsub('[b]', '').gsub('[/b]', '').html_safe + end + end diff --git a/app/views/home/_home_text.html.haml b/app/views/home/_home_text.html.haml deleted file mode 100644 index 4de4b5e..0000000 --- a/app/views/home/_home_text.html.haml +++ /dev/null @@ -1,6 +0,0 @@ -%h1= t(:welcome, :provider => APP_CONFIG[:domain]) - -%p - We provide secure communication services, including encrypted internet, email (coming soon), and chat (coming later). - -= home_page_buttons diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index 96a3aee..9da66a1 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -1,10 +1,9 @@ -/ .row-fluid -/ .span8 -/ = render 'home_text' -/ .span4 -/ = render '/login_or_signup' +%h1= t(:welcome, :provider => APP_CONFIG[:domain]) -= render 'home_text' +%p + We provide secure communication services, including encrypted internet, email (coming soon), and chat (coming later). + += home_page_buttons - if Rails.env == 'development' .row-fluid diff --git a/app/views/layouts/_masthead_large.html.haml b/app/views/layouts/_masthead_large.html.haml deleted file mode 100644 index 6bb1943..0000000 --- a/app/views/layouts/_masthead_large.html.haml +++ /dev/null @@ -1,3 +0,0 @@ -.title - %span.sitename - = APP_CONFIG[:domain] \ No newline at end of file diff --git a/app/views/layouts/_masthead_noauth.html.haml b/app/views/layouts/_masthead_noauth.html.haml new file mode 100644 index 0000000..6bb1943 --- /dev/null +++ b/app/views/layouts/_masthead_noauth.html.haml @@ -0,0 +1,3 @@ +.title + %span.sitename + = APP_CONFIG[:domain] \ No newline at end of file diff --git a/app/views/layouts/_messages.html.haml b/app/views/layouts/_messages.html.haml index 80e34d4..a3bbbac 100644 --- a/app/views/layouts/_messages.html.haml +++ b/app/views/layouts/_messages.html.haml @@ -2,4 +2,4 @@ - if msg.is_a?(String) %div{:class => "alert alert-#{name == :notice ? "success" : "error"}"} %a.close{"data-dismiss" => "alert"} × - = content_tag :div, msg, :id => "flash_#{name}" + = content_tag :div, format_flash(msg), :id => "flash_#{name}" diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 71364fc..e185f26 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -12,8 +12,8 @@ #masthead - if logged_in? = render 'layouts/masthead' - - else - = render 'layouts/masthead_large' + - elsif params[:controller] != 'home' + = render 'layouts/masthead_noauth' #main .container-fluid - if logged_in? -- cgit v1.2.3 From e996432cbd50f4dadaae0ff62ac3f286ab125b1f Mon Sep 17 00:00:00 2001 From: elijah Date: Tue, 2 Jul 2013 23:11:23 -0700 Subject: add js to report all errors to the user, not just ones related to field validation. --- app/assets/javascripts/application.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'app') diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index ad4dbbf..cd90934 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -14,11 +14,10 @@ //= require jquery_ujs //= require srp //= require bootstrap -//# require bootstrap-editable -//# require bootstrap-editable-rails //= require rails.validations //= require rails.validations.simple_form +//= require leap //= require tickets //= require users -- cgit v1.2.3 From b8c44acfa5b1fbc8b35e812bd6c23aa6d824c4b1 Mon Sep 17 00:00:00 2001 From: elijah Date: Tue, 2 Jul 2013 23:19:38 -0700 Subject: cleaned up application layout and some minor css. --- app/assets/stylesheets/leap.scss | 13 ++++++++++--- app/views/layouts/_content.html.haml | 19 +++++++++++++++++++ app/views/layouts/_header.html.haml | 10 ++++++++-- app/views/layouts/_messages.html.haml | 11 ++++++----- app/views/layouts/application.html.haml | 14 +++----------- 5 files changed, 46 insertions(+), 21 deletions(-) create mode 100644 app/views/layouts/_content.html.haml (limited to 'app') diff --git a/app/assets/stylesheets/leap.scss b/app/assets/stylesheets/leap.scss index 577d211..4a3ca03 100644 --- a/app/assets/stylesheets/leap.scss +++ b/app/assets/stylesheets/leap.scss @@ -38,6 +38,10 @@ padding-bottom: 0; } +.hidden { + display: none; +} + // // ICONS // @@ -50,8 +54,6 @@ @include ie7-restore-right-whitespace(); line-height: 32px; vertical-align: middle; - //background-image: $iconSpritePath; - //background-position: 14px 14px; background-repeat: no-repeat; margin-top: 1px; } @@ -74,7 +76,7 @@ input.large { } // -// BOOSTRAP TWEAKS +// BOOTSTRAP TWEAKS // // @@ -155,6 +157,11 @@ input, textarea { // SIDE NAVIGATION // +.user_heading { + margin: 1em 0; + font-weight: bold; +} + .sidenav { @extend .nav-tabs; @extend .nav-stacked; diff --git a/app/views/layouts/_content.html.haml b/app/views/layouts/_content.html.haml new file mode 100644 index 0000000..19af627 --- /dev/null +++ b/app/views/layouts/_content.html.haml @@ -0,0 +1,19 @@ +-# +-# Partial for displaying the page content. This is the only place that content should be displayed. +-# + +- if content_for?(:content) + - content = yield(:content) +- else + - content = yield + +- if @show_navigation + .span2 + = render 'layouts/navigation' + .span10 + = render 'layouts/messages' + = content +- else + .span12 + = render 'layouts/messages' + = content diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index aa4054b..854ab40 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -1,3 +1,9 @@ -- if user - %strong.user_address +- if admin? + %ul.nav.nav-tabs + %li{:class => ("active" if controller?('users', 'email_settings', 'overviews') || params[:user_id])} + = link_to t(:users), users_path + %li{:class => ("active" if controller?('tickets') && !params[:user_id])} + = link_to t(:tickets), tickets_path +- if user && @show_navigation + .user_heading = user.email_address diff --git a/app/views/layouts/_messages.html.haml b/app/views/layouts/_messages.html.haml index a3bbbac..7ff985f 100644 --- a/app/views/layouts/_messages.html.haml +++ b/app/views/layouts/_messages.html.haml @@ -1,5 +1,6 @@ -- flash.each do |name, msg| - - if msg.is_a?(String) - %div{:class => "alert alert-#{name == :notice ? "success" : "error"}"} - %a.close{"data-dismiss" => "alert"} × - = content_tag :div, format_flash(msg), :id => "flash_#{name}" +#messages + - flash.each do |name, msg| + - if msg.is_a?(String) + %div{:class => "alert alert-#{name == :notice ? "success" : "error"}"} + %a.close{"data-dismiss" => "alert"} × + = content_tag :div, format_flash(msg), :id => "flash_#{name}" diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index e185f26..db612b7 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -1,3 +1,4 @@ +- @show_navigation = true if @show_navigation.nil? !!! %html %head @@ -20,16 +21,7 @@ .row-fluid .span12 = render 'layouts/header' - .row-fluid - .span2 - = render 'layouts/navigation' - .span10 - = render 'layouts/messages' - = yield - - else - .row-fluid - .span12 - = render 'layouts/messages' - = yield + .row-fluid + = render 'layouts/content' #footer = render 'layouts/footer' -- cgit v1.2.3 From 0cd386e0144601f5478f90bbdb401d55c019c828 Mon Sep 17 00:00:00 2001 From: elijah Date: Wed, 3 Jul 2013 11:11:10 -0700 Subject: better ticket view navigation: tickets are now either global in scope (for admins) or stay as a nested resource for a particular user (for normal users and when you visit the tickets list of a particular user). --- app/assets/stylesheets/leap.scss | 9 +++++++++ app/views/layouts/_navigation.html.haml | 11 ++--------- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'app') diff --git a/app/assets/stylesheets/leap.scss b/app/assets/stylesheets/leap.scss index 4a3ca03..792aa3c 100644 --- a/app/assets/stylesheets/leap.scss +++ b/app/assets/stylesheets/leap.scss @@ -105,6 +105,15 @@ input, textarea { background-image: url(/assets/glyphicons-halflings.png) !important; } +// override stupid bootstrap behavior of making the active tab appear non-clickable +// and links not being underline +.nav-tabs > li > a:hover, .sidenav > li > a:hover { + text-decoration: underline; +} +.nav-tabs > .active > a:hover { + cursor: pointer; +} + // // TICKETS // diff --git a/app/views/layouts/_navigation.html.haml b/app/views/layouts/_navigation.html.haml index 7cd0f38..cbe6d3a 100644 --- a/app/views/layouts/_navigation.html.haml +++ b/app/views/layouts/_navigation.html.haml @@ -1,13 +1,6 @@ -//= link_to "Leap Web", root_path, :class => 'brand' -//%ul.nav -// // = render '/tickets/nav' -// -//%ul.nav.pull-right -// = render '/sessions/nav' - %ul.nav.sidenav = link_to_navigation t(:overview), user_overview_path(user), :active => controller?(:overviews) = link_to_navigation t(:account_settings), edit_user_path(user), :active => controller?(:users) - =# link_to_navigation t(:email_settings), edit_email_path(user), :active => controller?(:emails) - = link_to_navigation t(:support_tickets), tickets_path, :active => controller?(:tickets) + = link_to_navigation t(:email_settings), edit_user_email_settings_path(user), :active => controller?(:email_settings) + = link_to_navigation t(:support_tickets), auto_tickets_path(user), :active => controller?(:tickets) = link_to_navigation t(:logout), logout_path, :method => :delete -- cgit v1.2.3 From adacb11c8ff6395f38c3c05bea4e6d276285118f Mon Sep 17 00:00:00 2001 From: elijah Date: Thu, 4 Jul 2013 01:35:49 -0700 Subject: help - fix ticket navigation & links (use @user, not user). --- app/views/layouts/_header.html.haml | 6 ++++-- app/views/layouts/_navigation.html.haml | 8 ++++---- app/views/layouts/application.html.haml | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) (limited to 'app') diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index 854ab40..b459545 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -4,6 +4,8 @@ = link_to t(:users), users_path %li{:class => ("active" if controller?('tickets') && !params[:user_id])} = link_to t(:tickets), tickets_path -- if user && @show_navigation + %li + = link_to t(:logout), logout_path, :method => :delete +- if @user && @show_navigation .user_heading - = user.email_address + = @user.email_address diff --git a/app/views/layouts/_navigation.html.haml b/app/views/layouts/_navigation.html.haml index cbe6d3a..b42c1fe 100644 --- a/app/views/layouts/_navigation.html.haml +++ b/app/views/layouts/_navigation.html.haml @@ -1,6 +1,6 @@ %ul.nav.sidenav - = link_to_navigation t(:overview), user_overview_path(user), :active => controller?(:overviews) - = link_to_navigation t(:account_settings), edit_user_path(user), :active => controller?(:users) - = link_to_navigation t(:email_settings), edit_user_email_settings_path(user), :active => controller?(:email_settings) - = link_to_navigation t(:support_tickets), auto_tickets_path(user), :active => controller?(:tickets) + = link_to_navigation t(:overview), user_overview_path(@user), :active => controller?(:overviews) + = link_to_navigation t(:account_settings), edit_user_path(@user), :active => controller?(:users) + = link_to_navigation t(:email_settings), edit_user_email_settings_path(@user), :active => controller?(:email_settings) + = link_to_navigation t(:support_tickets), auto_tickets_path(@user), :active => controller?(:tickets) = link_to_navigation t(:logout), logout_path, :method => :delete diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index db612b7..d5adca9 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -1,4 +1,4 @@ -- @show_navigation = true if @show_navigation.nil? +- @show_navigation = true if @show_navigation.nil? && logged_in? !!! %html %head -- cgit v1.2.3 From 40830b4b1fa33b9e26dbd500fc08b4b76b58011b Mon Sep 17 00:00:00 2001 From: elijah Date: Thu, 4 Jul 2013 01:36:08 -0700 Subject: minor changes to css and home page. --- app/assets/stylesheets/leap.scss | 8 ++++++++ app/views/home/index.html.haml | 7 +------ 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'app') diff --git a/app/assets/stylesheets/leap.scss b/app/assets/stylesheets/leap.scss index 792aa3c..6268b3b 100644 --- a/app/assets/stylesheets/leap.scss +++ b/app/assets/stylesheets/leap.scss @@ -184,3 +184,11 @@ input, textarea { } } } + +// +// USERS +// + +.overview li { + padding: 6px 0; +} \ No newline at end of file diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index 9da66a1..8c90436 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -9,9 +9,4 @@ .row-fluid %hr %p - Try to fetch a - = link_to "cert", cert_path - - %p - Create a - = link_to "ticket", new_ticket_path + = link_to "fetch a cert", cert_path -- cgit v1.2.3 From 76b26cc26fdb38a96e49702dc5640c91519803df Mon Sep 17 00:00:00 2001 From: elijah Date: Thu, 4 Jul 2013 04:29:04 -0700 Subject: bootswatch is messing up with the bootstrap icons, so i am disabling it for now. --- app/assets/stylesheets/application.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 5a5e900..28206b1 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -4,7 +4,7 @@ @import "head"; // First import journal variables -@import "bootswatch/cerulean/variables"; +// @import "bootswatch/cerulean/variables"; // // import bootstrap. @@ -18,7 +18,7 @@ @import "leap"; // And finally bootswatch style itself -@import "bootswatch/cerulean/bootswatch"; +// @import "bootswatch/cerulean/bootswatch"; // // import custom scss, content to be set in deployment. -- cgit v1.2.3 From 8d158d8472cd4c83ba6fa2f0e4fc080b8936f5de Mon Sep 17 00:00:00 2001 From: elijah Date: Sat, 6 Jul 2013 19:02:47 -0700 Subject: rename /img/ to /icons/ so as to not conflict with existing puppet deploy recipes. --- app/assets/stylesheets/leap.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/assets/stylesheets/leap.scss b/app/assets/stylesheets/leap.scss index 6268b3b..9ed5a9f 100644 --- a/app/assets/stylesheets/leap.scss +++ b/app/assets/stylesheets/leap.scss @@ -59,7 +59,7 @@ } .big-icon-arrow-down { - background-image: url(/img/32/arrow-down.png) + background-image: url(/icons/32/arrow-down.png) } // -- cgit v1.2.3 From 315ccfa22f9747a2cd98bccec18011b62b299960 Mon Sep 17 00:00:00 2001 From: elijah Date: Sat, 6 Jul 2013 23:10:16 -0700 Subject: minor - remove masthead_noauth partial --- app/views/layouts/_masthead_noauth.html.haml | 3 --- app/views/layouts/application.html.haml | 4 +--- 2 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 app/views/layouts/_masthead_noauth.html.haml (limited to 'app') diff --git a/app/views/layouts/_masthead_noauth.html.haml b/app/views/layouts/_masthead_noauth.html.haml deleted file mode 100644 index 6bb1943..0000000 --- a/app/views/layouts/_masthead_noauth.html.haml +++ /dev/null @@ -1,3 +0,0 @@ -.title - %span.sitename - = APP_CONFIG[:domain] \ No newline at end of file diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index d5adca9..380f92d 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -11,10 +11,8 @@ = yield(:head) %body #masthead - - if logged_in? + - if params[:controller] != 'home' = render 'layouts/masthead' - - elsif params[:controller] != 'home' - = render 'layouts/masthead_noauth' #main .container-fluid - if logged_in? -- cgit v1.2.3 From 3113f8b814417a896ad5340fda88927733f8ab22 Mon Sep 17 00:00:00 2001 From: elijah Date: Sun, 7 Jul 2013 00:21:54 -0700 Subject: move icon path -- it turns out /icons/ is used by apache in most default installations, so leap's icons moved to /leap-img/ --- app/assets/stylesheets/leap.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/assets/stylesheets/leap.scss b/app/assets/stylesheets/leap.scss index 9ed5a9f..b382773 100644 --- a/app/assets/stylesheets/leap.scss +++ b/app/assets/stylesheets/leap.scss @@ -59,7 +59,7 @@ } .big-icon-arrow-down { - background-image: url(/icons/32/arrow-down.png) + background-image: url(/leap-img/32/arrow-down.png) } // -- cgit v1.2.3