Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesign banner and mobile menu bar #280

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/rdoc/generator/template/rails/_context.rhtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="content">
<div id="context">
<% unless (description = context.description).empty? %>
<% unless context.comment_title %>
<h1><%= context.title %></h1>
Expand Down
47 changes: 28 additions & 19 deletions lib/rdoc/generator/template/rails/_panel.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,34 @@
<div id="version-badge"><%= project_version %></div>
<% end %>

<input type="checkbox" id="hamburger" class="panel_checkbox">
<label class="panel_mobile_button" for="hamburger"><span></span> Menu</label>
<nav class="panel panel_tree" id="panel" data-turbo-permanent>
<div class="logo">
<a href="/">
<img width="300" src="/i/logo.svg" alt="<%= project_name %>">
</a>
<nav id="panel" class="panel">
<div class="banner">
<div class="banner__segment">
<label class="banner__menu-button" for="panel__state"></label>
</div>
<div class="banner__segment">
<a class="banner__logo" href="/"><img src="/i/logo.svg" alt="<%= project_name %>"></a>
<span class="banner__version" title="<%= project_git_head %>"><%= project_version %></span>
</div>
</div>
<div class="header">
<input type="text" placeholder="Search (/) for a class, method, ..." autosave="searchdoc" results="10" id="search" autocomplete="off" tabindex="-1" />
<label class="panel_mobile_button_close" for="hamburger"><span></span> Close</label>
</div>
<div class="tree">
<ul>
</ul>
</div>
<div class="result">
<ul>
</ul>

<input id="panel__state" type="checkbox">

<div id="panel__tray" class="panel__tray" data-turbo-permanent>
<input id="search" type="text" autocomplete="off" tabindex="-1" autosave="searchdoc" results="10"
placeholder="Search (/) for a class, method, ...">

<div class="panel__tree">
<div class="result hidden">
<ul>
</ul>
</div>
<div class="tree">
<ul>
</ul>
</div>
</div>

<a id="links" href="links.html">index</a>
</div>
<a href="links.html" id="links">index</a>
</nav>
30 changes: 10 additions & 20 deletions lib/rdoc/generator/template/rails/class.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,21 @@
</head>

<body>
<a class="sr-only sr-only-focusable" href="#content" data-turbo="false">Skip to Content</a>
<a class="sr-only sr-only-focusable" href="#context" data-turbo="false">Skip to Content</a>
<a class="sr-only sr-only-focusable" href="#search" data-turbo="false">Skip to Search</a>

<%= include_template '_panel.rhtml' %>

<div class="banner">
<% if project_name %>
<div>
<%= project_name %>
<span title="<%= project_git_head %>"><%= project_version %></span>
</div>
<% end %>
<main id="content">
<div class="content__full-name">
<span class="qualifier"><%= klass.type %></span>
<%= full_name klass %>
<% if !klass.module? && superclass = klass.superclass %>
<span class="qualifier">&lt;</span>
<%= superclass.is_a?(String) ? full_name(superclass) : link_to(superclass) %>
<% end %>
</div>

<h2>
<span class="type"><%= klass.module? ? 'Module' : 'Class' %></span>
<%= full_name klass %>
<% if klass.type == "class" && superclass = klass.superclass %>
<span class="parent">
&lt; <%= superclass.is_a?(String) ? full_name(superclass) : link_to(superclass) %>
</span>
<% end %>
</h2>
</div>

<main id="bodyContent">
<%= include_template '_context.rhtml', {:context => klass} %>

<div class="sectiontitle">Definition files</div>
Expand Down
30 changes: 9 additions & 21 deletions lib/rdoc/generator/template/rails/file.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,21 @@
</head>

<body>
<a class="sr-only sr-only-focusable" href="#content" data-turbo="false">Skip to Content</a>
<a class="sr-only sr-only-focusable" href="#context" data-turbo="false">Skip to Content</a>
<a class="sr-only sr-only-focusable" href="#search" data-turbo="false">Skip to Search</a>

<%= include_template '_panel.rhtml' %>

<div class="banner">
<% if project_name %>
<div>
<%= project_name %>
<span title="<%= project_git_head %>"><%= project_version %></span>
</div>
<% end %>
<main id="content">
<h1 class="content__full-name">
<span class="qualifier">File</span>
<%= full_name file %>
</h1>

<h2>
<%= h file.name %>
</h2>
<ul class="files">
<li>
<%= full_name file %>
<% if github = github_url(file.relative_name) %>
<a href="<%= github %>" target="_blank" class="github_url">on GitHub</a>
<% end %>
</li>
</ul>
</div>
<% if source_url = github_url(file.relative_name) %>
<p><%= link_to_external "View on GitHub", source_url %></p>
<% end %>

<main id="bodyContent">
<%= include_template '_context.rhtml', {:context => file} %>
</main>
</body>
Expand Down
4 changes: 2 additions & 2 deletions lib/rdoc/generator/template/rails/index.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
</head>

<body>
<a class="sr-only sr-only-focusable" href="#content" data-turbo="false">Skip to Content</a>
<a class="sr-only sr-only-focusable" href="#context" data-turbo="false">Skip to Content</a>
<a class="sr-only sr-only-focusable" href="#search" data-turbo="false">Skip to Search</a>

<%= include_template '_panel.rhtml' %>

<main id="bodyContent">
<main id="content">
<%= include_template '_context.rhtml', {:context => index } %>
</main>
</body>
Expand Down
Loading