Skip to content

Commit

Permalink
Merge branch 'master' of github.com:pebble/cloudpebble
Browse files Browse the repository at this point in the history
  • Loading branch information
Katharine committed Jul 18, 2015
2 parents 6414294 + a374950 commit 15d5c6f
Show file tree
Hide file tree
Showing 13 changed files with 916 additions and 41 deletions.
17 changes: 14 additions & 3 deletions ide/models/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,19 @@ def get_path(self, variant):

@property
def root_path(self):
return self.get_best_variant(ResourceVariant.VARIANT_DEFAULT).get_path()
# Either return the path of the default variant if it exists
# or strip out the suffix from another variant
for variant, suffix in ResourceVariant.RESOURCE_VARIANTS:
try:
file_name = self.get_best_variant(variant).get_path()
if variant == ResourceVariant.VARIANT_DEFAULT:
return file_name
else:
file_name_parts = os.path.splitext(file_name)
return file_name_parts[0][:len(file_name_parts[0]) - len(suffix) - 1] + file_name_parts[1]
except ResourceVariant.DoesNotExist:
continue
raise Exception("No root path found for resource %s" % self.file_name)

class Meta(IdeModel.Meta):
unique_together = (('project', 'file_name'),)
Expand Down Expand Up @@ -163,7 +175,6 @@ def save(self, *args, **kwargs):
self.resource_file.save()
super(ResourceVariant, self).save(*args, **kwargs)


VARIANT_SUFFIXES = {
0: '',
1: '~bw',
Expand Down Expand Up @@ -278,4 +289,4 @@ def delete_file(sender, instance, **kwargs):
try:
os.unlink(instance.local_filename)
except OSError:
pass
pass
29 changes: 29 additions & 0 deletions ide/static/ide/css/ide.css
Original file line number Diff line number Diff line change
Expand Up @@ -974,3 +974,32 @@ span.cm-autofilled-end {
color: #d0d0d0;
}

#fuzzy-prompt .modal-footer {
padding: 0 0 10px 0;
text-align: left;
}

#fuzzy-results > div {

line-height: 28px;
cursor: pointer;
cursor: hand;
padding-left: 25px;
}

#fuzzy-results > div.selected {
color: white;
background-color: #333;
}

#fuzzy-prompt-input-value {
width: 100%;
}

#fuzzy-prompt-input-value:focus{
outline: 0;
}

.padded-modal-header {
padding: 10px 25px 10px 10px;
}
Loading

0 comments on commit 15d5c6f

Please sign in to comment.