Class: Precious::Views::Layout

Inherits:
Mustache
  • Object
show all
Extended by:
TemplateCascade
Includes:
AppHelpers, LocaleHelpers, OcticonHelpers, RouteHelpers, SprocketsHelpers, Sprockets::Helpers
Defined in:
lib/gollum/views/layout.rb

Direct Known Subclasses

Compare, Create, Edit, Error, History, LatestChanges, Overview, Page, Search

Constant Summary

Constants included from RouteHelpers

RouteHelpers::ROUTES

Constants included from LocaleHelpers

Precious::Views::LocaleHelpers::NO_METHOD_MESSAGE, Precious::Views::LocaleHelpers::YAML_VARIABLE_REGEXP

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from TemplateCascade

first_path_available, template_file, template_priority_path, template_priority_path=

Methods included from OcticonHelpers

included, #octicon, #rocticon, #rocticon_css

Methods included from RouteHelpers

#clean_url, included, #page_route, parse_routes

Methods included from SprocketsHelpers

included, #sprockets_asset_path, #sprockets_image_path, #sprockets_javascript_tag, #sprockets_stylesheet_tag

Methods included from LocaleHelpers

#t

Methods included from AppHelpers

#extract_page_dir

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



13
14
15
# File 'lib/gollum/views/layout.rb', line 13

def name
  @name
end

#pathObject (readonly)

Returns the value of attribute path.



13
14
15
# File 'lib/gollum/views/layout.rb', line 13

def path
  @path
end

Instance Method Details

#base_urlObject



40
41
42
# File 'lib/gollum/views/layout.rb', line 40

def base_url
  @base_url
end

#critic_markupObject



72
73
74
# File 'lib/gollum/views/layout.rb', line 72

def critic_markup
  @critic_markup
end

#cssObject

custom css



64
65
66
# File 'lib/gollum/views/layout.rb', line 64

def css # custom css
  @css
end

#custom_cssObject



48
49
50
# File 'lib/gollum/views/layout.rb', line 48

def custom_css
  clean_url(custom_path, "custom.css")
end

#custom_jsObject



52
53
54
# File 'lib/gollum/views/layout.rb', line 52

def custom_js
  clean_url(custom_path, "custom.js")
end

#custom_pathObject



44
45
46
# File 'lib/gollum/views/layout.rb', line 44

def custom_path
  @base_url
end

#escaped_nameObject



28
29
30
# File 'lib/gollum/views/layout.rb', line 28

def escaped_name
  CGI.escape(@name)
end

#has_pathObject



36
37
38
# File 'lib/gollum/views/layout.rb', line 36

def has_path
  !@path.nil?
end

#historyObject



89
90
91
# File 'lib/gollum/views/layout.rb', line 89

def history
  false
end

#jsObject

custom js



68
69
70
# File 'lib/gollum/views/layout.rb', line 68

def js # custom js
  @js
end

#latest_changesObject



97
98
99
# File 'lib/gollum/views/layout.rb', line 97

def latest_changes
  false
end

#mathjax_config_pathObject



56
57
58
# File 'lib/gollum/views/layout.rb', line 56

def mathjax_config_path
  page_route(@mathjax_config)
end

#mathjax_jsObject



60
61
62
# File 'lib/gollum/views/layout.rb', line 60

def mathjax_js
  "#{page_route('gollum/assets/mathjax/MathJax.js')}?config=TeX-AMS-MML_HTMLorMML"
end

#overviewObject



93
94
95
# File 'lib/gollum/views/layout.rb', line 93

def overview
  false
end

#partial(name) ⇒ Object

Method should track lib/mustache.rb from Mustache project.



18
19
20
21
22
23
24
25
26
# File 'lib/gollum/views/layout.rb', line 18

def partial(name)
  path = self.class.first_path_available(name)
  begin
    File.read(path)
  rescue
    raise if raise_on_context_miss?
    ""
  end
end

#per_page_uploadsObject



76
77
78
# File 'lib/gollum/views/layout.rb', line 76

def per_page_uploads
  @per_page_uploads
end

#searchObject

Navigation bar



85
86
87
# File 'lib/gollum/views/layout.rb', line 85

def search
  false
end

#show_local_timeObject



80
81
82
# File 'lib/gollum/views/layout.rb', line 80

def show_local_time
  @show_local_time ? 'true' : 'false'
end

#titleObject



32
33
34
# File 'lib/gollum/views/layout.rb', line 32

def title
  "Home"
end