Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarshall Cottrell <mcottrell@gitlab.com>2022-11-09 00:22:59 +0300
committerSarah German <sgerman@gitlab.com>2022-11-09 00:22:59 +0300
commit1ae27a79d2086275b5ca3a1f60c5d67103dbadcb (patch)
tree4796c2cba286a35392846cb6f78f889a3ca0d391 /layouts
parent618007f8e9cc711a616e6186e178f429e1e656b2 (diff)
Add layout and styling for blueprint index page
Diffstat (limited to 'layouts')
-rw-r--r--layouts/blueprints/index.erb15
-rw-r--r--layouts/blueprints/table.erb53
2 files changed, 68 insertions, 0 deletions
diff --git a/layouts/blueprints/index.erb b/layouts/blueprints/index.erb
new file mode 100644
index 00000000..a8542be6
--- /dev/null
+++ b/layouts/blueprints/index.erb
@@ -0,0 +1,15 @@
+<% render '/default.*' do %>
+ <% if @item.identifier.match?('/ee/architecture/blueprints/**/*.md') %>
+ <%= render '/blueprints/table.*', { :blueprints => [ @item ], :summary => true } %>
+ <%= yield %>
+ <% else %>
+ <%= yield %>
+
+ <div class="gl-display-flex gl-justify-content-space-around">
+ <% all_blueprints.group_by{ |b| b[:status] }.each do |k,c| %>
+ <gl-label title="<%= "#{k}::#{c.size.to_s}" %>" />
+ <% end %>
+ </div>
+ <%= render '/blueprints/table.*', :blueprints => all_blueprints %>
+ <% end %>
+<% end %>
diff --git a/layouts/blueprints/table.erb b/layouts/blueprints/table.erb
new file mode 100644
index 00000000..fef13030
--- /dev/null
+++ b/layouts/blueprints/table.erb
@@ -0,0 +1,53 @@
+<% @summary ||= false %>
+
+<table>
+ <caption>List of GitLab Architecture Blueprints</caption>
+ <thead>
+ <tr>
+ <th>Status</th>
+ <% unless @summary %>
+ <th>Title</th>
+ <% end %>
+ <th>Author(s)</th>
+ <th>Coach</th>
+ <% if @summary %>
+ <th>Approver(s)</th>
+ <% end %>
+ <th>Owning Stage</th>
+ <th>Created</th>
+ </tr>
+ </thead>
+ <tbody>
+ <% @blueprints.each do |b| %>
+ <tr>
+ <td>
+ <%= gl_label(b[:status])%>
+ </td>
+ <% unless @summary %>
+ <td>
+ <%= link_to(b[:title], b.path) %>
+ </td>
+ <% end %>
+ <td>
+ <% b[:authors]&.each do |a| %>
+ <code><%= author_link(a) %></code>
+ <% end %>
+ </td>
+ <td>
+ <% if b[:coach] %>
+ <code><%= author_link(b[:coach]) %></code>
+ <% end %>
+ </td>
+ <% if @summary %>
+ <td>
+ <% b[:approvers]&.each do |a| %>
+ <code><%= author_link(a) %></code>
+ <% end %>
+ </td>
+ <% end %>
+ <td><%= gl_label(b[:'owning-stage']) %></td>
+ <td><%= blueprint_creation_date(b) %></td>
+ </tr>
+ <% end %>
+ </tbody>
+</table>