Skip to content

Commit 4a29c61

Browse files
committed
Add commit history feature with AJAX support and UI enhancements
1 parent a392d54 commit 4a29c61

3 files changed

Lines changed: 760 additions & 157 deletions

File tree

assets/css/admin.css

Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,3 +496,249 @@
496496
.gtws-notice.hiding {
497497
animation: gtws-slideOut 0.3s ease-out forwards;
498498
}
499+
500+
/* Commit History Timeline */
501+
.gtws-commit-history {
502+
margin-top: 20px;
503+
padding: 20px;
504+
background: #fff;
505+
border: 1px solid #c3c4c7;
506+
border-radius: 4px;
507+
}
508+
509+
.gtws-commit-history h4 {
510+
margin: 0 0 20px 0;
511+
padding-bottom: 10px;
512+
border-bottom: 2px solid #2271b1;
513+
color: #1d2327;
514+
font-size: 16px;
515+
font-weight: 600;
516+
}
517+
518+
.gtws-history-timeline {
519+
position: relative;
520+
padding-left: 40px;
521+
}
522+
523+
.gtws-history-timeline::before {
524+
content: '';
525+
position: absolute;
526+
left: 15px;
527+
top: 8px;
528+
bottom: 0;
529+
width: 2px;
530+
background: linear-gradient(to bottom, #2271b1, #c3c4c7);
531+
}
532+
533+
.gtws-timeline-item {
534+
position: relative;
535+
padding-bottom: 25px;
536+
margin-bottom: 15px;
537+
}
538+
539+
.gtws-timeline-item:last-child {
540+
padding-bottom: 0;
541+
margin-bottom: 0;
542+
}
543+
544+
.gtws-timeline-marker {
545+
position: absolute;
546+
left: -40px;
547+
top: 0;
548+
width: 32px;
549+
height: 32px;
550+
background: #fff;
551+
border: 3px solid #c3c4c7;
552+
border-radius: 50%;
553+
display: flex;
554+
align-items: center;
555+
justify-content: center;
556+
z-index: 1;
557+
}
558+
559+
.gtws-timeline-item.current .gtws-timeline-marker {
560+
background: #2271b1;
561+
border-color: #2271b1;
562+
}
563+
564+
.gtws-timeline-marker .dashicons {
565+
font-size: 18px;
566+
width: 18px;
567+
height: 18px;
568+
color: #8c8f94;
569+
}
570+
571+
.gtws-timeline-item.current .gtws-timeline-marker .dashicons {
572+
color: #fff;
573+
}
574+
575+
.gtws-timeline-content {
576+
background: #f9f9f9;
577+
border: 1px solid #c3c4c7;
578+
border-radius: 6px;
579+
padding: 15px;
580+
position: relative;
581+
transition: all 0.2s;
582+
}
583+
584+
.gtws-timeline-item.current .gtws-timeline-content {
585+
background: #e7f3ff;
586+
border-color: #2271b1;
587+
box-shadow: 0 2px 8px rgba(34, 113, 177, 0.15);
588+
}
589+
590+
.gtws-timeline-content:hover {
591+
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
592+
}
593+
594+
.gtws-commit-header {
595+
display: flex;
596+
align-items: center;
597+
gap: 10px;
598+
margin-bottom: 8px;
599+
flex-wrap: wrap;
600+
}
601+
602+
.gtws-commit-sha {
603+
padding: 4px 8px;
604+
background: #1d2327;
605+
color: #fff;
606+
border-radius: 4px;
607+
font-size: 13px;
608+
font-weight: 600;
609+
font-family: 'Courier New', monospace;
610+
}
611+
612+
.gtws-commit-author {
613+
color: #646970;
614+
font-size: 13px;
615+
}
616+
617+
.gtws-current-badge {
618+
padding: 4px 10px;
619+
background: #2271b1;
620+
color: #fff;
621+
border-radius: 12px;
622+
font-size: 11px;
623+
font-weight: 600;
624+
text-transform: uppercase;
625+
letter-spacing: 0.5px;
626+
}
627+
628+
.gtws-commit-message {
629+
color: #1d2327;
630+
font-size: 14px;
631+
line-height: 1.5;
632+
margin-bottom: 8px;
633+
font-weight: 500;
634+
}
635+
636+
.gtws-commit-date {
637+
color: #646970;
638+
font-size: 12px;
639+
margin-bottom: 10px;
640+
}
641+
642+
.gtws-sync-info {
643+
display: inline-flex;
644+
align-items: center;
645+
gap: 5px;
646+
margin-left: 10px;
647+
padding: 3px 8px;
648+
background: #d1e7dd;
649+
color: #0a3622;
650+
border-radius: 3px;
651+
font-size: 11px;
652+
}
653+
654+
.gtws-sync-info .dashicons {
655+
font-size: 14px;
656+
width: 14px;
657+
height: 14px;
658+
}
659+
660+
.gtws-restore-commit {
661+
margin-top: 10px;
662+
background: #fff;
663+
border: 1px solid #2271b1;
664+
color: #2271b1;
665+
font-size: 13px;
666+
padding: 6px 12px;
667+
cursor: pointer;
668+
transition: all 0.2s;
669+
}
670+
671+
.gtws-restore-commit:hover {
672+
background: #2271b1;
673+
color: #fff;
674+
}
675+
676+
.gtws-restore-commit:disabled {
677+
opacity: 0.6;
678+
cursor: not-allowed;
679+
}
680+
681+
.gtws-restore-commit .dashicons {
682+
font-size: 16px;
683+
width: 16px;
684+
height: 16px;
685+
}
686+
687+
.gtws-no-history {
688+
text-align: center;
689+
padding: 40px 20px;
690+
color: #646970;
691+
font-style: italic;
692+
}
693+
694+
.gtws-view-history.active {
695+
background: #2271b1;
696+
color: #fff;
697+
border-color: #2271b1;
698+
}
699+
700+
.gtws-view-history.active:hover {
701+
background: #135e96;
702+
border-color: #135e96;
703+
}
704+
705+
/* Timeline animation */
706+
.gtws-timeline-item {
707+
animation: gtws-fadeIn 0.4s ease-out;
708+
}
709+
710+
@keyframes gtws-fadeIn {
711+
from {
712+
opacity: 0;
713+
transform: translateY(10px);
714+
}
715+
to {
716+
opacity: 1;
717+
transform: translateY(0);
718+
}
719+
}
720+
721+
/* Responsive timeline */
722+
@media (max-width: 782px) {
723+
.gtws-history-timeline {
724+
padding-left: 35px;
725+
}
726+
727+
.gtws-timeline-marker {
728+
left: -35px;
729+
width: 28px;
730+
height: 28px;
731+
}
732+
733+
.gtws-timeline-marker .dashicons {
734+
font-size: 16px;
735+
width: 16px;
736+
height: 16px;
737+
}
738+
739+
.gtws-commit-header {
740+
flex-direction: column;
741+
align-items: flex-start;
742+
gap: 5px;
743+
}
744+
}

0 commit comments

Comments
 (0)