Skip to content

Commit 15d5c6f

Browse files
committed
Merge branch 'master' of github.com:pebble/cloudpebble
2 parents 6414294 + a374950 commit 15d5c6f

File tree

13 files changed

+916
-41
lines changed

13 files changed

+916
-41
lines changed

ide/models/files.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,19 @@ def get_path(self, variant):
7979

8080
@property
8181
def root_path(self):
82-
return self.get_best_variant(ResourceVariant.VARIANT_DEFAULT).get_path()
82+
# Either return the path of the default variant if it exists
83+
# or strip out the suffix from another variant
84+
for variant, suffix in ResourceVariant.RESOURCE_VARIANTS:
85+
try:
86+
file_name = self.get_best_variant(variant).get_path()
87+
if variant == ResourceVariant.VARIANT_DEFAULT:
88+
return file_name
89+
else:
90+
file_name_parts = os.path.splitext(file_name)
91+
return file_name_parts[0][:len(file_name_parts[0]) - len(suffix) - 1] + file_name_parts[1]
92+
except ResourceVariant.DoesNotExist:
93+
continue
94+
raise Exception("No root path found for resource %s" % self.file_name)
8395

8496
class Meta(IdeModel.Meta):
8597
unique_together = (('project', 'file_name'),)
@@ -163,7 +175,6 @@ def save(self, *args, **kwargs):
163175
self.resource_file.save()
164176
super(ResourceVariant, self).save(*args, **kwargs)
165177

166-
167178
VARIANT_SUFFIXES = {
168179
0: '',
169180
1: '~bw',
@@ -278,4 +289,4 @@ def delete_file(sender, instance, **kwargs):
278289
try:
279290
os.unlink(instance.local_filename)
280291
except OSError:
281-
pass
292+
pass

ide/static/ide/css/ide.css

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,3 +974,32 @@ span.cm-autofilled-end {
974974
color: #d0d0d0;
975975
}
976976

977+
#fuzzy-prompt .modal-footer {
978+
padding: 0 0 10px 0;
979+
text-align: left;
980+
}
981+
982+
#fuzzy-results > div {
983+
984+
line-height: 28px;
985+
cursor: pointer;
986+
cursor: hand;
987+
padding-left: 25px;
988+
}
989+
990+
#fuzzy-results > div.selected {
991+
color: white;
992+
background-color: #333;
993+
}
994+
995+
#fuzzy-prompt-input-value {
996+
width: 100%;
997+
}
998+
999+
#fuzzy-prompt-input-value:focus{
1000+
outline: 0;
1001+
}
1002+
1003+
.padded-modal-header {
1004+
padding: 10px 25px 10px 10px;
1005+
}

0 commit comments

Comments
 (0)