main
erb 55 lines 2.71 KB
Raw
1 <% content_for :title, "New pull request · #{@repository.full_name}" %>
2
3 <div class="max-w-2xl mx-auto px-4 sm:px-6 py-12">
4 <div class="flex items-center gap-2 text-sm mb-2">
5 <%= link_to "@#{@owner.username}", user_profile_path(@owner.username), class: "text-brand-500 hover:underline font-medium" %>
6 <span class="text-gray-500">/</span>
7 <%= link_to @repository.name, repository_path(@owner.username, @repository.name), class: "text-brand-500 hover:underline font-semibold" %>
8 <span class="text-gray-500">/</span>
9 <%= link_to "pulls", repository_pull_requests_path(@owner.username, @repository.name), class: "text-gray-400 hover:text-gray-200 transition-colors" %>
10 </div>
11 <h1 class="text-xl font-semibold text-gray-100 mb-2">New pull request</h1>
12 <p class="text-sm text-gray-400 mb-8">Propose merging one branch into another in this repository.</p>
13
14 <% if @pull_request.errors.any? %>
15 <div class="border border-red-800/40 bg-red-900/20 rounded px-4 py-3 mb-6">
16 <p class="text-sm font-medium text-red-300 mb-1">Please fix the following errors:</p>
17 <ul class="list-disc pl-4 space-y-0.5">
18 <% @pull_request.errors.full_messages.each do |msg| %>
19 <li class="text-sm text-red-400"><%= msg %></li>
20 <% end %>
21 </ul>
22 </div>
23 <% end %>
24
25 <%= form_with model: @pull_request, url: repository_pull_requests_path(@owner.username, @repository.name),
26 method: :post, class: "space-y-6" do |f| %>
27 <div class="flex items-end gap-2">
28 <div class="flex-1 min-w-0">
29 <label class="form-label">base</label>
30 <%= f.select :base_ref, @branches, { selected: @pull_request.base_ref }, class: "form-input font-mono" %>
31 </div>
32 <div class="flex items-center pb-2.5 text-gray-500">&larr;</div>
33 <div class="flex-1 min-w-0">
34 <label class="form-label">compare</label>
35 <%= f.select :head_ref, @branches, { selected: @pull_request.head_ref }, class: "form-input font-mono" %>
36 </div>
37 </div>
38
39 <div>
40 <%= f.label :title, class: "form-label" %>
41 <%= f.text_field :title, class: "form-input", placeholder: "Short summary of the change", autofocus: true %>
42 </div>
43
44 <div>
45 <%= f.label :body, "Description", class: "form-label" %>
46 <span class="text-xs text-gray-500 ml-1">(optional, Markdown)</span>
47 <%= f.text_area :body, class: "form-input", rows: 6, placeholder: "What does this change do, and why?" %>
48 </div>
49
50 <div class="pt-2 border-t border-surface-600 flex items-center gap-3">
51 <%= f.submit "Create pull request", class: "btn-primary cursor-pointer" %>
52 <%= link_to "Cancel", repository_pull_requests_path(@owner.username, @repository.name), class: "btn-ghost" %>
53 </div>
54 <% end %>
55 </div>