diff options
-rw-r--r-- | app/assets/images/icons.svg | 7 | ||||
-rw-r--r-- | app/assets/stylesheets/scm.css | 42 | ||||
-rw-r--r-- | app/helpers/icons_helper.rb | 12 | ||||
-rw-r--r-- | app/helpers/repositories_helper.rb | 4 | ||||
-rw-r--r-- | app/views/repositories/revision.html.erb | 10 | ||||
-rw-r--r-- | config/icon_source.yml | 5 |
6 files changed, 64 insertions, 16 deletions
diff --git a/app/assets/images/icons.svg b/app/assets/images/icons.svg index 55925cddd..ef44b6ddf 100644 --- a/app/assets/images/icons.svg +++ b/app/assets/images/icons.svg @@ -104,6 +104,13 @@ <path d="M7 7l5 5l-5 5"/> <path d="M13 7l5 5l-5 5"/> </symbol> + <symbol viewBox="0 0 24 24" id="icon--circle-dot-filled"> + <path d="M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-5 6.66a2 2 0 0 0 -1.977 1.697l-.018 .154l-.005 .149l.005 .15a2 2 0 1 0 1.995 -2.15z"/> + </symbol> + <symbol viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" id="icon--circle-minus"> + <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"/> + <path d="M9 12l6 0"/> + </symbol> <symbol viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" id="icon--clear-query"> <path d="M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z"/> <path d="M9 9l6 6m0 -6l-6 6"/> diff --git a/app/assets/stylesheets/scm.css b/app/assets/stylesheets/scm.css index e3eca24df..0df148f8e 100644 --- a/app/assets/stylesheets/scm.css +++ b/app/assets/stylesheets/scm.css @@ -19,24 +19,48 @@ div.revision-graph { position: absolute; min-width: 1px; } div.changeset-changes ul { margin: 0; padding: 0; } div.changeset-changes ul > ul { margin-left: 18px; padding: 0; } +div.changeset-changes ul:first-child > li {padding-left: 0} li.change { list-style-type:none; - background-image: url(/bullet_black.png); - background-position: 1px 2px; - background-repeat: no-repeat; padding-top: 1px; padding-bottom: 1px; padding-left: 20px; margin: 0; } -li.change.folder { background-image: url(/folder_open.png); } +li.change:not(:has(svg)) { + background-image: url(/bullet_black.png); + background-position: 1px 2px; + background-repeat: no-repeat; +} +li.change.folder:not(:has(svg)) { background-image: url(/folder_open.png); } li.change.folder.change-A { background-image: url(/folder_open_add.png); } li.change.folder.change-M { background-image: url(/folder_open_orange.png); } -li.change.change-A { background-image: url(/bullet_add.png); } -li.change.change-M { background-image: url(/bullet_orange.png); } -li.change.change-C { background-image: url(/bullet_blue.png); } -li.change.change-R { background-image: url(/bullet_purple.png); } -li.change.change-D { background-image: url(/bullet_delete.png); } + +li.change.change-A:not(:has(svg)) { background-image: url(/bullet_add.png); } +li.change.change-A svg.icon-svg { + fill: #5db651; + stroke: #ffffff; +} +li.change.change-M:not(:has(svg)) { background-image: url(/bullet_orange.png); } +li.change.change-M svg.icon-svg { + fill: #f0a810; + stroke: #ffffff; +} +li.change.change-C:not(:has(svg)) { background-image: url(/bullet_blue.png); } +li.change.change-C svg.icon-svg { + fill: #049cec; + stroke: #ffffff; +} +li.change.change-R:not(:has(svg)) { background-image: url(/bullet_purple.png); } +li.change.change-R svg.icon-svg { + fill: #8404ee; + stroke: #ffffff; +} +li.change.change-D:not(:has(svg)) { background-image: url(/bullet_delete.png); } +li.change.change-D svg.icon-svg { + fill: #c61a1a; + stroke: #ffffff; +} li.change .copied-from { font-style: italic; color: #999; font-size: 0.9em; } li.change .copied-from:before { content: " - "} diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb index 99006308e..473f8f780 100644 --- a/app/helpers/icons_helper.rb +++ b/app/helpers/icons_helper.rb @@ -67,6 +67,18 @@ module IconsHelper sprite_icon(icon_name, **options) end + def scm_change_icon(action, name, **options) + icon_name = case action + when 'A' + "add" + when 'D' + "circle-minus" + else + "circle-dot-filled" + end + sprite_icon(icon_name, name, size: 14) + end + private def svg_sprite_icon(icon_name, size: DEFAULT_ICON_SIZE, sprite: DEFAULT_SPRITE, css_class: nil) diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index 7a6978979..c72816367 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -96,7 +96,7 @@ module RepositoriesHelper if s = tree[file][:s] style << ' folder' path_param = to_path_param(@repository.relative_path(file)) - text = link_to(h(text), :controller => 'repositories', + text = link_to(sprite_icon("folder-open", h(text)), :controller => 'repositories', :action => 'show', :id => @project, :repository_id => @repository.identifier_param, @@ -108,7 +108,7 @@ module RepositoriesHelper elsif c = tree[file][:c] style << " change-#{c.action}" path_param = to_path_param(@repository.relative_path(c.path)) - text = link_to(h(text), :controller => 'repositories', + text = link_to(scm_change_icon(c.action, h(text)), :controller => 'repositories', :action => 'entry', :id => @project, :repository_id => @repository.identifier_param, diff --git a/app/views/repositories/revision.html.erb b/app/views/repositories/revision.html.erb index ba716dd41..9423e5438 100644 --- a/app/views/repositories/revision.html.erb +++ b/app/views/repositories/revision.html.erb @@ -30,11 +30,11 @@ <% if User.current.allowed_to?(:browse_repository, @project) %> <ul id="changes-legend"> -<li class="change change-A"><%= l(:label_added) %></li> -<li class="change change-M"><%= l(:label_modified) %></li> -<li class="change change-C"><%= l(:label_copied) %></li> -<li class="change change-R"><%= l(:label_renamed) %></li> -<li class="change change-D"><%= l(:label_deleted) %></li> +<li class="change change-A"><%= scm_change_icon("A", (:label_added)) %></li> +<li class="change change-M"><%= scm_change_icon("M", l(:label_modified)) %></li> +<li class="change change-C"><%= scm_change_icon("C", l(:label_copied)) %></li> +<li class="change change-R"><%= scm_change_icon("R", l(:label_renamed)) %></li> +<li class="change change-D"><%= scm_change_icon("D", l(:label_deleted)) %></li> </ul> <div class="changeset-changes"> diff --git a/config/icon_source.yml b/config/icon_source.yml index 8769a3212..a73e9a2ba 100644 --- a/config/icon_source.yml +++ b/config/icon_source.yml @@ -209,3 +209,8 @@ svg: square-rounded-plus - name: toggle-minus svg: square-rounded-minus +- name: circle-minus + svg: circle-minus +- name: circle-dot-filled + svg: circle-dot + style: filled |