Commit 2951c26fbb1ff030a7daea8815cfd3c2bd03701f

Thomas de Grivel 2023-01-02T20:15:27

list-group for commit message

diff --git a/assets/css/app.scss b/assets/css/app.scss
index 6bfa696..bfbf332 100644
--- a/assets/css/app.scss
+++ b/assets/css/app.scss
@@ -215,7 +215,17 @@ table.git-log {
     .date    { min-width: 15em; }
     .message { min-width: 15em; }
 }
-
+/* repository */
+.commit {
+    .btn {
+        float: right;
+    }
+    .property {
+        display: inline-block;
+        font-weight: bold;
+        min-width: 5em;
+    }
+}
 /* LiveView specific classes for your customization */
 .phx-no-feedback.invalid-feedback,
 .phx-no-feedback .invalid-feedback {
diff --git a/lib/kmxgit_web/templates/repository/show_commit_message.html.heex b/lib/kmxgit_web/templates/repository/show_commit_message.html.heex
index ed698b5..121cde9 100644
--- a/lib/kmxgit_web/templates/repository/show_commit_message.html.heex
+++ b/lib/kmxgit_web/templates/repository/show_commit_message.html.heex
@@ -1,38 +1,22 @@
 <p>
-  <ul class="list-group">
+  <ul class="list-group commit">
     <li class="list-group-item bg-h">
+      <%= link gettext("Show log"), to: Routes.repository_path(@conn, :show, Repository.owner_slug(@repo), Repository.splat(@repo, ["_log", @tree] ++ (if @path, do: String.split(@path, "/"), else: []))) <> "##{@git.log1.hash}", class: "btn btn-primary" %>
       <h2>Commit</h2>
     </li>
     <li class="list-group-item">
-      <table class="table properties">
-        <tr>
-          <th><%= gettext "Hash" %></th>
-          <td>
-            <%= link id: @git.log1.hash,
-                     to: Routes.repository_path(@conn, :show, Repository.owner_slug(@repo), Repository.splat(@repo, ["_commit", @git.log1.hash])) do %>
-              <%= String.slice(@git.log1.hash, 0..7) %>
-            <% end %>
-          </td>
-        </tr>
-        <tr>
-          <th><%= gettext "Author" %></th>
-          <td>
-            <%= render(KmxgitWeb.UserView, "avatar.html", conn: @conn, email: @git.log1.author_email, size: 48, right: @git.log1.author, title: @git.log1.author, class: "commit-avatar") %>
-          </td>
-        </tr>
-        <tr>
-          <th><%= gettext "Date" %></th>
-          <td>
-            <%= link NaiveDateTime.add(~N[1970-01-01 00:00:00], @git.log1.date), to: Routes.repository_path(@conn, :show, Repository.owner_slug(@repo), Repository.splat(@repo, ["_log", @tree] ++ (if @path, do: String.split(@path, "/"), else: []))) <> "##{@git.log1.hash}" %>
-          </td>
-        </tr>
-        <tr>
-          <th><%= gettext "Message" %></th>
-          <td>
-            <pre><%= @git.log1.message %></pre>
-          </td>
-        </tr>
-      </table>
-    </li>
+      <p>
+        <span class="property"><%= gettext "Hash" %> :</span>
+        <%= link id: @git.log1.hash,
+        to: Routes.repository_path(@conn, :show, Repository.owner_slug(@repo), Repository.splat(@repo, ["_commit", @git.log1.hash])) do %><%= String.slice(@git.log1.hash, 0..7) %><% end %>
+        <br/>
+        <span class="property"><%= gettext "Author" %> :</span>
+        <%= render(KmxgitWeb.UserView, "avatar.html", conn: @conn, email: @git.log1.author_email, size: 48, right: @git.log1.author, title: @git.log1.author, class: "commit-avatar") %>
+        <br/>
+        <span class="property"><%= gettext "Date" %> :</span>
+        <%= NaiveDateTime.add(~N[1970-01-01 00:00:00], @git.log1.date) %>
+      </p>
+      <pre><%= @git.log1.message %></pre>
+</li>
   </ul>
 </p>
diff --git a/priv/static/_assets/app.css b/priv/static/_assets/app.css
index 311c5a3..50f2747 100644
--- a/priv/static/_assets/app.css
+++ b/priv/static/_assets/app.css
@@ -19316,6 +19316,10 @@ pre.wrap {
   background: #faf9ff;
 }
 
+.commit-avatar {
+  margin-right: 0.5em;
+}
+
 .clear {
   clear: both;
 }
@@ -19460,6 +19464,16 @@ table.git-log .message {
   min-width: 15em;
 }
 
+/* repository */
+.commit .btn {
+  float: right;
+}
+.commit .property {
+  display: inline-block;
+  font-weight: bold;
+  min-width: 5em;
+}
+
 /* LiveView specific classes for your customization */
 .phx-no-feedback.invalid-feedback,
 .phx-no-feedback .invalid-feedback {