update log style

This commit is contained in:
Hylke Bons 2011-06-10 21:26:26 +01:00
parent 30dd767260
commit 3920d42e28
5 changed files with 65 additions and 70 deletions

View file

@ -77,17 +77,17 @@ namespace SparkleShare {
private void CreateEventLog ()
{
string name = Path.GetFileName (LocalPath);
Title = "Recent Events";
Separator = new NSBox (new RectangleF (0, 559, 480, 1)) {
Separator = new NSBox (new RectangleF (0, 573, 480, 1)) {
BorderColor = NSColor.LightGray,
BoxType = NSBoxType.NSBoxCustom
};
ContentView.AddSubview (Separator);
this.popup_button = new NSPopUpButton (new RectangleF (100, 570, 200, 26), false);
this.popup_button = new NSPopUpButton (new RectangleF (480 - 156 - 8, 640 - 31 - 26, 156, 26), false);
//this.popup_button.
this.popup_button.AddItem ("All Folders");
this.popup_button.Menu.AddItem (NSMenuItem.SeparatorItem);
this.popup_button.AddItems (SparkleShare.Controller.Folders.ToArray ());
@ -106,7 +106,7 @@ namespace SparkleShare {
ProgressIndicator.StartAnimation (this);
WebView = new WebView (new RectangleF (0, 0, 480, 559), "", ""){
WebView = new WebView (new RectangleF (0, 0, 480, 573 ), "", ""){
PolicyDelegate = new SparkleWebPolicyDelegate ()
};
@ -135,8 +135,7 @@ namespace SparkleShare {
private void GenerateHTML ()
{
string folder_name = Path.GetFileName (LocalPath);
HTML = SparkleShare.Controller.GetHTMLLog ();
HTML = SparkleShare.Controller.GetHTMLLog ();
HTML = HTML.Replace ("<!-- $body-font-family -->", "Lucida Grande");
HTML = HTML.Replace ("<!-- $day-entry-header-font-size -->", "13.6px");

View file

@ -154,7 +154,7 @@ namespace SparkleShare {
Menu.AddItem (NSMenuItem.SeparatorItem);
RecentEventsMenuItem = new NSMenuItem () {
Title = "Show Recent Events"
Title = "Recent Events"
};
RecentEventsMenuItem.Activated +=delegate {

View file

@ -320,54 +320,46 @@ namespace SparkleShare {
string event_entry = "<dl>";
if (change_set.IsMerge) {
event_entry += "<dt>Merged a branch</dt>";
event_entry += "<dd>Merged a branch</dd>";
} else {
if (change_set.Edited.Count > 0) {
event_entry += "<dt>Edited</dt>";
foreach (string file_path in change_set.Edited) {
string absolute_file_path = SparkleHelpers.CombineMore (SparklePaths.SparklePath,
change_set.Folder, file_path);
if (File.Exists (absolute_file_path))
event_entry += "<dd><a href='" + absolute_file_path + "'>" + file_path + "</a></dd>";
event_entry += "<dd class='file-edited'><a href='" + absolute_file_path + "'>" + file_path + "</a></dd>";
else
event_entry += "<dd>" + file_path + "</dd>";
event_entry += "<dd class='file-edited'>" + file_path + "</dd>";
}
}
if (change_set.Added.Count > 0) {
event_entry += "<dt>Added</dt>";
foreach (string file_path in change_set.Added) {
string absolute_file_path = SparkleHelpers.CombineMore (SparklePaths.SparklePath,
change_set.Folder, file_path);
if (File.Exists (absolute_file_path))
event_entry += "<dd><a href='" + absolute_file_path + "'>" + file_path + "</a></dd>";
event_entry += "<dd class='file-added'><a href='" + absolute_file_path + "'>" + file_path + "</a></dd>";
else
event_entry += "<dd>" + file_path + "</dd>";
event_entry += "<dd class='file-added'>" + file_path + "</dd>";
}
}
if (change_set.Deleted.Count > 0) {
event_entry += "<dt>Deleted</dt>";
foreach (string file_path in change_set.Deleted) {
string absolute_file_path = SparkleHelpers.CombineMore (SparklePaths.SparklePath,
change_set.Folder, file_path);
if (File.Exists (absolute_file_path))
event_entry += "<dd><a href='" + absolute_file_path + "'>" + file_path + "</a></dd>";
event_entry += "<dd class='file-deleted'><a href='" + absolute_file_path + "'>" + file_path + "</a></dd>";
else
event_entry += "<dd>" + file_path + "</dd>";
event_entry += "<dd class='file-deleted'>" + file_path + "</dd>";
}
}
if (change_set.MovedFrom.Count > 0) {
event_entry += "<dt>Moved</dt>";
int i = 0;
foreach (string file_path in change_set.MovedFrom) {
string to_file_path = change_set.MovedTo [i];
@ -377,10 +369,10 @@ namespace SparkleShare {
change_set.Folder, to_file_path);
if (File.Exists (absolute_file_path))
event_entry += "<dd><a href='" + absolute_file_path + "'>" + file_path + "</a><br/>" +
event_entry += "<dd class='file-moved'><a href='" + absolute_file_path + "'>" + file_path + "</a><br/>" +
"<span class='moved-arrow'>&rarr;</span> ";
else
event_entry += "<dd>" + file_path + "<br/>" +
event_entry += "<dd class='file-moved'>" + file_path + "<br/>" +
"<span class='moved-arrow'>&rarr;</span> ";
if (File.Exists (absolute_to_file_path))
@ -1037,15 +1029,14 @@ namespace SparkleShare {
}
private string [] tango_palette = new string [] {"#fce94f", "#edd400",
"#c4a000", "#8ae234", "#73d216", "#4e9a06", "#fcaf3e", "#f57900",
"#ce5c00", "#e9b96e", "#c17d11", "#8f5902", "#729fcf", "#3465a4",
"#204a87", "#ad7fa8", "#75507b", "#5c3566", "#888a85", "#555753",
"#2e3436", "#ef2929", "#cc0000", "#a40000"};
private string [] tango_palette = new string [] {"#eaab00", "#e37222",
"#3892ab", "#33c2cb", "#19b271", "#9eab05", "#8599a8", "#9ca696",
"#b88454", "#cc0033", "#8f6678", "#8c6cd0", "#796cbf", "#4060af",
"#aa9c8f", "#818a8f"};
private string AssignColor (string s)
{
string hash = GetMD5 (s).Substring (0, 6);
string hash = GetMD5 (s).Substring (0, 8);
string numbers = Regex.Replace (hash, "[a-z]", "");
int number = int.Parse (numbers);
return this.tango_palette [number % this.tango_palette.Length];

View file

@ -1,19 +1,19 @@
<div class='event-entry'>
<div class='event-entry-content' style='border-bottom: 3px <!-- $event-folder-color --> solid'>
<div class='event-entry-content'>
<div class='no-buddy-icon'>
<div class='buddy-icon' style='background-image: url("<!-- $event-avatar-url -->");'></div>
<div class='event-info'><div style="float:left;">
<div class='no-buddy-icon'>
<div class='buddy-icon' style='background-image: url("<!-- $event-avatar-url -->");'></div>
</div>
<b><!-- $event-user-name --></b><br/>
<small><!-- $event-time --></small>
</div>
<div class='event-time' style='opacity: 0.8;background-color: <!-- $event-folder-color -->'><!-- $event-folder --></div>
</div>
<div class='event-info'>
<b><!-- $event-user-name --></b>
<!-- $event-entry-content -->
</div>
<div class='event-time' style='position: relative;float: right'><!-- $event-folder --> &bull; <!-- $event-time --></div>
<div style='clear: both'></div>
</div>
</div>

View file

@ -4,7 +4,7 @@
<title>SparkleShare Event Log</title>
<style>
body {
background-color: #f0f0f0;
background-color: #dedede;
color: <!-- $body-color -->;
font-size: <!-- $body-font-size -->;
font-family: <!-- $body-font-family -->;
@ -16,7 +16,7 @@
small {
font-size: <!-- $small-font-size -->;
color: <!-- $small-color -->;
color: <!-- $secondary-font-color -->;
}
.moved-arrow {
@ -25,13 +25,9 @@
.day-entry-header {
font-size: <!-- $day-entry-header-font-size -->;
color: #babdb6;
text-align: center;
width: 90%;
text-shadow: 0 1px 0 rgba(255, 255, 255, 1.0);
color: #444;
margin-bottom: 9px;
margin-left: auto;
margin-right: auto;
margin-left: 40px;
}
.day-entry-content {
@ -49,42 +45,46 @@
.event-time {
font-size: 80%;
color: <!-- $secondary-font-color -->;
float: right;
color: #fff;
float: right;
padding: 3px 15px;
font-weight: bold;
-webkit-border-radius: 100px;
}
.event-entry-content {
display: block;
width: 400px;
background-color: #fff;
width: 440px;
background-color: #f0f0f0;
margin-left: auto;
margin-right: auto;
margin-bottom: 9px;
padding: 18px;
-webkit-border-radius: 6px 6px 0 0;
border: #ddd 1px solid;
margin-bottom: 12px;
padding: 0px;
border: #ccc 1px solid;
-webkit-border-radius: 0 0 3px 3px;
}
dl {
padding: 0;
margin: 0;
padding-bottom: 15px;
}
dt {
padding-bottom: 12px;
padding-top: 12px;
font-size: 80%;
color: <!-- $secondary-font-color -->;
padding : 0;
margin: 0;
}
dd {
width: 300px;
width: 90%;
overflow: hidden;
padding-left: 0;
margin-left: 12px;
margin-left: 24px;
text-overflow: ellipsis;
padding-bottom: 9px;
padding: 4px 0px;
border-bottom: 1px solid #ddd;
}
dd:first-child {
padding-top: 12px;
}
dd:last-child {
border: none;
padding-bottom: 12px;
}
.no-buddy-icon {
@ -104,6 +104,11 @@
.event-info {
float: left;
padding: 15px;
width: 410px;
background-color: #fff;
border-bottom: 1px #ccc solid;
position: relative;
}
</style>
</head>