Skip to content

Commit

Permalink
option for setting the page_title
Browse files Browse the repository at this point in the history
  • Loading branch information
zlorfi committed Apr 4, 2013
1 parent 415b667 commit 5de6ba4
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- install `memcached` for production caching
- `bundle exec shotgun config.ru` for development (a bit of a warning, `rack_flash` doesn't seem to work with `shotgun`)
- `bundle exec puma config.ru` for production
- change the setting of `title`, `username` and `password` and most important `token`

## TODO
- image handler exception
Expand Down
5 changes: 5 additions & 0 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class App < Sinatra::Base
#necessary for the DELETE route
use Rack::MethodOverride

set :title, 'Sinatra Gallery'
set :username,'gallery'
set :password,'gallery'
# make this a huge random number
Expand Down Expand Up @@ -104,6 +105,10 @@ def raw(text)
Rack::Utils.escape_html(text)
end

def page_title
settings.title
end

end

get "/stylesheets/*.css" do |path|
Expand Down
1 change: 1 addition & 0 deletions public/javascripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ $(document).ready(function() {
$('.alert-box.success').delay(5000).fadeOut(500);
$('.alert-box.notice').delay(5000).fadeOut(500);
$('.alert-box.alert').delay(9000).fadeOut(500);
$('#progress_bar').hide();
});
2 changes: 0 additions & 2 deletions views/index.haml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
:javascript
$(document).ready(function() {

//$('#gallery img').addClass('animated flipInY');

//$("select#customDropdown").change(function(){
// /* get new nº of items per page */
// if ($.isNumeric(parseInt( $(this).val() ))) {
Expand Down
2 changes: 1 addition & 1 deletion views/layout.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
%meta{:charset => "utf-8"}/
/ Set the viewport width to device width for mobile
%meta{:content => "width=device-width", :name => "viewport"}/
%title Sinatra Gallery
%title= page_title
/ Included CSS Files
%link{:href => asset_stylesheet('app'), :rel => "stylesheet"}

Expand Down
2 changes: 1 addition & 1 deletion views/top_nav.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%h3.subheader
%i.icon-camera-retro.icon-large
%a.title{:href => "/"}
Sinatra Gallery
= page_title

.large-6.columns
%ul.inline-list.right
Expand Down
2 changes: 1 addition & 1 deletion views/top_nav_alt.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
%h1.subheader
%a{:href => "/"}
%i.icon-camera-retro.icon-large
Sinatra Gallery
= page_title
/ Remove the class "menu-icon" to get rid of menu icon. Take out "Menu" to just have icon alone
%li.toggle-topbar.menu-icon
%a{:href => "/"}
Expand Down
1 change: 0 additions & 1 deletion views/upload.haml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
%script{:src => asset_javascript('jquery.fileupload'), :type => "text/javascript"}
:javascript
$(document).ready(function() {
$('#progress_bar').hide();

$('#file_upload').fileupload({
autoUpload: true,
Expand Down

0 comments on commit 5de6ba4

Please sign in to comment.